-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
🐛 knip does not follow tsconfig paths #977
Comments
I also ran with |
The debug tool I'm looking for is a dependency graph between files, e.g. dotfile output. I can see many knip outputs, but none that show me resolved file dependencies |
I've also tried |
The file is resolved fine. However, the issue is that while using The recommendation is to use dependencies from Briefly explained here: https://knip.dev/reference/faq#why-cant-i-use-path-aliases-to-reference-other-workspaces. Definitely could be documented better, and obviously, ideally shouldn't be an issue at all. Basically dup of #961. |
@webpro aha, thanks! We'll give that a try. I think we have other reasons that we're using |
Looked at the implementation again and came to the same conclusion, which I've now tried to document a bit better: https://knip.dev/guides/handling-issues#typescript-path-aliases-in-monorepos ↔ https://knip.dev/reference/faq#why-cant-i-use-path-aliases-to-reference-other-workspaces |
🚀 This issue has been resolved in v5.46.0. See Release 5.46.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
Prerequisites
Reproduction url
https://github.com/jameshfisher/knip-bug
Reproduction access
Description of the issue
Steps to reproduce:
git clone https://github.com/jameshfisher/knip-bug
, a minimal repropnpm i
pnpm run knip
Expected behavior: no unused files
Actual behavior:
The file
common/bar.ts
is claimed to be unused. However it's used bysrc/main.ts
, which is an entry point.The
import ... from "@qux/common/bar"
should resolve tocommon/bar.ts
because of the"@qux/common/*": ["common/*"]
intsconfig.json
. This can be seen withpnpm run start
, which resolves the import.The text was updated successfully, but these errors were encountered: