Implement the 007-add-knip feature that adds Knip unused code detection to the quality gate and as a standalone command
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
29
specs/007-add-knip/quickstart.md
Normal file
29
specs/007-add-knip/quickstart.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# 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
|
||||
|
||||
```bash
|
||||
# Run unused-code check standalone
|
||||
pnpm knip
|
||||
|
||||
# Run full quality gate (now includes Knip)
|
||||
pnpm check
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
1. `pnpm check` passes on the current codebase (no false positives).
|
||||
2. Add an unused export to any file → `pnpm knip` reports it → `pnpm check` fails.
|
||||
Reference in New Issue
Block a user