-
-
Notifications
You must be signed in to change notification settings - Fork 70
🐛 Biome corrupts formatting with formatOnType enabled and attempting to close parens or brackets #912
Copy link
Copy link
Open
Labels
Bug confirmedReport has been confirmed as a valid bugReport has been confirmed as a valid bug
Description
VS Code version
1.108.0
Extension version
3.3.0
Biome version
2.3.10
Operating system
- Windows
- macOS
- Linux
Description
Biome mildly corrupts formatting with formatOnType enabled when closing parens or brackets by adding extra padding before the opening paren/bracket and sometimes removes newlines.
For example
console.log(Becomes
console.log ()or
{
{ // <- closing this
}Becomes
{ {
}
}(), [] and {} all suffer from this. Happens in JS and JSON.
In some circumstances this doesn't happen, for example the above console.log() example doesn't happen if you type it inside unclosed curly brackets.
As a side note there doesn't seem to be a way to disable format-on-type specifically for Biome and I'd rather not disable that for everything that isn't formatted by biome also.
Steps to reproduce
- Ensure
editor.formatOnTypeis enabled - Close any paren or bracket in code
Expected behavior
Bracket is closed, not much else.
Does this issue occur when using the CLI directly?
Not sure / Not applicable
Link to a minimal reproduction
No response
Logs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug confirmedReport has been confirmed as a valid bugReport has been confirmed as a valid bug