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:
Lukas
2026-03-05 12:24:27 +01:00
parent 0bbd6f27f9
commit c4a90c9982
11 changed files with 965 additions and 16 deletions

View 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.