Repository navigation
Labels
Description
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
[-]🐛 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`[/+][-]🐛 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`[/+][-]🐛 `source.fixAll.biome` reformats code with parse errors even when `formatWithErrors` is `false`[/-][+]🐛 `formatWithErrors` is ignored by `source.fixAll.biome`[/+]Update dependency @biomejs/biome to v2.5.14 (#24)
Update dependency @biomejs/biome to v2.5.14 (#45)