-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
Ignored files are not ignored when using --staged or explicitly specified in CLI #3659
Comments
I'm not too sure about evaluating ignores when files are explicitly provided via cli args. As a user, I would expect all files provided via cli args to be processed, regardless of ignores because I explicitly pointed biome to the file. Doing this for |
Thank you for your prompt attention to this issue. I appreciate your perspective on how CLI arguments might be interpreted. While I understand the logic behind processing explicitly provided files, this approach can lead to unexpected behavior, especially when integrating Biome with other tools or scripts. Consistent handling of ignored files across all scenarios would provide several benefits: Consistency: It's easier to reason about and maintain a system where ignore rules are always respected. I agree that addressing this for Very interested to also have others opinion, @ematipico what do you think of it? |
Update: I've identified the root cause while reproducing the issue in a monorepo setup like ours.
The main problem: Reproduction: To reproduce:
Expected behavior: This issue mainly impacts monorepo setups and needs addressing for better usability in complex project structures. |
That's the expected way, we document this: https://biomejs.dev/guides/configure-biome/#ignore-files
For monorepos, we have an issue about that already: #2228 |
Environment information
What happened?
Files specified in the Biome configuration's "ignore" list are still being linted when:
--staged
flagThis behavior occurs even when VCS is enabled in the Biome configuration. The ignored files are not present in the
.gitignore
file.Steps to reproduce:
biome check --staged
biome check file.ts
Expected result
Files specified in the "ignore" list should be ignored in all scenarios, including:
The current behavior makes it difficult to use Biome with external tools like lefthook, Husky or in custom scripts. Ignoring specific file is a critical feature when using GraphQL or other tool that will create auto-generated files.
Possible solution:
--include-ignored
flag for cases where users explicitly want to lint ignored files.Code of Conduct
EDIT: See comment below: #3659 (comment)
The text was updated successfully, but these errors were encountered: