Fallow works out of the box with zero configuration. To customize entry points, rules, or ignore patterns, create a config file:Documentation Index
Fetch the complete documentation index at: https://docs.fallow.tools/llms.txt
Use this file to discover all available pages before exploring further.
Config file formats
Fallow searches for config files in this order:.fallowrc.json(JSONC, comments allowed).fallowrc.jsonc(same JSONC parser, lets editors auto-detect JSON-with-comments syntax highlighting)fallow.toml.fallow.toml
Full example
Config fields
entry
entry
Additional entry point glob patterns. Fallow auto-detects entry points from
package.json (main, module, bin, exports) and framework plugins. Add files here that aren’t auto-detected.Entry point auto-detection
Entry point auto-detection
Even without an
The
entry config, fallow discovers entry points from your package.json fields. These files are the roots of the module graph. Anything reachable from them is considered “used.”Fallow reads the following package.json fields:| Field | Description |
|---|---|
main | CJS entry point |
module | ESM entry point |
types / typings | TypeScript declaration entry point |
source | Unbuilt source entry point (common convention for dev tooling) |
browser | Browser-specific entry (string or object with per-path overrides) |
bin | CLI binaries (string for single binary, object for multiple) |
exports | Modern entry point map (resolved recursively, including conditional exports and subpath patterns) |
exports field is resolved recursively. Nested conditions like "import", "require", "types", and "default" are all followed to their target files. Subpath exports (e.g., "./utils") are included too.Output directories (dist/, build/, out/, esm/, cjs/) referenced in these fields are mapped back to src/ equivalents with source extension fallback. Fallow ignores output directories by default.On top of package.json fields, framework plugins add their own entry points (e.g., Next.js adds pages/**, app/**/page.tsx; Vitest adds **/*.test.ts). Run fallow list to see all detected entry points.ignorePatterns
ignorePatterns
Glob patterns for files to exclude from analysis entirely.
ignoreDependencies
ignoreDependencies
Package names that should always be considered used and always considered available.
Listed dependencies are excluded from both unused dependency and unlisted dependency detection.
Useful for runtime-provided packages like
bun:sqlite or implicitly available dependencies.ignoreExports
ignoreExports
Rules for ignoring specific exports. Useful for public API packages.
ignoreExportsUsedInFile
ignoreExportsUsedInFile
Suppress unused-export findings when the exported symbol is referenced inside the file that declares it. Exports with no references at all are still reported. Mirrors knip’s A fine-grained object form is also accepted for knip parity:Fallow groups type aliases and interfaces under the same
ignoreExportsUsedInFile.unused-types issue, so { "type": true }, { "interface": true }, and { "type": true, "interface": true } all behave identically: any type export referenced in the same file is suppressed. The two fields exist only for knip-config compatibility.References inside the export specifier itself (export { foo }, export { foo as bar }, export default foo) do not count as same-file uses; those exports are still reported when no other file or no other in-file expression references the binding.includeEntryExports
includeEntryExports
Report unused exports in entry files (package.json The same behaviour is also available as the global CLI flag
main/exports, framework pages, etc.) instead of auto-marking them as used. Catches typos in framework-convention exports like meatdata instead of metadata.--include-entry-exports. The CLI flag wins when both are set.usedClassMembers
usedClassMembers
Class member method/property names that should never be reported as unused. Extends fallow’s built-in Angular and React lifecycle allowlist with framework-invoked names from third-party libraries.Use this when a library calls methods on your class at runtime via an interface or contract pattern. Common examples include ag-Grid (Plain names like
agInit, refresh), TypeORM migrations (up, down), and Web Components (connectedCallback, disconnectedCallback, attributeChangedCallback).Each entry is either a plain member name (global suppression) or a scoped object that only matches classes whose heritage clause includes the configured extends or implements identifier. Strings can be exact names or glob patterns:agInit are unique enough to suppress globally. Common names like refresh or execute would produce false negatives across unrelated classes, so scope them with implements or extends. A scoped rule requires at least one of extends or implements; an unconstrained object rule ({ "members": [...] } with no heritage field) is rejected at load time.Heritage matching is syntactic: the identifier in the source’s extends Foo or implements IBar clause is compared against the rule’s string. Re-aliased imports (import { IBar as IBaz }) use whatever identifier appears in the class declaration.Glob patterns
Member strings containing* or ? are treated as glob patterns; existing exact strings keep their current meaning. "*" matches every member declared on a matching class, "enter*" matches any member whose name starts with enter, "*Handler" matches any member ending with Handler, and "on*Event" combines prefix and suffix. Useful for parser-generator listeners (ANTLR), code-generated bridges, and abstract framework bases that dispatch on a member-name prefix instead of an exhaustive list.Glob patterns that match zero members across the codebase emit a WARN at the end of the run so dead allowlist entries surface. Exact-string entries do not emit this warning (they are common boilerplate that may legitimately match in some configurations but not others).The allowlist only applies to class methods and properties. Enum members with the same names are still checked.For library-specific allowlists that should only activate when the library is installed, prefer a plugin file with the usedClassMembers field. See Custom plugins for the plugin format.publicPackages
publicPackages
Workspace packages whose exported API surface should be considered public. Exports, exported enum members, and exported class members from these packages are never reported as unused, even if no internal consumer imports them. Useful for library packages that are consumed externally.
dynamicallyLoaded
dynamicallyLoaded
Glob patterns for files that are loaded dynamically at runtime (e.g., via
import(), lazy routes, or plugin systems). These files are treated as entry points and will not be reported as unused.duplicates
duplicates
Configuration for
fallow dupes:| Field | Type | Default | Description |
|---|---|---|---|
mode | "strict" | "mild" | "weak" | "semantic" | "mild" | Detection mode. strict/mild match exact tokens. weak blinds string literal values. semantic blinds identifiers and all literal values for structural (Type-2) detection. |
minTokens | number | 50 | Minimum token count for a code block to be considered a clone |
minLines | number | 5 | Minimum line count for a clone group |
threshold | number | 0 | Maximum allowed duplication percentage before failing (exit code 1). 0 disables the limit. |
enabled | boolean | true | Toggle duplication detection on/off |
ignore | string[] | [] | Glob patterns to exclude from duplication analysis. Merged with the built-in defaults below unless ignoreDefaults is false. |
ignoreDefaults | boolean | true | Merge built-in generated-output ignores (**/.next/**, **/.nuxt/**, **/.svelte-kit/**, **/.turbo/**, **/.parcel-cache/**, **/.vite/**, **/.cache/**, **/out/**, **/storybook-static/**) with ignore. Set to false to use only your configured ignore list. |
skipLocal | boolean | false | Only report cross-directory duplicates, skip file-internal clones |
crossLanguage | boolean | false | Enable cross-language clone detection between .ts and .js files by stripping TypeScript type annotations |
ignoreImports | boolean | false | Exclude ES import declarations from clone detection. Reduces noise from sorted import blocks that naturally look similar across files. Only affects ES import statements; CommonJS require() calls are not filtered. |
normalization | object | none | Fine-grained normalization overrides: ignoreIdentifiers, ignoreStringValues, ignoreNumericValues |
minCorpusSizeForShingleFilter | number | 1024 | Tokenized file count above which focused-mode duplication (driven by --changed-since or audit) prefilters unchanged files via k-token shingles. Below this threshold the prefilter is skipped because building the shingle index outweighs the savings. |
minCorpusSizeForTokenCache | number | 5000 | Source file count above which the persistent duplication token cache activates under <root>/.fallow/cache/dupes-tokens-vN/. Below this threshold the cache load/save overhead exceeds the tokenize savings, so the cache stays disabled even without --no-cache. |
health
health
Configuration for
fallow health:| Field | Type | Default | Description |
|---|---|---|---|
maxCyclomatic | number | 20 | Maximum cyclomatic complexity before reporting |
maxCognitive | number | 15 | Maximum cognitive complexity before reporting |
maxCrap | number | 30 | Maximum CRAP score before reporting |
ignore | string[] | [] | Glob patterns for files to exclude from complexity analysis |
suggestInlineSuppression | boolean | true | Emit suppress-line action hints on health findings in JSON output. Auto-omitted when --baseline/--save-baseline is active regardless of this setting. Set to false to opt out across the project when you do not want CI-driven inline suppression hints. |
audit
audit
Configuration for
fallow audit, the changed-file review command:| Field | Type | Default | Description |
|---|---|---|---|
gate | "new-only" | "all" | "new-only" | Which findings affect the audit verdict. new-only fails only on issues introduced by the current changeset while keeping inherited findings visible as context. all gates every finding in changed files and skips the extra base-snapshot attribution pass. |
production
production
Enable production mode to focus on code that ships to users. Accepts the legacy boolean form (applies to every analysis) or a per-analysis object so you can run, for example, production-only health while keeping dead-code and duplication on the full tree:The CLI flags
--production, --production-dead-code, --production-health, and --production-dupes (bare combined runs and fallow audit) override config. The matching env vars FALLOW_PRODUCTION, FALLOW_PRODUCTION_DEAD_CODE, FALLOW_PRODUCTION_HEALTH, FALLOW_PRODUCTION_DUPES follow the same precedence ladder, with per-analysis env beating global env. See global flags for the full ladder.workspaces
workspaces
Additional workspace patterns beyond what’s detected from
package.json or pnpm-workspace.yaml:extends
extends
Inherit from one or more base config files. Handy for sharing config across projects or keeping a base config with per-project overrides.The
Key behaviors:
extends field supports three source types:| Source | Example | Description |
|---|---|---|
| Relative path | "./configs/base.json" | Local file, resolved relative to the config file |
| npm package | "npm:@my-org/fallow-config" | Reads the package’s main entry from node_modules |
| HTTPS URL | "https://example.com/fallow-base.json" | Fetched remotely over HTTPS |
- Deep merge: Object fields (like
rules) are deep-merged. The child config overrides the base, but unspecified fields are inherited. - Array replacement: Array fields (like
entry,ignorePatterns) are replaced entirely, not concatenated. If the child specifiesentry, it overrides the baseentry. - Cross-format support: A JSON config can extend a TOML config and vice versa.
- Circular detection: Fallow detects circular extends chains and reports an error.
- Max depth: Extends chains are limited to 10 levels to prevent accidental deep nesting.
- String shorthand: A single path can be passed as a string instead of an array:
"extends": "./base.json".
extends field.URL extends
URL sources must usehttps:// (plain HTTP is rejected). Fallow fetches the config on every run with no caching.- Timeout: 5 seconds by default, configurable via
FALLOW_EXTENDS_TIMEOUT_SECS - Body limit: 1 MB maximum response size
- Chaining: A URL-sourced config can extend other URLs or
npm:packages, but not relative paths (there is no filesystem context to resolve against)
overrides
overrides
Apply different rules to specific file patterns. For example, relax rules in test files or tighten them in critical paths.Each override object has:
files: Array of glob patterns matched against project-relative paths.rules: Rule severity overrides that apply to files matching the patterns.
sealed
sealed
Mark a config as sealed to guarantee it cannot be modified by ancestor configs being injected via Use cases:
extends. When sealed: true:extendspaths must be file-relativeextendspaths must resolve within the config’s own directory (no../escapes)npm:andhttps:extends are rejected with a clear error
- Library publishers shipping a
.fallowrc.jsonas part of an npm package can guarantee the config is self-contained - Monorepo sub-packages (e.g., a shared component library used by multiple apps) that intentionally do not inherit from the monorepo root config
sealed: true does not affect config discovery. Fallow’s first-match-wins walk already stops at the nearest config in the directory tree. This option only constrains what extends can reference.boundaries
boundaries
Define architecture boundary zones and import rules. Use a built-in preset or define custom zones.Available presets:
layered, hexagonal, feature-sliced, bulletproof. Or define custom zones and rules for full control.See Architecture boundaries for presets, custom zones, examples, and output formats.rules
rules
Per-issue-type severity rules: See Rules and severity for the full list of issue types, default severities, and per-glob overrides via the
error (default, fails CI with exit code 1), warn (reports but exits 0), or off (skip detection entirely).overrides field.flags
flags
Customize feature flag detection. Add SDK call patterns beyond the built-ins (LaunchDarkly, Statsig, Unleash, GrowthBook), declare environment variable prefixes, or enable opt-in heuristic detection.
See
| Field | Type | Default | Description |
|---|---|---|---|
sdkPatterns | SdkPattern[] | [] | Additional SDK call patterns to detect as feature flags. Merged with built-ins. Each entry: function (function name to match), nameArg (zero-based index of the argument containing the flag name, default 0), provider (optional label shown in output). |
envPrefixes | string[] | [] | Environment variable prefixes that indicate feature flags. Merged with built-ins. Only process.env.* accesses matching these prefixes are reported. |
configObjectHeuristics | boolean | false | Enable heuristic detection: property accesses on objects whose name contains “feature”, “flag”, or “toggle” are reported as low-confidence flags. Opt-in due to higher false-positive rate. |
fallow flags for the command that consumes this configuration.resolve
resolve
Module resolver configuration. Controls how fallow matches
Use this to honor community-defined conditions like With this config, a resolves
package.json exports and imports maps.| Field | Type | Default | Description |
|---|---|---|---|
conditions | string[] | [] | Additional export / import condition names to honor during resolution. Merged with fallow’s built-in set: development, import, require, default, types, node (plus react-native and browser when the React Native or Expo plugin is active). User conditions are matched with higher priority than the baseline. |
worker, edge-light, deno, or any custom condition your bundler uses. The built-in development condition already ships in the baseline, so packages that declare a development branch (common in monorepos where development points at source and import points at compiled output) resolve to source without any config.package.json like:./api to src/api.worker.ts instead of dist/api.js.See the Node.js community conditions reference for the full list of established condition names.codeowners
codeowners
Path to a CODEOWNERS file for
--group-by owner. When unset, fallow auto-probes CODEOWNERS, .github/CODEOWNERS, .gitlab/CODEOWNERS, and docs/CODEOWNERS. Set this to use a non-standard location.framework
framework
Inline framework plugin definitions. Define custom entry points, ignored files, or test patterns without a separate plugin file.
plugins
plugins
Paths to external plugin files or directories. In addition to these explicit paths, fallow automatically discovers
*.toml, *.json, *.jsonc files in .fallow/plugins/ and fallow-plugin-*.{toml,json,jsonc} in the project root.regression
regression
Regression detection baseline embedded in config. Stores issue counts from a known-good state for CI regression checks. Populated by
--save-regression-baseline (no path argument), read by --fail-on-regression.JSON Schema
The$schema field enables autocomplete and validation in your editor:
See also
Rules & Severity
Control issue severity for incremental CI adoption.
Inline Suppression
Suppress individual findings directly in source code.
Custom Plugins
Extend fallow with framework-specific entry point detection.