-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
require imports no longer work #681
Comments
Any chance you could create a reproduction of the issue or add a failing case to one of the test fixtures? And what's the first version of Knip this fails in for you? |
It stopped working after 5.16.0. Here's a minimal reproduction:
I couldn't reproduce it with |
It is. Isn't it odd to |
Hmm I don't think it's unusual. Using tsc and running the output with node was the default basic Node + TypeScript setup (on the backend) until pretty recently. I suppose using |
I really need an actual reproduction of the issue. The basics work, I just added 0c56610, perhaps its specific TS config settings? |
Does my previous reproduction not work? That was without any tsconfig in the directory at all – just those three files and the default |
Copy-pasting something here is not a reproduction. No |
I was trying to make it as minimal as possible .. wouldn't Here's my initial reproduction with a bare I'm not sure I understand why you wouldn't expect that to work? It's a valid program that can be run via |
Thanks for the reproduction. The underlying issue is that So my recommendation would be to split up {
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["src/entry.ts"],
"project": ["src/*.ts"],
} Not sure if this also is the "fix" for OP, but based on this repro I think the refactoring I did more reveals an issue in cases like this than that it introduces a regression. That split is also better for performance, as Knip does/should not wander off into compiled build artifacts. |
Since OP didn't provide a reproduction and I believe the repro that was provided is handled properly I'm going to close this issue. |
Feel free to try |
confirmed version 5.27.2 of knip works |
code
if (__DEV__) require('../Reactotron/Reactotron');
working in
"knip": "5.13.0",
✂️ Excellent, Knip found no issues.
failing in
"knip": "5.19.0",
The text was updated successfully, but these errors were encountered: