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

🐛 How to ignore biome.json files in non-root directories #4957

Open
1 task done
ahaoboy opened this issue Jan 24, 2025 · 5 comments
Open
1 task done

🐛 How to ignore biome.json files in non-root directories #4957

ahaoboy opened this issue Jan 24, 2025 · 5 comments
Labels
S-Needs repro Status: needs a reproduction

Comments

@ahaoboy
Copy link

ahaoboy commented Jan 24, 2025

Environment information

biome rage
CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

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

Workspace:
  Open Documents:               0

What happened?

├── biome.json
├── dist-manifest
│   └── biome.json

This is not a configuration file, but it will report errors when formatting and linting.
dist-manifest/biome.json

{
  "artifacts": {
    "https://github.com/biomejs/biome/releases/latest/download/biome-linux-x64": {
      "name": "biome",
      "target_triples": ["x86_64-unknown-linux-gnu"],
      "assets": []
    }
}
  × Found an unknown key `artifacts`.

    1 │ {
  > 2 │   "artifacts": {
      │   ^^^^^^^^^^^

Expected result

Only detect biome.json in the root directory

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ahaoboy ahaoboy added the S-Needs triage Status: this issue needs to be triaged label Jan 24, 2025
@ahaoboy
Copy link
Author

ahaoboy commented Jan 24, 2025

Add file to ignore doesn't work

  "files": {
    "ignore": [
      "./dist-manifest/biome.json",

@dyc3 dyc3 added the S-Needs repro Status: needs a reproduction label Jan 24, 2025
Copy link
Contributor

Hello @ahaoboy, please provide a minimal reproduction. You can use one of the following options:

  • Provide a link to our playground, if it's applicable.
  • Provide a link to GitHub repository. To easily create a reproduction, you can use our interactive CLI via npm create @biomejs/biome-reproduction

Issues marked with S-Needs repro will be closed if they have no activity within 3 days.

@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Jan 24, 2025
@ahaoboy
Copy link
Author

ahaoboy commented Jan 24, 2025

@ematipico
Copy link
Member

It's not actually possible not at the moment. Those are well known files to Biome, they are treated differently to provide errors in case they are incorrect. Have you tried to ignore the folder? The other alternative is to rename the file.

In this particular case, it would be possible to ignore it because it's not in the root, I don't know if it will be possible in a monorepo case.

@ahaoboy
Copy link
Author

ahaoboy commented Jan 24, 2025

It's not actually possible not at the moment. Those are well known files to Biome, they are treated differently to provide errors in case they are incorrect. Have you tried to ignore the folder? The other alternative is to rename the file.

In this particular case, it would be possible to ignore it because it's not in the root, I don't know if it will be possible in a monorepo case.

Does this mean, we can't use biome.json in our project?

I tried adding biome.json to ignore, but the problem persists

"files": {
   "ignore": ["src/biome.json"]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs repro Status: needs a reproduction
Projects
None yet
Development

No branches or pull requests

3 participants