Skip to content

馃悰 Biome corrupts formatting with formatOnType enabled and attempting to close parens or brackets#912

Description

@mkahvi

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

  1. Ensure editor.formatOnType is enabled
  2. 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


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-Bug-confirmedStatus: Report has been confirmed as a valid bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions