-
-
Notifications
You must be signed in to change notification settings - Fork 386
Closed
Labels
regressionSomething is no longer workingSomething is no longer working
Description
Prerequisites
- I've read the relevant documentation
- I've searched for existing issues
- I've read the issue reproduction guide
Reproduction url
https://github.com/astegmaier/playground-knip-6-tsconfig-bug
Reproduction access
- I've made sure the reproduction is publicly accessible
Good version
5.88.1
Bad version
6.0.3
Description of the regression
When tsconfig.json has "outDir": "lib/" (with a trailing slash):
{
"compilerOptions": {
"outDir": "lib/",
"srcDir": "src/"
}
}...and package.json has an export pointing to a lib/ path:
{
"exports": {
"./greet": "./lib/greet.js"
}
// ...
}Knip 6 is unable to map lib/greet.js back to src/greet.ts, causing it to report src/greet.ts as an unused file, even though it's correctly exported and used.
Knip 5 handles this case fine.
It's possible to work around this by removing the trailing slash (typscript seems to requard lib/ and lib as equivalent. I thought it would be worth reporting anyways to keep things as seamless as possible for others.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
regressionSomething is no longer workingSomething is no longer working