Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 CSS formatter indentWidth defaults to 0 (not 2 as intended) when using spaces #3067

Closed
1 task done
simon-paris opened this issue Jun 5, 2024 · 0 comments · Fixed by #3096 · 4 remaining pull requests
Closed
1 task done

📝 CSS formatter indentWidth defaults to 0 (not 2 as intended) when using spaces #3067

simon-paris opened this issue Jun 5, 2024 · 0 comments · Fixed by #3096 · 4 remaining pull requests
Assignees
Labels
A-Formatter Area: formatter L-CSS Language: CSS S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@simon-paris
Copy link

simon-paris commented Jun 5, 2024

Environment information

CLI:
  Version:                      1.8.0
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.22"

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

Formatter:
  Format with errors:           false
  Indent style:                 Space
  Indent width:                 0
  Line ending:                  Lf
  Line width:                   80
  Attribute position:           Auto
  Ignore:                       []
  Include:                      []

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

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:                 Space
  Indent width:                 0
  Line ending:                  Lf
  Line width:                   LineWidth(80)
  Quote style:                  Double

Workspace:
  Open Documents:               0

Configuration

{
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true,
    "defaultBranch": "master"
  },
  "files": {
    "include": [
      "./**/*.js",
      "./**/*.ts",
      "./**/*.jsx",
      "./**/*.tsx",
      "./**/*.css",
      "./**/*.json"
    ]
  },
  "linter": {
    "enabled": true,
    "ignore": [
      <snip>
    ],
    "rules": <snip>
  },
  "css": {
    "formatter": {
      "enabled": true,
      "indentStyle": "space"
    },
    "linter": {
      "enabled": true
    },
    "parser": {
      "cssModules": true
    }
  },
  "formatter": {
    "enabled": true,
    "ignore": [],
    "indentStyle": "space"
  },
  "organizeImports": {
    "enabled": false
  },
  "javascript": {
    "formatter": {
      "arrowParentheses": "asNeeded"
    }
  },
  "json": {
    "formatter": {
      "enabled": true
    }
  }
}

Playground link

Cannot reproduce on the playground because the "indentStyle": "space" option doesn't work in the playground.

Sample output:

./temp.css format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Formatter would have printed the following content:
  
     1  1 │   .class {
     2    │ - ··color:·red;
        2 │ + color:·red;
     3  3 │   }

Code of Conduct

  • I agree to follow Biome's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment