-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Unused functions are not being detected #643
Comments
By default, Knip does not report unused exports in entry files. |
@webpro thank you for responding, but that is not the case. This is not about the entry point file. The pattern occurs within other files that are not the entry point file. |
The You can also use |
I gave a very simple example. Add any other file as an entrypoint besides this other file as an example that I mentioned above. You should have as behavior, that the unused function will not be detected. My case is that I have a very large project, in which Knip is not able to detect many unused functions, and ts-prune can. |
Sorry, but without a reproduction there's nothing for me to look into. I hope you understand I can't copy-paste everyone's "how to reproduce" dumps. There's reasons Knip works the way it does by default. There's various ways Knip can be configured to make it behave as you need. Maybe you're looking for flags like these: |
Unused functions are not being detected.
How to reproduce:
import zoo function in other file
Test if Knip detect this unused function
Testing with another package that Knip indicates is similar: ts-prune:
Note that ts-prune detects the unused function, but Knip don't. Why doesn't Knip detect this?
The text was updated successfully, but these errors were encountered: