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
14.32k stars 445 forks source link

πŸ› Ignoring `biome.json` configuration #4038

Open max-sym opened 2 hours ago

max-sym commented 2 hours ago

Environment information

CLI:
  Version:                      1.8.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v22.8.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/9.10.0"

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

Workspace:
  Open Documents:               0

What happened?

  1. Have VS Code as your IDE
  2. Add biome extension
  3. Create a pnpm monorepo project
  4. Add biome.json at the root with the following contents:

{ "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", "organizeImports": { "enabled": true }, "files": { "ignore": ["generated/", "assets/", ".vercel/*", "dist"] }, "formatter": { "enabled": true, "formatWithErrors": false, "ignore": [], "attributePosition": "auto", "indentStyle": "space", "indentWidth": 2, "lineWidth": 80, "lineEnding": "lf" }, }


5. Notice that it ignores this config file when you save the files (for instance, it adds `;` at the end of all code lines even though it's instructed in the configuration to avoid doing that.

NOTE:
- It happens randomly - when I reload VS Code it usually doesn't go away, but when I restart the Mac it might work. It's 50/50. I haven't noticed any specific patter to make it work / not work.

A few ideas:
- Maybe it's due to using a pnpm workspaces architecture?
- Maybe it's due to having open multiple projects in VS Code?

### Expected result

It should format the files according to the config file every time it's in the correct VS Code project / workspace / folder.

### Code of Conduct

- [X] I agree to follow Biome's Code of Conduct
max-sym commented 2 hours ago

PS: Seems like it's working after I save the file twice. Related issues: