Skip to content

Commit

Permalink
chore: add knip and address findings
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/test.yml
  • Loading branch information
Codex- committed Oct 6, 2024
1 parent 496c5d1 commit edec08c
Show file tree
Hide file tree
Showing 8 changed files with 275 additions and 93 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,16 @@ jobs:
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
knip-report:
if: ${{ github.event_name == 'pull_request' }}
needs: [build]
runs-on: ubuntu-latest
permissions:
checks: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v3
- run: pnpm i
- uses: codex-/knip-reporter@v2
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dist
lib
9 changes: 5 additions & 4 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ export default tsEslint.config(
},
{
ignores: [
"**/coverage",
"**/dist",
"**/esbuild.config.mjs",
"**/vitest.config.ts",
"coverage",
"dist",
"esbuild.config.mjs",
"knip.ts",
"vitest.config.ts",
],
},
{
Expand Down
15 changes: 15 additions & 0 deletions knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
ignore: ["dist/**"],
ignoreDependencies: [
// Used in eslint.config.mjs
"eslint-plugin-github",
"eslint-plugin-import",
// Required by eslint-plugin-import-x
"@typescript-eslint/parser",
"eslint-import-resolver-typescript",
],
};

export default config;
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"build": "pnpm run build:types && pnpm run build:bundle",
"build:bundle": "node ./esbuild.config.mjs",
"build:types": "tsc",
"format:check": "prettier --check **/*.ts",
"format:check": "prettier --check **/*.*",
"format": "pnpm run format:check --write",
"lint": "eslint",
"lint:fix": "pnpm run lint --fix",
"release": "release-it",
"test": "vitest",
"test:coverage": "vitest --coverage"
"test:coverage": "vitest --coverage",
"knip": "knip"
},
"repository": {
"type": "git",
Expand All @@ -39,7 +39,6 @@
"@total-typescript/ts-reset": "^0.6.1",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.16.10",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"@vitest/coverage-v8": "^2.1.1",
"chalk": "^5.3.0",
Expand All @@ -51,6 +50,7 @@
"eslint-plugin-github": "^5.0.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import-x": "^4.3.1",
"knip": "^5.32.0",
"prettier": "3.3.3",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.0",
Expand Down
Loading

0 comments on commit edec08c

Please sign in to comment.