knip
Identify and remove unused dependencies, files, and exports in TypeScript and JavaScript projects. Use when detecting unused code, cleaning up dead code, improving maintainability, or reducing bundle sizes.
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
Knip
Find unused files, dependencies, and exports in TypeScript/JavaScript projects.
Usage
bunx knip # Analyze project
bunx knip --production # Production only (no tests, devDeps)
bunx knip --strict # Direct dependencies only
bunx knip --fix # Auto-remove unused (use cautiously)
bunx knip --include files # Only unused files
bunx knip --include exports # Only unused exports
bunx knip --include dependencies # Only unused deps
Output Formats
bunx knip --reporter compact # Compact output
bunx knip --reporter json # JSON for tooling
bunx knip --reporter github-actions # CI annotations
Filtering
bunx knip --workspace packages/client # Specific workspace
bunx knip --exclude "test/**/*" # Exclude patterns
Debugging
bunx knip --debug # Debug output
bunx knip --trace-file src/utils.ts # Trace file
bunx knip --trace-export myFunction # Trace export
Configuration
Configure via .knip.json or knip.config.js for custom entry points and exclusions.
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!