Skip to content

🐛 formatWithErrors is ignored by source.fixAll.biome #8471

Description

@ericprestemon

Environment information

CLI:
  Version:                      2.3.8
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

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.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         unset

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

Workspace:
  Open Documents:               0

What happened?

Multiple engineers have reported code getting chaotically rewritten on save in rare cases.

I have reproduced a version of the problem with some simple files in a new clean repo with minimal configuration:

const a = 1; this is not valid javascript

Doesn't reformat (analysis comes back with no steps) but

let a = 1; this is not valid javascript

is reformatted to

const a = 1;
this;
is;
not;
valid;
javascript;

and the server log includes the below, which it didn't in the case that wasn't reformatted.

    ├─ DEBUG biome_lsp::handlers::analysis Suggested action: Apply all safe fixes (Biome)

Expected result

Ideally, source.fixAll.biome would bail out of reformatting if there are parse errors and formatWithErrors is false.

To be specific, attached is a naive patch that simply bails out with the check that the CLI uses. This is probably the wrong way to do things but I'm including it as an explanation of the behavior I expect.

fixall-err-on-parse-error.patch

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Activity

  1. added
    S-Needs triage
    on Dec 15, 2025
  2. changed the title [-]🐛 source.fixAll.biome sometimes reformats code with parse errors even when formatWithErrors=false[/-] [+]🐛 source.fixAll.biome sometimes reformats code with parse errors even when `formatWithErrors` is `false`[/+] on Dec 17, 2025
  3. changed the title [-]🐛 source.fixAll.biome sometimes reformats code with parse errors even when `formatWithErrors` is `false`[/-] [+]🐛 `source.fixAll.biome` reformats code with parse errors even when `formatWithErrors` is `false`[/+] on Dec 17, 2025
  4. changed the title [-]🐛 `source.fixAll.biome` reformats code with parse errors even when `formatWithErrors` is `false`[/-] [+]🐛 `formatWithErrors` is ignored by `source.fixAll.biome`[/+] on Dec 17, 2025
  5. added
    A-Core
    S-Bug-confirmed
    on Dec 19, 2025
  6. self-assigned this
    on Dec 19, 2025
  7. removed
    S-Needs triage
    on Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-CoreS-Bug-confirmed

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions