Skip to content

Commit b0b62d8

Browse files
Pixel998nzakas
andauthored
chore: add lint:unused script to run Knip (#206)
* chore: add lint:unused script to run Knip * set @types/node to ^20.19.0 * move test entry under mocha config --------- Co-authored-by: Nicholas C. Zakas <[email protected]>
1 parent c7b7b5b commit b0b62d8

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
run: npm install
2121
- name: Lint files
2222
run: npm run lint
23+
- name: Lint Files, Dependencies, & Exports
24+
run: npm run lint:unused
2325
- name: Check Formatting
2426
run: npm run fmt:check
2527
test:

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Publish to JSR
4141
run: |
4242
npm run build --if-present
43-
npx jsr publish
43+
npx -y jsr publish
4444
if: ${{ steps.release.outputs.release_created }}
4545

4646
# Generates the social media post

knip.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema.json",
3+
"ignore": ["src/types.ts"],
4+
"mocha": {
5+
"entry": ["tests/**/*.{cts,js,ts}"]
6+
}
7+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"lint": "eslint",
5151
"lint:fix": "eslint --fix",
5252
"lint:types": "attw --pack --profile esm-only",
53+
"lint:unused": "knip",
5354
"fmt": "prettier --write .",
5455
"fmt:check": "prettier --check .",
5556
"test": "mocha \"tests/**/*.test.js\"",
@@ -73,17 +74,19 @@
7374
},
7475
"devDependencies": {
7576
"@arethetypeswrong/cli": "^0.18.2",
77+
"@types/node": "^20.19.0",
7678
"c8": "^11.0.0",
7779
"dedent": "^1.5.3",
7880
"eslint": "^10.0.0",
7981
"eslint-config-eslint": "^14.0.0",
8082
"eslint-plugin-eslint-plugin": "^7.3.2",
8183
"globals": "^17.0.0",
84+
"knip": "^5.82.1",
8285
"lint-staged": "^16.0.0",
8386
"mdast-util-from-markdown": "^2.0.2",
8487
"mocha": "^11.3.0",
8588
"prettier": "3.8.1",
86-
"typescript": "^5.9.2",
89+
"typescript": "^5.9.3",
8790
"yorkie": "^2.0.0"
8891
},
8992
"engines": {

0 commit comments

Comments
 (0)