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

🐛 Cannot ignore biome.jsonc #4770

Open
1 task done
hyperknot opened this issue Dec 21, 2024 · 5 comments
Open
1 task done

🐛 Cannot ignore biome.jsonc #4770

hyperknot opened this issue Dec 21, 2024 · 5 comments
Labels
A-Formatter Area: formatter S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@hyperknot
Copy link

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

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

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

Workspace:
  Open Documents:               0

What happened?

The following pattern ignores all JSON/JSONC files in the repo, but not biome.jsonc. It's impossible to ignore that file, no matter what I do.

  "files": {
    "ignore": ["*.json*"]
  },

Expected result

It should follow the config and ignore that file.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@hyperknot hyperknot added the S-Needs triage Status: this issue needs to be triaged label Dec 21, 2024
@ematipico
Copy link
Member

Can you please be more precise about the semantics of "ignore"? Biome needs to read it, and provide diagnostics if it's broken.

Failing to have a valid configuration is vital, and Biome should not function if the configuration isn't correct

@ematipico ematipico added the S-Needs response Status: await response from OP label Dec 21, 2024
@hyperknot
Copy link
Author

hyperknot commented Dec 21, 2024

I don't want to format it, I'm running biome check --write --unsafe at the root of my repo.

@ematipico ematipico added A-Formatter Area: formatter S-Bug-confirmed Status: report has been confirmed as a valid bug and removed S-Needs response Status: await response from OP S-Needs triage Status: this issue needs to be triaged labels Dec 21, 2024
@arendjr
Copy link
Contributor

arendjr commented Dec 21, 2024

For this use case, doesn’t it make more sense to move the ignore into the formatter section? Not sure if that works today though.

@hyperknot
Copy link
Author

I don't understand though why is the "files-being-formatted" related to the self-config of the app. I think the two has nothing to do with each other. The self-config shouldn't receive special treatment.

@dyc3
Copy link
Contributor

dyc3 commented Dec 21, 2024

Without getting too into the internals, "Ignoring" a file in biome means that we don't process the file, and therefore don't emit diagnostics for errors in that file, whether those are for parsing, formatting, or linting. However, we must process the config file in order to read the configuration. By default, "processing" includes formatting.

You should be able to add an override that disables the formatter.

"overrides": [
    {
        "include": ["biome.jsonc"],
        "formatter": {
            "enabled": false
        },
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

No branches or pull requests

4 participants