-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Is it possible to report unused exports in entry files in folders that are not being 'used' or 'imported' throughout the project? #142
Comments
Thanks for your detailed reporting. I'm working on #140 which is related, and I'm planning to have a fix in the coming days. |
I've re-introduced the Any chance you could try it out on your project(s)? You can install with e.g. |
@webpro thanks for the quick fix But I have tried on another project and I am getting
Is it expected? |
Thanks for trying so quickly. Yeah I was kinda afraid of such results, that's why I did a pre-release first. It is expected, but not desired. I think I need to make a difference between regular source code entry files versus entry files added by plugins. WIP :) |
I've released another I should add that for files referenced in scripts like this:
The unused exports won't be reported. Maybe these should be added to {
"entry": ["src/*/index.ts"],
"project": ["src/**/*.ts"]
} |
@webpro thank you, I have tried the latest version and it works as you mentioned, but in my opinion this behaviour is a bit confusing in
and in knip:
and with this setup But, I think, it's useful to keep thoose scripts in Is there any solution here? |
🚀 This issue has been resolved in v2.14.0. See Release 2.14.0 for release notes. |
Gave it a little more thought and I think it makes sense to include script files when using the By the way, I didn't mean to say you should include scripts in both |
@webpro thanks for your effort, everything works now 🎉 |
Hello, thanks for a wonderful library ❤️
I have a question regarding unused exports
I have a project (not a monorepo), which looks like this (simplified):
Reproduction
knip.json
package.json
if I run
npx knip
I get:Is it possible to make
knip
detect unused exports formodule1
andmodule3
?I have found this in docs: https://github.com/webpro/knip/blob/main/docs/handling-issues.md#unused-exports
But still not quite clear for me, if I can do anything to report those unused exports..
Also I have found that
--include-entry-exports
flag have been removed inv2
, maybe this is related to this problem?The text was updated successfully, but these errors were encountered: