Conservative TypeScript dead code detection with transitive analysis and confidence scoring
npm install @dean0x/diedeadcodeConservative dead code detection for TypeScript and JavaScript.
ddd finds unused exports, unreachable functions, and dead code in your codebase with confidence scoring to minimize false positives.
``bash`
npm install -D diedeadcode
Or run directly with npx:
`bash`
npx diedeadcode .
`bashAnalyze current directory
ddd .
Features
- Fast - Built on oxc for blazing-fast parsing
- Conservative - Confidence scoring reduces false positives
- Transitive analysis - Detects code that's only called by other dead code
- Framework-aware - Understands Next.js, Express, Jest, Vitest patterns
- Configurable - Ignore patterns, entry points, and more
Configuration
Run
ddd init to generate a ddd.toml in your project root:`toml
Files to analyze
include = ["/.ts", "/.tsx", "/.js", "/.jsx"]
exclude = ["/node_modules/", "/dist/", "*/.test.*"]Entry points
[entry]
files = ["src/index.ts", "src/main.ts"]
patterns = ["/pages//*.tsx"]
autoDetect = trueOutput settings
[output]
format = "table"
minConfidence = "high"
showChains = true
`Alternative Installation Methods
$3
`bash
cargo install diedeadcode
`$3
`bash
brew install dean0x/tap/diedeadcode
``See the GitHub repository for full documentation.
MIT