-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
"ignore" file working even though it shouldn't based on the docs #650
Comments
Both are fine, the latter is recommended. The docs don't contradict anything here? |
When using
If I just ran
I would expect it to report e.g. an unused export inside of
In the list of unused files, I would expect |
Okay I think I get it now, it also states:
I interpreted the part "only their issues are not reported" as issues inside the file, but I guess it means the whole file being unused is also an issue of the file, and therefore filtered out (but only after the analysis ran on the file). |
Indeed! Any issue with files that match the ignore pattern is not reported. |
When I run
knip --include files
to list unused files in my project, there are a couple of files shown, one of which issrc/mockServiceWorker.js
.So I created
knip.config.ts
with the following configuration:If I run
knip --include files
with this config, it no longer reportssrc/mockServiceWorker.js
.However, in the docs there is a statement:
This is not a good idea, since
ignore
patterns have only one goal: to exclude issues in matching files from the report. Files matchingignore
patterns are not excluded from the analysis, only their issues are not reported.Why does it work then?
Also what would be the correct way to exclude it?
I tried this:
And it works. Is this the correct way?
The text was updated successfully, but these errors were encountered: