Skip to content

Commit 59ecebe

Browse files
committed
chore: replace depcheck with knip
1 parent f292fde commit 59ecebe

5 files changed

Lines changed: 577 additions & 657 deletions

File tree

‎.depcheckrc.json‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎knip.config.mts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { KnipConfig } from 'knip';
2+
3+
const config: KnipConfig = {
4+
entry: [
5+
'src/**/*.{ts,mts}',
6+
'.github/scripts/**/*.{mts,mjs,js,ts}',
7+
'.github/actions/**/*.{mjs,js}',
8+
'*.config.{js,cjs,mjs,ts,mts}',
9+
],
10+
project: [
11+
'src/**/*.{ts,mts}',
12+
'.github/scripts/**/*.{mts,mjs,js,ts}',
13+
'.github/actions/**/*.{mjs,js}',
14+
'*.{js,cjs,mjs,ts,mts}',
15+
],
16+
ignoreDependencies: [
17+
// Used by Yarn through the `allow-scripts` plugin and the `lavamoat`
18+
// field in `package.json`, which knip does not trace.
19+
'@lavamoat/allow-scripts',
20+
'@lavamoat/preinstall-always-fail',
21+
22+
// Not imported directly, but used for the `ts-node --swc` scripts.
23+
'@swc/cli',
24+
25+
// Provided by the GitHub Actions runner, which is where
26+
// `.github/scripts/remove-rca-needed-label-sheets.ts` runs.
27+
'@actions/core',
28+
'@actions/github',
29+
],
30+
};
31+
32+
export default config;

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"lint": "yarn lint:tsc && yarn lint:oxlint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check",
1616
"lint:changelog": "auto-changelog validate --formatter oxfmt",
1717
"lint:constraints": "yarn constraints",
18-
"lint:dependencies": "depcheck && yarn dedupe",
18+
"lint:dependencies": "knip --config knip.config.mts --dependencies && yarn dedupe",
1919
"lint:fix": "yarn lint:oxlint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies",
2020
"lint:misc": "oxfmt --ignore-path .gitignore",
2121
"lint:oxlint": "oxlint",
@@ -63,8 +63,8 @@
6363
"@types/unzipper": "^0.10.11",
6464
"@vitest/coverage-v8": "^5.1.0",
6565
"@yarnpkg/types": "^4.0.1",
66-
"depcheck": "^1.4.7",
6766
"eslint-plugin-n": "^18.5.0",
67+
"knip": "^6.39.0",
6868
"oxfmt": "^0.72.0",
6969
"oxlint": "^1.93.0",
7070
"oxlint-tsgolint": "^7.0.2006",

‎tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"include": [
1919
"src",
20+
"knip.config.mts",
2021
"oxlint.config.mts",
2122
"vitest.config.mts",
2223
"yarn.config.cjs",

0 commit comments

Comments
 (0)