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.47k stars 481 forks source link

📝 useSortedClasses removes spaces between computed variables #3790

Closed theogravity closed 1 week ago

theogravity commented 2 months ago

Environment information

flex flex-shrink-0 flex-row items-center font-medium ${props.className} ${buttonColor} ${buttonSize}

becomes

flex flex-shrink-0 flex-row items-center font-medium ${props.className}${buttonColor}${buttonSize}

(there's no space between the computed items)

Note: I don't know how to enable useSortedClasses in the playground, so the playground link has the code, but the formatted ver is fine because it's not enabled.

Configuration

{
  "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
  "organizeImports": {
    "enabled": true
  },
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "lineWidth": 120,
    "ignore": [
      "node_modules/*",
      "*.config.*",
      "*.json",
      "tsconfig.json",
      ".turbo/*",
      ".next/*",
      "dist/*",
      ".pnpm-store/*"
    ]
  },
  "linter": {
    "enabled": true,
    "ignore": ["dist/*", ".pnpm-store/*", "packages/portal-client/*", ".next/*", ".turbo/*"],
    "rules": {
      "a11y": {
        "noSvgWithoutTitle": "off"
      },
      "performance": {
        "noDelete": "off"
      },
      "complexity": {
        "useLiteralKeys": "off",
        "noStaticOnlyClass": "off"
      },
      "correctness": {
        "noUnusedImports": "error",
        "useExhaustiveDependencies": "warn"
      },
      "suspicious": {
        "noImplicitAnyLet": "off",
        "noExplicitAny": "off",
        "noDebugger": {
          "level": "warn",
          "fix": "none"
        }
      },
      "nursery": {
        "useSortedClasses": "warn"
      },
      "recommended": true
    }
  }
}

Playground link

https://biomejs.dev/playground/?code=aQBtAHAAbwByAHQAIAB0AHkAcABlACAAUgBlAGEAYwB0ACAAZgByAG8AbQAgACIAcgBlAGEAYwB0ACIAOwAKAGkAbQBwAG8AcgB0ACAAewAgAHUAcwBlAE0AZQBtAG8AIAB9ACAAZgByAG8AbQAgACIAcgBlAGEAYwB0ACIAOwAKAGkAbQBwAG8AcgB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4AC0AZwByAG8AdwAgAHQAZQB4AHQALQBjAGUAbgB0AGUAcgAgAGYAbwBuAHQALQBuAG8AcgBtAGEAbABgAH0APgB7AHQAZQB4AHQAfQA8AC8AcwBwAGEAbgA%2BAAoAIAAgACAAIAAgACAAewBSAGkAZwBoAHQASQBjAG8AbgAgACYAJgAgADwAcwBwAGEAbgAgAGMAbABhAHMAcwBOAGEAbQBlAD0AIgBtAGwALQAyACAAZgBsAGUAeAAgAGkAdABlAG0AcwAtAGMAZQBuAHQAZQByACIAPgB7AFIAaQBnAGgAdABJAGMAbwBuAH0APAAvAHMAcABhAG4APgB9AAoAIAAgACAAIAA8AC8AYgB1AHQAdABvAG4APgAKACAAIAApADsACgB9ADsACgAKAGUAeABwAG8AcgB0ACAAZABlAGYAYQB1AGwAdAAgAEIAdQB0AHQAbwBuADsACgA%3D

Code of Conduct

ematipico commented 2 months ago

@theogravity can you please update the playground link:

hangaoke1 commented 1 week ago

repeat https://github.com/biomejs/biome/issues/4041

ematipico commented 1 week ago

I am going to close the issue for now. It seems it was fixed