Fallow
What is Fallow?
Section titled “What is Fallow?”Fallow is a codebase analysis tool for TypeScript and JavaScript. A single run checks for dead code, duplicated logic, and maintainability problems such as complexity hot spots.
It complements a linter: a linter examines individual files for suspicious syntax and style, while Fallow follows relationships across the project to find unused files, exports, types, and dependencies.
Installation
Section titled “Installation”Install Fallow as a development dependency so everyone on the project uses the same version:
pnpm add --save-dev fallowWire the local binary into package.json:
{ "scripts": { "fallow": "fallow" }}Run the complete analysis with:
pnpm fallowThe bare command runs all three analysis groups. During focused work, you can
run pnpm fallow dead-code, pnpm fallow dupes, or pnpm fallow health.
Configuration
Section titled “Configuration”Fallow works without configuration. When a framework or build tool loads a file
by convention, however, static analysis may not see the connection. Create a
.fallowrc.json and add only those paths to ignorePatterns:
{ "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", "entry": ["main.ts"], "ignorePatterns": ["vite.config.ts"], "ignoreDependencies": ["@fontsource-variable/atkinson-hyperlegible-next"]}The $schema entry enables validation and editor completion.
Practical workflow
Section titled “Practical workflow”- Run
pnpm fallow. - Review each finding before deleting code or dependencies.
- Fix genuine findings in small, testable changes.
- Add a focused ignore only when usage depends on a convention Fallow cannot discover.
- Re-run the analysis until its output is useful and understood.
For automatic cleanup, preview changes first with
pnpm fallow fix --dry-run. Commit or stash unrelated work before applying a
fix without --dry-run.