💡 Those exported modules that are being used within the current file should not be tagged as unused exports.
vincent890120 opened this issue · 3 comments
Suggest an idea for Knip
In a file, there are two methods being exported, which are export A and export B. Here, A is imported by app.tsx, and B is being referenced by A. In such a scenario, B would also be identified as an unused export. Can we possibly optimize for such situations? In other words, if the exported module is being referenced within the current file, then it should not be tagged as an unused export.
For example
test.tsx
App.tsx
B is recognized as an unused module.
While I think Knip is behaving as expected and tries to optimize what's flagged or not, it does provide this option: https://knip.dev/reference/configuration#ignoreexportsusedinfile. Would that work for you?
I really appreciate it, this is quite helpful for me.
Excellent, let's close this ticket then.