-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Collector issue for known issues w/ jiti #565
Comments
Jiti v2 has been released! https://github.com/unjs/jiti/releases/tag/v2.0.0 |
Yay! The jiti-v2 branch has been revived and it would be great if you could give it shot in your project(s). Install like so with your favorite package manager:
Hopefully we can remove some of the known issues! Planning to include this in a next patch or minor update. Let me know if you think upgrading to jiti v2 should be a major bump for Knip. cc @stephenwade @vojtechsimetka @thenbe @EvgenyOrekhov @JoshuaKGoldberg @crystalfp @splincode |
Also cc @deadcoder0904 @me4502 @andriyor @Codex- |
Awesome, |
Tried it with knip reporter and it seems 👌 |
It works great on my project as well. I no longer need to use
No reason for it to be a major bump if nothing breaks in the integration workflow. |
Hmm I'm testing it out on a large monorepo, and removing the |
@me4502 Thanks for trying that out. I wrongfully assumed that the default export of
|
Thanks, that fixed the issue :) I did encounter some oddities around some custom webpack plugins we have, where they were compiled to JS but called out to libs that were TS- but that's probably a setup that only works for builds in the first place because ts-node doesn't care, rather than something that should work. I managed to work around it by having them compile their dependencies, but just thought I'd mention it. Otherwise this works super well, and allowed us to remove a bunch of ignored dependencies in our knip config. Thanks :) |
🚀 This issue has been resolved in v5.31.0. See Release 5.31.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
Thanks everyone for helping out here! |
There's a number of issues around using jiti. First and foremost: Jiti is awesome, Knip wouldn't nearly be as good without it!
This is a collector issue for housekeeping, and I expect those to be resolved at once. issues are documented at https://knip.dev/reference/known-issues
I think most or all of them can be potentially worked around by using bun:
This uses the Bun runtime. Bun does not transpile, just strips types, has flexible module resolution, and also uses TS path aliases (
tsconfig.json#compilerOptions.paths
) in dynamically loaded scripts/modules.jiti v2 might fix the issues for the Node.js runtime.
The text was updated successfully, but these errors were encountered: