Skip to content

🐛 Biome VS Code Extension Configuration Issue when format on save #7138

@kuu13580

Description

@kuu13580

Environment information (from ./frontend)

CLI:
  Version:                      2.1.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  BIOME_THREADS:                unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v22.17.1
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         npm/10.9.2

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         biome.json
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  true

Workspace:
  Open Documents:               0

What happened?

I'm experiencing an issue where the Biome VS Code extension seems to ignore the configuration in my biome.json file when it's located in a subdirectory of a devcontainer workspace. Specifically, this happens during formatOnSave operations. For Example, The formatter uses tabs (\t) instead of spaces despite the explicit space configuration. Could you help me determine if this is a bug or a configuration issue on my end?

Project Structure

/workspaces/project/
├── .vscode/
│   └── settings.json          # VS Code workspace settings
├── .devcontainer/
│   └── devcontainer.json     # devcontainer configuration
├── frontend/                  # Sub-directory containing Biome config
│   ├── biome.json            # Biome configuration file
│   ├── package.json
│   └── node_modules/
│       └── @biomejs/cli-linux-x64/
│           └── biome         # Biome binary
└── ...

Configuration Files

VS Code Settings (.vscode/settings.json)

{
  "editor.tabSize": 2,
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "biomejs.biome",
  "editor.codeActionsOnSave": {
    "source.fixAll.biome": "explicit",
    "source.organizeImports.biome": "never"
  },
  "[javascript]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[typescript]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[javascriptreact]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[json]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "biome.lsp.bin": "./frontend/node_modules/@biomejs/cli-linux-x64/biome",
  "biome.configurationPath": "./frontend/biome.json"
}

Biome Configuration (frontend/biome.json)

{
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true
  },
  "files": {
    "ignoreUnknown": false,
    "includes": ["**/*", "!dist/**", "!node_modules/**", "!**/*.d.ts"]
  },
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 120,
    "lineEnding": "lf",
    "formatWithErrors": false
  },
  "javascript": {
    "formatter": {
      "enabled": true,
      "quoteStyle": "single",
      "jsxQuoteStyle": "single",
      "semicolons": "always",
      "trailingCommas": "es5",
      "arrowParentheses": "asNeeded",
      "bracketSpacing": true,
      "bracketSameLine": false,
      "quoteProperties": "asNeeded"
    }
  },
  "json": {
    "formatter": {
      "enabled": true,
      "indentStyle": "space"
    }
  }
}

VS Code Output Log

2025-08-06 18:47:05.390 [info] [Trace - 6:47:05 PM] Received response 'textDocument/formatting - (7)' in 2ms.
2025-08-06 18:47:05.390 [info] Result: [
    {
        "newText": "\t",
        "range": {
            "end": {
                "character": 7,
                "line": 50
            },
            "start": {
                "character": 5,
                "line": 50
            }
        }
    }
]

Steps to Reproduce

  1. Open VS Code in devcontainer environment
  2. Navigate to a TypeScript/JavaScript file in the frontend/ directory
  3. Add some code with inconsistent indentation (using tabs)
  4. Save the file (this triggers formatOnSave since "editor.formatOnSave": true is enabled)
  5. Observe that the file is formatted with tabs instead of spaces

Workaround Attempts

None found yet. The issue persists despite:

  • Correct binary path configuration (biome.lsp.bin)
  • Correct configuration path (biome.configurationPath)
  • Valid JSON configuration file
  • Working Biome CLI (can format correctly when run manually)

Expected result

The formatter should replace indentation with 2 spaces, not tabs.

Expected log output should be:

{
    "newText": "  ",  // 2 spaces instead of \t
    "range": {
        "end": {
            "character": 7,
            "line": 50
        },
        "start": {
            "character": 5,
            "line": 50
        }
    }
}

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

Labels

A-CoreArea: coreA-LSPArea: language server protocolS-Bug-confirmedStatus: report has been confirmed as a valid bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions