deadfall
Finds the unused code in a React codebase, and shows its evidence.
A static-analysis CLI on npm that finds unused code in Next.js, Vite and React projects. Its CI mode flags only newly introduced dead code rather than blocking on an existing backlog, so a team can turn it on today.
--since <git-ref> reports only what went dead after a branch point. A GitHub annotations reporter puts findings on the diff. A whole-run cache took repeat analysis from 10.1 seconds to 0.32 seconds on an unchanged codebase, with identical output. On a 1,159-file benchmark application it resolved 4,019 of 4,025 imports.
Three framework adapters sit above one graph: one for Next.js (App and Pages Router); one for Vite, Create React App and React Native; and one for publishable libraries. It’s read-only unless you pass --fix, and it writes an interactive HTML report of the graph.
The decision that shaped it. It refuses to delete what it can’t prove is dead. A tool that removes code has to be wrong in the safe direction, so an unresolved reference counts as a use.
More detail
Each verdict is graded confirmed, unreachable or uncertain, and carries its evidence. deadfall why prints the shortest path from a root to a symbol, with the file, line and kind of edge at each hop.
Version 0.3.0 fixed a data-loss bug in --fix: on a real repo it had proposed 72 deletions, two of them provably live. It now counts import(), require() and HTML <script src> references.
npx deadfall check ./my-next-app