Skip to content

🐛 Unparseable biome.json is silently ignored (defaults applied) when checking explicit paths #11504

Description

@petergil

Environment information

Details
CLI:
  Version:                      2.5.9
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_DISTRIBUTION:                unset
  BIOME_LOG_FILE:                    unset
  BIOME_LOG_PATH:                    unset
  BIOME_LOG_PREFIX_NAME:             unset
  BIOME_LOG_LEVEL:                   unset
  BIOME_LOG_KIND:                    unset
  BIOME_CONFIG_PATH:                 unset
  BIOME_THREADS:                     unset
  BIOME_WATCHER_KIND:                unset
  BIOME_WATCHER_POLLING_INTERVAL:    unset
  BIOME_BINARY:                      unset
  RUST_BACKTRACE:                    unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       Not set
  Path:                         unset

Workspace:
  Open Documents:               0

Note: this rage output is itself part of the bug evidence — it was captured in a directory containing a biome.json, yet reports Configuration: Not set because that config failed to parse (see below). The silent-ignore behavior also reproduces on 2.4.15 and 2.2.4, so this is not a recent regression; 2.5.10 was not run directly, but its changelog contains no configuration-loading changes.

What happened?

When biome.json fails to parse, the severity of the failure depends on
how biome is invoked — and in the common CI/task-runner shape (explicit
file or directory arguments below the config's directory), the broken
config is silently ignored and built-in defaults are applied, with no
diagnostic of any kind.

All rows verified on 2.5.9:

Invocation Behavior with unparseable biome.json
biome check --config-path=biome.json … Config parse errors reported loudly ✅
biome check . (config dir in the scanned set) Parse diagnostic reported for biome.json as a file, then proceeds with defaults ⚠️
biome check <paths> (explicit paths / subdirectory) No diagnostic at all; defaults silently applied ❌

Reproduction (no playground link — config-file discovery cannot be
reproduced in the playground):

mkdir repro && cd repro

cat > biome.json <<'EOF'
{
  // comment breaks strict json
  "formatter": { "indentStyle": "space" }
}
EOF

cat > probe.ts <<'EOF'
const x = 1
export { x }
EOF

biome check probe.ts

Output — no mention of the broken configuration; both diagnostics betray
built-in defaults being applied (semicolons that no configuration asked
for, and default assist settings):

probe.ts:2:1 assist/source/organizeImports  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━

  × This statement must be preceded by a blank line. Add a newline before this statement.
  ...

probe.ts format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × Formatter would have printed the following content:

    1   │ - const·x·=·1
    2   │ - export·{·x·}
      1 │ + const·x·=·1;
      2 │ + export·{·x·};

Checked 1 file in 2ms. No fixes applied.
Found 2 errors.

A subdirectory argument behaves the same as the explicit file
(mkdir sub && cp probe.ts sub/ && biome check sub — silent). Only when
the config's own directory is in the scanned set (biome check .) or the
config is named explicitly (--config-path=biome.json) do the parse
errors surface.

Real-world impact: our monorepo's lint tasks run
biome check --write <projectRoot> per project — the explicit-path shape.
A config edit that was invalid in strict JSON (a // comment, legal only
in biome.jsonc) made every one of those tasks silently format with
built-in defaults (tabs, double quotes, semicolons) instead of the repo
style; one repo-wide run reformatted ~1700 files with no error anywhere.
The silent path also disables lint rules configured in the broken file —
in our case a security-motivated rule rollout — without any signal.

Expected result

A diagnostic that the discovered configuration failed to parse and that
defaults would be (or were) used — or the 1.x contract: "The configuration
file has errors. Biome will report only parsing errors until the
configuration is fixed" (biome#3518; the VS Code extension surfaced the
same message at least through 2.0.x, biome-vscode#681). Silently
substituting defaults is the worst option for --write callers.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Activity

  1. added theissue type on Aug 25, 2026
  2. added
    S-Needs triage
    on Aug 25, 2026
  3. ematipico commented on Aug 25, 2026

    @ematipico
    Member

    and in the common CI/task-runner shape (explicit
    file or directory arguments below the config's directory), the broken
    config is silently ignored and built-in defaults are applied, with no
    diagnostic of any kind.

    And yet I don't any mention of the ci command.

    Please provide a reproduction we can use.

  4. added
    S-Needs repro
    on Aug 25, 2026
  5. biome-cookie commented on Aug 25, 2026

    @biome-cookie

    Hello @petergil, please provide a minimal reproduction. You can use one of the following options:

    • Provide a link to our playground, if it's applicable.
    • Provide a link to GitHub repository. To easily create a reproduction, you can use our interactive CLI via npm create @biomejs/biome-reproduction

    Issues marked with S-Needs repro will be closed if they have no activity within 3 days.

  6. removed
    S-Needs triage
    on Aug 25, 2026
  7. petergil commented on Aug 25, 2026

    @petergil
    Author

    Apologies for the confusing wording — "CI/task-runner shape" referred to how CI systems typically invoke biome (explicit file/directory arguments, e.g. our tasks run biome check --write <projectRoot> per monorepo project), not to the ci command. The repro in the report uses biome check.

    That said, I've now also tested biome ci in the same repro on 2.5.9, and it behaves identically:

    • biome ci probe.ts and biome ci sub/ → no config diagnostic of any kind, built-in defaults applied
    • biome ci . → the biome.json parse diagnostics are reported

    So the pattern holds across both commands: the config parse failure only surfaces when the config file itself lands in the scanned set (.) or is named via --config-path; any explicit path below it gets silent defaults.

    Cloneable reproduction: https://github.com/petergil/biome-silent-config-repro — two files plus a Makefile, no dependencies. make reproduce-bug runs the silent case, shows biome rage reporting Configuration: Not set despite the biome.json sitting right there, then the biome check . contrast where the same config produces loud parse errors. (Override the binary with make reproduce-bug BIOME='npx @biomejs/biome@2.5.9'.) The playground isn't applicable since the bug is in config-file discovery.

  8. added
    S-Needs triage
    and removed
    S-Needs repro
    on Aug 25, 2026
  9. petergil commented on Aug 28, 2026

    @petergil
    Author

    Ok, I've now had some time to look deeper into this and I believe that I have found the issue.

    tl;dr: Certain classes of parse failure when loading a biome.json/.jsonc configuration file get treated as "not found, try next alternative" instead of "invalid".

    biome check . appearing to work was a red herring, that invocation also silently skips the configuration file and uses defaults, but then reports the errors during normal operation.


    Verified against main (4d9c1d5) by calling load_configuration/read_config directly against a MemoryFileSystem.

    read_config's auto-search predicate (biome_service/src/configuration.rs:307-314):

    let is_found = deserialized_content
        .deserialized
        .as_ref()
        .is_some_and(|config| if seek_root { config.is_root() } else { true });
    if is_found {
        deserialized = Some(deserialized_content);   // diagnostics only kept here
    }
    is_found

    Whenever deserialized_content.deserialized is None, is_found is false and auto_search_files_with_predicate doesn't consider it a valid config and the search continues upward. Which means that deserialized_content is never assigned to deserialized, and the diagnostics are dropped. With nothing further up the tree, read_config returns Ok(None), and load_configuration yields LoadedConfiguration::default(). This explains the rage output (Configuration: Not set).

    This all happens before the CLI's diagnostic-printing step runs, so there's nothing for it to print.

    deserialized_content.deserialized is_some() when the object-list parser can parse the file well enough that the root of the file is detected as a JsonObjectValue.

    For some malformed files the parser can partially recover (trailing comma in biome.json/missing colon/wrong-typed field) and deserialized comes back Some(config) with an ERROR diagnostic attached, and these fail loudly, as expected.

    If it can't recover at all (comment at the root in biome.json/stray token/unquoted key/empty file) it will fail to return a usable root node (most commonly a JsonArrayValue), so deserialized collapses straight to None, which the predicate reads as "not a config, keep searching."

    One way to fix this bug would be to have the auto-search predicate keep the diagnostics even when deserialized is None or is_root() is false, so a file that looks like a config candidate (right name, in
    the search path) but fails to parse surfaces its Error diagnostics instead of being silently treated as "not a config, keep searching."

  10. petergil commented on Aug 29, 2026

    @petergil
    Author

    Sorry, I noticed that I missed attaching the test case file. You can download this to crates/biome_service/tests/ and remove the .txt .

    Then you can run the tests with:

    cargo test -p biome_service --test issue_11504_malformed_config_discovery

    issue_11504_malformed_config_discovery.rs.txt

  11. ematipico commented on Aug 29, 2026

    @ematipico
    Member

    @petergil add these files to the reproduction, we usually don't download files like this (security reason)

  12. AlbinoGeek commented on Sep 22, 2026

    @AlbinoGeek
    Contributor

    Another inline reproduction, 2.5.14, Linux. Two files in an empty directory:

    biome.json

    {
      "$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
      // tabs are banned here
      "formatter": { "indentStyle": "space" },
      "linter": { "rules": { "recommended": false, "suspicious": { "noDebugger": "error" } } }
    }

    a.js

    export function f() {
      debugger;
    }

    biome format a.js wants to re-indent with tabs (the default), ignoring indentStyle: "space", and biome lint a.js doesn't report the debugger the config asks for. biome rage shows the configuration as not set. Replacing the comment with a trailing comma is reported as a parse error, so only comments take this silent path. It behaves the same with /* */.

    Real-world impact: in one of our repositories a single comment in biome.json made Biome lint 606 files with defaults instead of the 1,795 its config selects, surfacing 45,462 errors that weren't real. Nothing indicated the config had been dropped, so it looked like a regression in the code rather than in the config.


    Tool Use Disclaimer: Claude Code using Anthropic Opus 5.5 helped build the reproduction.

  13. added
    A-CLI
    S-Bug-confirmed
    and removed
    S-Needs triage
    on Sep 23, 2026
  14. ematipico commented on Sep 23, 2026

    @ematipico
    Member

    I'm surprised we don't have tests for these cases. I can reproduce the issue

  15. self-assigned this
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-CLIS-Bug-confirmed

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions