chore: add knip and remove the dead code it reports (#247)

Adds knip (pnpm knip, knip.ts covering src, scripts, perf and e2e) and runs it in the CI frontend job. Removes what it reported: the unused codemirror and @types/dompurify dependencies, exports and test hooks used nowhere (AppLogo, Tooltip, barrel re-exports, duplicate default exports of lazily loaded settings pages), the unused iterateAll helper, and the zh entry for a deleted notification. rustfmt (used by lint-staged) is ignored as a toolchain binary.

Co-authored-by: jaw52 <[email protected]>
This commit is contained in:
Jaw authored and GitHub committed 2026-10-29 23:21:56 +08:00
1 parent c3b3534f08
commit 5217f8570b
54 files changed
+588 -351

No files matched your search

+2 -2
View File
@@ -15,6 +15,7 @@
"lint": "oxlint",
"format": "oxfmt",
"format:check": "oxfmt --check",
"knip": "knip",
"typecheck": "tsrs --noEmit && tsrs -p tsconfig.node.json --noEmit && tsrs -p perf --noEmit && tsrs -p scripts --noEmit",
"gen:bindings": "cargo test -p openidea --test export_bindings",
"gen:theme-docs": "node scripts/theme/gen-docs.ts",
@@ -57,7 +58,6 @@
"@xterm/xterm": "^6.0.0",
"anser": "^2.3.5",
"clsx": "^2.1.1",
"codemirror": "^6.0.2",
"dompurify": "^3.4.17",
"emmet": "2.4.11",
"immer": "^11.1.21",
@@ -74,12 +74,12 @@
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.8",
"@types/dompurify": "^3.2.0",
"@types/node": "^26.6.5",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react": "^6.0.2",
"jsdom": "^30.1.3",
"knip": "^6.43.0",
"lint-staged": "^17.6.0",
"oxfmt": "^0.74.0",
"oxlint": "^1.89.0",