-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
🐛 Some ignore pattern generate ignored file
error
#1471
Comments
As requested, I'm encountering the same issue with the following configuration : // biome.json
{
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
"files": {
"ignoreUnknown": true,
"ignore": [".next", "node_modules/**", "**/*.json", "**/dist", "**/out", "public/**/*.js"]
},
"organizeImports": {
"enabled": true
},
"javascript": {
"formatter": {
"semicolons": "always",
"quoteStyle": "double",
"trailingComma": "all"
}
},
"formatter": {
"enabled": true,
"indentWidth": 2,
"indentStyle": "space",
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noParameterAssign": "off",
"noNonNullAssertion": "warn"
},
"correctness": {
"noUnusedVariables": "error"
}
}
}
} My project is basically a monorepo with Here is the logs :
|
With version 1.4.1 I had "files": {
"ignore": ["localization.ts"]
} After updating to version 1.5.0, it did not ignore the file anymore, reporting lint errors in that file. After I changed the ignore pattern to
The exit code is still |
This is very confusing for junior devs. In a rare case when setting up a linter can decrease productivity instead of increasing it. Seriously, what is the logic behind these huge warnings? These are not accidental ignores, the paths are explicitly ignored in the config. Imagine if Git was printing after every pull/push/merge/commit/etc this:
Also, the lint now fails on one of our projects. Simply because the amount of "xy is ignored" and "xy is protected. Won't format..." kind of output (and no errors) exceed the max diagnostic amount. |
The reason why you see more diagnostics than before is because we had reports where users didn't understand why certain files weren't checked. Even though we document that on our website, the reports were still coming. Given the previous statement, and given that now you see too many diagnostics, what do you think we should do? What do you suggest? |
Hmm, I there is a valid use case for these warning. For example, when you try to format a specific file
Then biome won't process that file if it is ignored. Since I specifically asked for that file to be processed, it makes sense that biome tells me why it could not process that file. On the other hand, my usual use case is that I want to run biome on all my files, i.e. on all files in a certain folder. That folder may contain some files that should be ignored, which I specified via the So my question would be, what's the intended configuration / command-line prompt for the latter use case -- formatting all files in a folder, ignoring some files? |
If the However, there is an use case where the current behavior is problematic. When used with lefthook, it's simpler to not copy the entire ignore list from
For this use case I would recommend adding |
So how do we ignore those warnings? |
They are harmless. Use |
I'm unable to silence these warnings. The # *.pb.ts is ignored
biome format --diagnostic-level=error .
./google/type/money.pb.ts format ━━━━━━━━━━━━
✖ The file ./google/type/money.pb.ts was ignored.
I expect linters to output nothing or a short success message if there are no errors. If I wanted to figure out why biome was ignoring files, I'd first look to increase the log level to DEBUG. I think emitting warnings is a short-term solution. Most folks will turn them off because it's too noisy. Once the warnings are disabled, we're at the same starting point. In the long term, users still won't understand why biome is ignoring files since they'll have the warnings disabled. Since the problem is that users don't understand why biome ignores files (and then open support tickets), maybe this can be solved in the ticket template by requiring debug logs? |
This should be fixed in the last patch release (v1.5.1). Could anyone confirm that they no longer get errors? |
Tested on 1 project, it's fixed for our use case. |
I can confirm the latest patch resolves the issue for us, thanks! ❤️ |
|
@Sec-ant Oh thanks you so much |
@Sec-ant Any way, I don't want to ignore the file in |
That's a feature we don't have yet |
Here is my problem
If I run the command |
You can use Next time you can consult the CLI reference page: https://biomejs.dev/reference/cli/#biome-lint |
Environment information
What happened?
Execute the following script and observe the error:
The configuration is:
If I change
formatter.ignore
from./tests-corpus/*
to./tests-corpus
the bug seems fixed.Expected result
No error should be thrown.
Code of Conduct
The text was updated successfully, but these errors were encountered: