Introduction
Fallow is a Rust-native codebase intelligence tool for TypeScript and JavaScript projects. It detects unused exports, duplicate code, circular dependencies, and complexity hotspots in sub-second time, helping teams keep large codebases clean and maintainable.
What Fallow Does
- Identifies unused exports, dead code, and unreferenced files across a TypeScript/JavaScript project
- Detects copy-pasted code blocks and near-duplicate implementations
- Maps circular dependency chains and visualizes module dependency graphs
- Calculates complexity metrics to highlight hotspots that may need refactoring
- Enforces architecture boundaries between modules or packages in a monorepo
Architecture Overview
Fallow uses the oxc parser (a fast Rust-based JavaScript/TypeScript parser) to build an AST from source files. It constructs a dependency graph by resolving imports and exports, then runs multiple analysis passes: reachability analysis for dead code detection, token-based similarity for duplication, cycle detection for circular dependencies, and metric aggregation for complexity scoring. The Rust implementation keeps full-project analysis under one second for most codebases.
Self-Hosting & Configuration
- Install via npm (
npx fallowornpm install -g fallow) or download the Rust binary directly - Run
fallow analyzein a project root to scan all TypeScript and JavaScript files - Configure analysis rules in a
fallow.config.jsonor via CLI flags - Exclude paths or files with glob patterns in the configuration
- Integrate into CI pipelines to enforce code quality thresholds on pull requests
Key Features
- Sub-second analysis speed on most projects thanks to the Rust implementation
- Zero configuration needed for basic unused code and circular dependency detection
- Framework-aware analysis understands Next.js, React, and common project structures
- Architecture boundary enforcement prevents unwanted cross-module dependencies
- JSON and human-readable output formats for CI integration and developer workflows
Comparison with Similar Tools
- ESLint — Rule-based linter for code style; Fallow focuses on structural analysis like dead code and duplication
- Knip — JavaScript dead code finder; Fallow adds duplication detection and complexity analysis in a faster runtime
- Madge — Circular dependency visualization; Fallow includes this plus dead code and duplication analysis
- SonarQube — Enterprise code quality platform; Fallow is lighter and specialized for TypeScript
- depcheck — Finds unused npm dependencies; Fallow analyzes source-level exports and imports
FAQ
Q: Does it support plain JavaScript or only TypeScript?
A: Both. Fallow analyzes .ts, .tsx, .js, .jsx, .mjs, and .cjs files.
Q: How fast is it on large codebases? A: Most projects analyze in under one second. The Rust implementation and oxc parser make it significantly faster than Node.js-based alternatives.
Q: Can I use it in a monorepo? A: Yes. Fallow supports monorepo structures and can enforce architecture boundaries between packages.
Q: Does it support auto-fixing issues? A: Fallow reports findings but does not auto-remove code. Deletion is left to the developer to avoid unintended side effects.