Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fallow) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
fallow
The codebase analyzer for TypeScript and JavaScript, built in Rust.
Unused code, circular dependencies, code duplication, complexity hotspots, and architecture boundary violations. Found in seconds, not minutes. fallow analyzes your codebase for unused files, exports, dependencies, and types, detects circular dependencies, finds duplicated code blocks, surfaces complexity hotspots, and enforces architecture boundaries. 5-41x faster than knip v5 (2-18x faster than knip v6), 8-29x faster than jscpd for duplication detection, with no Node.js runtime dependency.
Installation
npm install -g fallowThis installs the fallow CLI plus the companion fallow-lsp and fallow-mcp binaries.
Usage
fallow # All analyses -- zero config, sub-second
fallow dead-code # Unused code only
fallow dupes # Duplication detection -- find copy-paste clones
fallow dupes --mode semantic # Catch clones with renamed variables
fallow health # Complexity metrics -- cyclomatic + cognitive
fallow fix --dry-run # Preview auto-removal of unused exports and depsWhat it finds
- Unused files -- not reachable from any entry point
- Unused exports -- exported symbols never imported elsewhere
- Unused types -- type aliases and interfaces never referenced
- Unused dependencies -- packages in
dependenciesnever imported - Unused devDependencies -- dev packages not referenced
- Unused enum members -- enum values never referenced
- Unused class members -- class methods and properties never referenced (tracks instance usage:
const svc = new MyService(); svc.greet()countsgreetas used) - Unresolved imports -- import specifiers that cannot be resolved
- Unlisted dependencies -- imported packages missing from
package.json - Duplicate exports -- same symbol exported from multiple modules
- Circular dependencies -- import cycles in the module graph
- Type-only dependencies -- production deps only used via
import type
Code duplication
fallow dupes # Default: mild mode
fallow dupes --mode semantic # Catch clones with renamed variables
fallow dupes --threshold 5 # Fail CI if duplication exceeds 5%
fallow dupes --save-baseline # Save current duplication as baseline4 detection modes (strict, mild, weak, semantic), clone family grouping with refactoring suggestions, baseline tracking, and cross-language TS/JS matching.
Framework support
90 built-in plugins covering Next.js, Nuxt, Remix, Qwik, SvelteKit, Gatsby, Astro, Angular, NestJS, Expo Router, Vite, Webpack, Vitest, Jest, Playwright, Cypress, Storybook, ESLint, TypeScript, Tailwind, UnoCSS, Prisma, Drizzle, Convex, Turborepo, Hardhat, and many more. Auto-detected from your package.json.
Configuration
Create a config file in your project root, or run fallow init:
// .fallowrc.json
{
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
"entry": ["src/workers/*.ts", "scripts/*.ts"],
"ignorePatterns": ["**/*.generated.ts"],
"rules": {
"unused-files": "error",
"unused-exports": "warn",
"unused-types": "off"
}
}Also supports TOML (fallow init --toml creates fallow.toml).
Documentation
License
MIT