Find what your codebase no longer needs.
npx deleteitnpx deleteit
npx deleteit ./packages/web
npx deleteit --json
npx deleteit --ciFor a local checkout:
pnpm install
pnpm build
pnpm test
pnpm test:real
pnpm benchmark -- path/to/your/project- Unused JavaScript and TypeScript files.
- Unused named/default exports, top-level functions, and classes.
- Unused npm dependencies.
- Environment variables declared in
.env,.env.*, or.env.examplebut not statically accessed. - Potentially removable non-empty lines and their percentage of the scanned codebase.
The scanner understands ESM, CommonJS require, type-only imports, literal dynamic imports, re-exports, barrel files, package main / module / browser / exports / bin / types, tsconfig/jsconfig aliases, workspace packages, and common Vite, Next.js, Jest, Vitest, and ESLint conventions.
Unused exports
OldUserService src/services/old.ts:12 HIGH
Unused functions / classes
LegacyParser src/parsers/legacy.ts:4 HIGH
Unused environment variables
OLD_API_URL .env, .env.example MEDIUM
HIGH: the scanner found complete static evidence that no reachable entrypoint, import, or reference uses the item.MEDIUM: static evidence suggests it is unused, but runtime conventions may still apply.LOW: an ambiguous signal is worth reviewing, but should not be treated as safe to delete.
| Command | Description |
|---|---|
deleteit |
Scan the current directory |
deleteit <path> |
Scan a project directory |
deleteit .deleteit |
Scan the current directory using a .deleteit JSON config when present |
deleteit --json |
Print machine-readable JSON |
deleteit --ci |
Exit with code 1 when findings exist |
deleteit --fix |
Reserved; no files are changed in v0.1.1 |
deleteit --help |
Show help |
deleteit --version |
Show version |
Optional .deleteit configuration:
{
"ignore": ["generated/**", "vendor/**"],
"entrypoints": ["src/worker.ts"]
}- run: pnpm dlx deleteit --ciThe repository itself tests Node 20, 22, and 24 on Ubuntu, Windows, and macOS through GitHub Actions.
DeleteIt prefers missing dead code over incorrectly marking live code as removable.
It does not automatically delete code in v0.1.1. Review every finding, especially MEDIUM and LOW confidence results, generated files, runtime reflection, plugin loading, and externally consumed package APIs.
- V0.1.1 supports JavaScript and TypeScript only.
- Non-literal dynamic imports are protected conservatively.
- Runtime reflection, generated code, undocumented CLI conventions, and external consumers cannot always be proven statically.
- Unresolved generated imports, runtime reflection, and custom framework conventions remain intentionally conservative.
--fixis a safe placeholder and does not mutate files.
- Reviewable fix previews before any mutation.
- More framework-specific route and generated-code conventions.
- Optional Markdown/HTML reports.
See CONTRIBUTING.md, SECURITY.md, and the issue templates. Keep changes small, add regression coverage for analysis behavior, and preserve the low false-positive bar.
