822 B
822 B
Quickstart: Add Knip Unused Code Detection
Date: 2026-03-05
What This Feature Does
Adds Knip to the project to detect unused files, exports, dependencies, devDependencies, and types across the pnpm workspace. Enforces it as part of the pnpm check quality gate (which runs on every commit via Lefthook).
Files Changed
| File | Change |
|---|---|
package.json |
Add knip devDependency; add knip script; update check script |
knip.json (new) |
Workspace-aware Knip configuration |
How to Use
# Run unused-code check standalone
pnpm knip
# Run full quality gate (now includes Knip)
pnpm check
Verification
pnpm checkpasses on the current codebase (no false positives).- Add an unused export to any file →
pnpm knipreports it →pnpm checkfails.