ovecc deadcode
Likely-dead code from export usage + entry-point reachability: unused exports (type-only exports tagged separately), unreachable files, unused manifest dependencies (opt-in), and phantom (unlisted) dependencies.
Usage: ovecc deadcode [OPTIONS]
Example
$ ovecc deadcode
Dead code: 8 unused export(s), 1 unused file(s), 1 unused dependency(ies), 1 unlisted dependency(ies)
[Medium] Unlisted dependency: dayjs
src/utils/helpers.ts:2 (bare import of 'dayjs' with no manifest declaration)
[Low] Unused dependency: left-pad
package.json:1 (dependencies)
[Low] Unused export: createUser in src/services/users.ts
src/services/users.ts:20
[Low] Unused file: src/legacy/old-report.ts
src/legacy/old-report.ts:1
[Low] Unused type export: Currency in src/utils/helpers.ts
src/utils/helpers.ts:4 (type-only)
...
Options
| Option | Effect |
|---|---|
--fail-on <medium|high|any> | Exit 1 when a finding crosses the threshold |
--changed-since <ref> | Only findings touching files changed since this Git ref |
Plus the global options.
Coverage honesty
When nothing is flagged, the report states its coverage — entry points found and JS/TS files analyzed — so a clean result is distinguishable from an analysis that never ran (no entry points detected, or no JS/TS sources for the unused-export pass). File-level reachability itself is language-agnostic; the unused-export analysis is JS/TS-deep today.
Opting into dependency checks
[index]
detect_unused_deps = true
Off by default because config-file-only usages (e.g. a tool loaded by name from a
config) cause false positives. With it on, unused-dependency,
unused-dev-dependency, and unused-optional-dependency findings appear;
unlisted-dependency (phantom) detection is always on.
Related
- Dead code & mechanical fixes guide
fix— remediates most of these automatically