soham-cleanify
v1.0.4
Published
A CLI tool to detect and clean unused code in JavaScript and TypeScript projects.
Maintainers
Readme
soham-cleanify 🚀
A production-ready CLI tool to detect and clean unused code in your JavaScript and TypeScript projects.
Features
- 📦 Unused Dependency Detection: accurately finds npm packages in
package.jsonthat are never imported (uses AST, so comments don't fool it). - 🧹 Unused Import Detection: finds specific imports in your files that are never used.
- TypeScript Support: Correctly identifying Type/Interface usage.
- React Support: Handles JSX correctly.
- 🎮 Interactive Mode: Run with
--fixto see a checklist of items to clean. You decide what goes! - ⚡ Fast: Uses a smart "Parse Once" graph architecture.
- ⚙️ Configurable: Supports
.cleanifyrcconfiguration.
Installation
npm install -g soham-cleanifyUsage
Run in your project root:
soham-cleanifyOptions
--fix: Enter interactive mode to select and remove unused code.--yes: Auto-confirm all fixes (skip interactive prompts).--ignore <pattern>: Ignore specific files (e.g.--ignore "src/legacy/**").--dry-run: Show what would be done without making changes.
Configuration
Create a .cleanifyrc file in your root:
{
"ignore": ["**/tests/**", "src/legacy"]
}Author
Soham Gadhave
