biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.58k stars 485 forks source link

📝 Formatter produces different output on 2nd run #4383

Open xxzefgh opened 1 month ago

xxzefgh commented 1 month ago

Environment information

CLI:
  Version:                      1.9.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.18.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/9.12.1"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Formatter:
  Format with errors:           false
  Indent style:                 Tab
  Indent width:                 2
  Line ending:                  Lf
  Line width:                   120
  Attribute position:           Auto
  Bracket spacing:              BracketSpacing(true)
  Ignore:                       []
  Include:                      []

JavaScript Formatter:
  Enabled:                      true
  JSX quote style:              Double
  Quote properties:             AsNeeded
  Trailing commas:              All
  Semicolons:                   Always
  Arrow parentheses:            Always
  Bracket spacing:              unset
  Bracket same line:            false
  Quote style:                  Double
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Attribute position:           unset

JSON Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Trailing Commas:              unset

CSS Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Quote style:                  Double

GraphQL Formatter:
  Enabled:                      false
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Bracket spacing:              unset
  Quote style:                  unset

Workspace:
  Open Documents:               0

Configuration

{
    "$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
    "organizeImports": {
        "enabled": true
    },
    "files": {
        "ignore": ["types", ".vscode", "dist", "node_modules", "./package.json"]
    },
    "formatter": {
        "enabled": true,
        "lineWidth": 120,
        "indentStyle": "tab",
        "lineEnding": "lf"
    },
    "linter": {
        "enabled": true
    }
}

Playground link

https://biomejs.dev/playground/?lineWidth=120&code=aQBtAHAAbwByAHQAIAB7AGkAbgB0AGUAZwBlAHIALAAgAHAAZwBUAGEAYgBsAGUAfQAgAGYAcgBvAG0AIAAiAGQAcgBpAHoAegBsAGUALQBvAHIAbQAvAHAAZwAtAGMAbwByAGUAIgA7AAoACgBjAG8AbgBzAHQAIABlAHgAYQBtAHAAbABlACAAPQAgAHAAZwBUAGEAYgBsAGUAKAAiAGUAeABhAG0AcABsAGUAIgAsACAAewAKAAkAaQBkADoAIABpAG4AdABlAGcAZQByACgAKQAuAHAAcgBpAG0AYQByAHkASwBlAHkAKAApAC4AZwBlAG4AZQByAGEAdABlAGQAQgB5AEQAZQBmAGEAdQBsAHQAQQBzAEkAZABlAG4AdABpAHQAeQAoAHsAIABuAGEAbQBlADoAIAAiAGUAeABhAG0AcABsAGUAXwBpAGQAXwBzAGUAcQAiACwAIABzAHQAYQByAHQAVwBpAHQAaAA6ACAAMQAsACAAaQBuAGMAcgBlAG0AZQBuAHQAOgAgADEALAAgAG0AaQBuAFYAYQBsAHUAZQA6ACAAMQAsACAAbQBhAHgAVgBhAGwAdQBlADoAIAAyADEANAA3ADQAOAAzADYANAA3ACwAIABjAGEAYwBoAGUAOgAgADEAIAB9ACkACgB9ACkAOwAKAA%3D%3D

Code of Conduct

xxzefgh commented 1 month ago

Code is autogenerated by drizzle-kit introspect. This is the 2nd playground link. I've pasted output from first one in the editor:

https://biomejs.dev/playground/?lineWidth=120&code=aQBtAHAAbwByAHQAIAB7ACAAaQBuAHQAZQBnAGUAcgAsACAAcABnAFQAYQBiAGwAZQAgAH0AIABmAHIAbwBtACAAIgBkAHIAaQB6AHoAbABlAC0AbwByAG0ALwBwAGcALQBjAG8AcgBlACIAOwAKAAoAYwBvAG4AcwB0ACAAZQB4AGEAbQBwAGwAZQAgAD0AIABwAGcAVABhAGIAbABlACgAIgBlAHgAYQBtAHAAbABlACIALAAgAHsACgAJAGkAZAA6ACAAaQBuAHQAZQBnAGUAcgAoACkACgAJAAkALgBwAHIAaQBtAGEAcgB5AEsAZQB5ACgAKQAKAAkACQAuAGcAZQBuAGUAcgBhAHQAZQBkAEIAeQBEAGUAZgBhAHUAbAB0AEEAcwBJAGQAZQBuAHQAaQB0AHkAKAB7AAoACQAJAAkAbgBhAG0AZQA6ACAAIgBlAHgAYQBtAHAAbABlAF8AaQBkAF8AcwBlAHEAIgAsAAoACQAJAAkAcwB0AGEAcgB0AFcAaQB0AGgAOgAgADEALAAKAAkACQAJAGkAbgBjAHIAZQBtAGUAbgB0ADoAIAAxACwACgAJAAkACQBtAGkAbgBWAGEAbAB1AGUAOgAgADEALAAKAAkACQAJAG0AYQB4AFYAYQBsAHUAZQA6ACAAMgAxADQANwA0ADgAMwA2ADQANwAsAAoACQAJAAkAYwBhAGMAaABlADoAIAAxACwACgAJAAkAfQApACwACgB9ACkAOwAKAA%3D%3D

ematipico commented 2 weeks ago

Interestingly, Prettier has the same issue.