Closed
Description
Prerequisites
- I'm using the latest version
- I've read the relevant documentation
- I've searched for existing issues
- I've checked the list of known issues
- I've read the issue reproduction guide
Reproduction url
n/a
Reproduction access
- I've made sure the reproduction is publicly accessible
Description of the issue
The following is broken since knip v5.44.5
:
// package.json
{
"type": "module",
"scripts": {
"start": "node src/index.ts"
},
"devDependencies": {
"knip": "5.44.5"
}
}
// knip.config.js
export default {
entry: [
"src/index.ts!",
],
project: [
"src/**!",
],
};
// src/index.ts
import foo from './foo.js'
console.log(foo)
// src/foo.ts
export default true
running `npx knip --production` logs:
Unused files (1)
src/foo.ts
Additional notes:
interestingly, removing the start
script from package.json
appears to fix the issue.