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

🐛 Ignoring biome.json configuration #4038

Closed
1 task done
max-sym opened this issue Sep 22, 2024 · 5 comments
Closed
1 task done

🐛 Ignoring biome.json configuration #4038

max-sym opened this issue Sep 22, 2024 · 5 comments

Comments

@max-sym
Copy link

max-sym commented Sep 22, 2024

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"
  },
}
  1. 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

  • I agree to follow Biome's Code of Conduct
@ematipico
Copy link
Member

That's expected. Since you installed the extension first, the extension uses the bundled version with the defaults. Even after you add the configuration file, you would need to remove the bundled version.

Generally, it's advice to install the CLI first, and then open the editor and install the extension

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2024
@vdawg-git
Copy link

Why is the bundled version not looking for the config file though?

Also even if this is expected, it is not intuitive at all

@ematipico
Copy link
Member

ematipico commented Oct 3, 2024

Why is the bundled version not looking for the config file though?

Also even if this is expected, it is not intuitive at all

It should look for the configuration file. The issue here was different. OP created the configuration file after the extension started. The extension, when it starts, it spawns a server that looks for the configuration file, but if it doesn't find it, it uses its defaults.

If you create a configuration file after the server started, you'll need to restart the server. I believe that's a limitation of the client that can't watch files that are created after the service starts.

@vdawg-git
Copy link

Ah, yes I see. My bad, I should have read it more carefully.

Thank you for clarifying :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants