Skip to content

Fallow how-to ​

Fallow is a static module-graph analyzer. It finds unused files/exports, duplication, and architecture hotspots. Complementary to ESLint and tsc.

Official docs: docs.fallow.tools

Install ​

bash
pnpm add -D fallow
pnpm run fallow:type-aware-status   # optional companion check
ItemPath
Config.fallowrc.json
Cache.fallow/ (gitignored)
Audit baselinese.g. config/fallow/*-baseline.json

Commands ​

bash
pnpm run fallow:check
pnpm run fallow:audit
pnpm run fallow:health
pnpm run fallow

pnpm exec fallow dead-code --type-aware --symbol-impact path/to/file.ts:exportName

Implementation examples ​

Config shape ​

json
{
  "ignorePatterns": ["sanity.types.ts", "studio/**", "docs/.vitepress/**", "docs-public/.vitepress/**"],
  "ignoreDependencies": ["mermaid", "vitepress", "vitepress-plugin-mermaid", "vue"],
  "typeAware": {
    "enabled": true,
    "projects": ["tsconfig.json"],
    "require": "best-effort"
  },
  "audit": {
    "gate": "new-only",
    "healthBaseline": "config/fallow/health-baseline.json"
  }
}

VitePress theme trees are ignored as entry graphs separate from the Next app. Docs-only packages go under ignoreDependencies.

Catch a dead export ​

ts
// no longer imported
export function oldHelper() {
  return 1;
}
bash
pnpm run fallow:check
# delete the export or restore a real import

PR / agent gate ​

bash
pnpm run fallow:audit   # new dead code vs merge-base

Ignore docs-only deps ​

List packages used only by VitePress (vitepress, vue, mermaid, …) under ignoreDependencies. Theme/config paths stay under ignorePatterns so they are not flagged as unused Next-app files.

Privacy ​

Analysis is local. Telemetry off by default.

Frontend Corner — agent ops, tooling, and decision records