Skip to content

Commit 92594f4

Browse files
authored
chore: add lint:unused script to run Knip (#724)
* chore: add lint:unused script to run Knip * apply suggestion * drop knip ignoreBinaries for `report` * move test entry under mocha config
1 parent a52a694 commit 92594f4

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
run: npm run build
2323
- name: Lint files
2424
run: npm run lint
25+
- name: Lint Files, Dependencies, & Exports
26+
run: npm run lint:unused
2527

2628
format:
2729
name: File Format

knip.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema.json",
3+
"mocha": {
4+
"entry": ["tests/**/*.{cjs,cts,js,ts}"]
5+
},
6+
"workspaces": {
7+
"packages/eslint-visitor-keys": {
8+
"entry": ["test-d/**/*.test-d.ts"]
9+
},
10+
"packages/espree": {
11+
"entry": ["espree.cts", "test-d/**/*.test-d.ts", "tools/**/*.js"],
12+
"ignore": ["tests/fixtures/**"]
13+
}
14+
}
15+
}

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"test": "npm test --workspaces --if-present",
76
"build": "npm run build --workspaces --if-present",
87
"build:types": "npm run build:types --workspaces --if-present",
98
"lint": "eslint",
109
"lint:fix": "eslint --fix",
1110
"lint:types": "npm run lint:types --workspaces --if-present",
11+
"lint:unused": "knip",
1212
"fmt": "prettier --write .",
13-
"fmt:check": "prettier --check ."
13+
"fmt:check": "prettier --check .",
14+
"test": "npm test --workspaces --if-present"
1415
},
1516
"workspaces": [
1617
"packages/*"
@@ -27,18 +28,20 @@
2728
},
2829
"devDependencies": {
2930
"@arethetypeswrong/cli": "^0.18.2",
31+
"@types/node": "^20.19.0",
3032
"@typescript-eslint/parser": "^8.49.0",
3133
"c8": "^10.1.3",
3234
"eslint": "^9.35.0",
3335
"eslint-config-eslint": "^13.0.0",
3436
"eslint-plugin-chai-friendly": "^1.0.0",
3537
"eslint-plugin-expect-type": "^0.6.2",
3638
"globals": "^17.0.0",
39+
"knip": "^5.82.1",
3740
"lint-staged": "^16.0.0",
3841
"mocha": "^11.1.0",
42+
"prettier": "3.8.1",
3943
"rollup": "^4.55.2",
4044
"typescript": "^5.9.3",
41-
"prettier": "3.8.1",
4245
"yorkie": "^2.0.0"
4346
}
4447
}

packages/espree/lib/features.js

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

0 commit comments

Comments
 (0)