-
-
Notifications
You must be signed in to change notification settings - Fork 318
Description
Discuss anything related to Knip
Hi there! 👋
I'm having a little trouble understanding how to configure Knip for a particular workspace in my monorepo. I can repro the behaviour with the following files:
package.json:
{
"exports": {
"./*": "./*.ts"
},
"scripts": {
"knip": "knip --strict",
"vitest": "vitest run"
},
"devDependencies": {
"knip": "^5.66.1",
"vitest": "^3.2.4"
}
}example.test.ts:
import { } from "vitest";Output:
$ npm run knip
Unlisted dependencies (1)
vitest example.test.ts:1:8I can see that the issue is my asterisk subpath export definition, however that's something that the workspace in question needs to live with for the time being, as well as the interleaved source and test files. I appreciate that more granular subpath exports, or subpath imports, would be the best way to solve this problem long-term.
Alas I'm trying to figure out how to configure Knip to accept it in strict mode given the rest of my repo is green. I'm not having luck with any combination of entry and project.
Help appreciated, assuming this is possible! Thanks for Knip in any case 🏅