Skip to content

Commit edec08c

Browse files
committed
chore: add knip and address findings
# Conflicts: # .github/workflows/test.yml
1 parent 496c5d1 commit edec08c

File tree

8 files changed

+275
-93
lines changed

8 files changed

+275
-93
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,16 @@ jobs:
3939
uses: codecov/codecov-action@v4
4040
env:
4141
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
42+
knip-report:
43+
if: ${{ github.event_name == 'pull_request' }}
44+
needs: [build]
45+
runs-on: ubuntu-latest
46+
permissions:
47+
checks: write
48+
issues: write
49+
pull-requests: write
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: asdf-vm/actions/install@v3
53+
- run: pnpm i
54+
- uses: codex-/knip-reporter@v2

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
dist
2-
lib

eslint.config.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ export default tsEslint.config(
4848
},
4949
{
5050
ignores: [
51-
"**/coverage",
52-
"**/dist",
53-
"**/esbuild.config.mjs",
54-
"**/vitest.config.ts",
51+
"coverage",
52+
"dist",
53+
"esbuild.config.mjs",
54+
"knip.ts",
55+
"vitest.config.ts",
5556
],
5657
},
5758
{

knip.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { KnipConfig } from "knip";
2+
3+
const config: KnipConfig = {
4+
ignore: ["dist/**"],
5+
ignoreDependencies: [
6+
// Used in eslint.config.mjs
7+
"eslint-plugin-github",
8+
"eslint-plugin-import",
9+
// Required by eslint-plugin-import-x
10+
"@typescript-eslint/parser",
11+
"eslint-import-resolver-typescript",
12+
],
13+
};
14+
15+
export default config;

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
"build": "pnpm run build:types && pnpm run build:bundle",
1111
"build:bundle": "node ./esbuild.config.mjs",
1212
"build:types": "tsc",
13-
"format:check": "prettier --check **/*.ts",
13+
"format:check": "prettier --check **/*.*",
1414
"format": "pnpm run format:check --write",
1515
"lint": "eslint",
1616
"lint:fix": "pnpm run lint --fix",
17-
"release": "release-it",
1817
"test": "vitest",
19-
"test:coverage": "vitest --coverage"
18+
"test:coverage": "vitest --coverage",
19+
"knip": "knip"
2020
},
2121
"repository": {
2222
"type": "git",
@@ -39,7 +39,6 @@
3939
"@total-typescript/ts-reset": "^0.6.1",
4040
"@types/eslint__js": "^8.42.3",
4141
"@types/node": "^20.16.10",
42-
"@typescript-eslint/eslint-plugin": "^8.8.0",
4342
"@typescript-eslint/parser": "^8.8.0",
4443
"@vitest/coverage-v8": "^2.1.1",
4544
"chalk": "^5.3.0",
@@ -51,6 +50,7 @@
5150
"eslint-plugin-github": "^5.0.2",
5251
"eslint-plugin-import": "^2.31.0",
5352
"eslint-plugin-import-x": "^4.3.1",
53+
"knip": "^5.32.0",
5454
"prettier": "3.3.3",
5555
"typescript": "^5.6.2",
5656
"typescript-eslint": "^8.8.0",

0 commit comments

Comments
 (0)