Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 300
chore: replace depcheck with knip#9047
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
31636faedd239fdc90a6b3a4e04bd7d5ec5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import type { KnipConfig } from 'knip'; | ||
| const config: KnipConfig = { | ||
| workspaces: { | ||
| '.': { | ||
| entry: [ | ||
| 'scripts/**/*.{ts,js,sh}', | ||
| 'tests/**/*.ts', | ||
| '*.config.{js,cjs,mjs,ts}', | ||
| 'jest.config.*.js', | ||
| 'yarn.config.cjs', | ||
| 'eslint.config.mjs', | ||
| '.prettierrc.js', | ||
| 'release.config.js', | ||
| 'knip.config.ts', | ||
| ], | ||
| project: ['scripts/**/*.ts', 'tests/**/*.ts', '*.{js,cjs,mjs,ts}'], | ||
| ignore: ['scripts/create-package/package-template/**'], | ||
| // The `preset: 'ts-jest'` shorthand expands to `ts-jest/jest-preset`, | ||
| // which knip can't resolve to an actual file even though `ts-jest` is | ||
| // listed in `devDependencies`. | ||
| ignoreUnresolved: ['ts-jest/jest-preset'], | ||
| }, | ||
| }, | ||
| ignoreDependencies: [ | ||
| // Dependencies used by Yarn binaries in `.yarn` | ||
| /^@yarnpkg\//u, | ||
| 'clipanion', | ||
| 'typanion', | ||
| // Dependencies imported implicitly by TypeScript | ||
| /^@types\//u, | ||
| // Tools (packages which we use as executables and not libraries) | ||
| '@lavamoat/allow-scripts', | ||
| '@metamask/auto-changelog', | ||
| '@metamask/create-release-branch', | ||
| 'eslint-interactive', | ||
| 'rimraf', | ||
| 'simple-git-hooks', | ||
| 'ts-node', | ||
| 'typedoc', | ||
| // Plugins for tools | ||
| /^@typescript-eslint\//u, | ||
| /^eslint-config-/u, | ||
| /^eslint-plugin-/u, | ||
| 'jest-silent-reporter', | ||
| 'prettier-plugin-packagejson', | ||
| 'typescript-eslint', | ||
| // Jest environments referenced in `jest.config.scripts.js` | ||
| 'jest-environment-node', | ||
| 'jest-environment-jsdom', | ||
| // Dependencies imported implicitly by tools | ||
| 'eslint-import-resolver-typescript', | ||
| // Dependencies which plug into the NPM lifecycle | ||
| '@lavamoat/preinstall-always-fail', | ||
| ], | ||
| }; | ||
| export default config; | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds like it only works on a limited set of paths, instead of the entire repository?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, intentional for now:
--workspace .in the lint script scopes this to the root workspace. depcheck wasn't actually checkingpackages/*either (it only validated root deps), so coverage's the same as before. Happy to expand knip to lint all workspaces in a follow-up PR.Check the deleted
.depcheckrc.ymlThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's intentional 🤔 We should definitely be checking all packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's a mistake, but it's a pre-existing one. Solving it in a later PR sounds good to me, but we really should fix it.
I had discovered this independently a few of weeks ago but forgot to mention it