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
.fallowrc.json and .fallowrc.jsonc are identical in behavior; the .jsonc extension only signals to editors that comments are expected. If more than one of these files coexists in the same directory, fallow loads the higher-precedence one and prints a warning on stderr naming the file it ignored, so a stale config left over from a migration cannot silently win.
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 and for namespace-barrel UI libraries (shadcn / Radix / bits-ui) where many Note: per-file
components/ui/<name>/index.ts files intentionally export the same short names.ignoreExports suppresses both unused-export findings AND duplicate-export grouping for matching files. Use exports: ["*"] to exclude every export from the matched files; use a name list to exclude only those names.overrides.rules.duplicate-exports = "off" has no effect because the rule spans multiple files (a duplicate-export finding groups N locations across N files). Fallow emits a load-time warning when this override shape is detected and points at ignoreExports as the working escape hatch.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.autoImports
autoImports
Resolve framework convention auto-imports (Nuxt components) as real module-graph edges. Frameworks like Nuxt expose components to templates by filesystem convention (Edges for these tag references are always synthesized, so a component’s default export consumed via a
<Card001 /> resolving to components/Card001.vue) with no import statement.<Card /> tag is credited under includeEntryExports. Setting autoImports: true additionally drops the Nuxt component entry patterns so a genuinely-unreferenced component is reported as unused-file instead of being kept alive as an entry point.The flag is conservative: if your nuxt.config declares a components: key (custom prefix, pathPrefix, or dirs), the entry patterns are kept, since those custom layouts are not yet modeled. Defaults to false. Composable, util, and Pinia store auto-imports are tracked separately.ignoreDecorators
ignoreDecorators
Decorator names that fallow should NOT treat as evidence of reflective use. Members carrying only listed decorators are checked for usage like undecorated members. Members carrying any decorator NOT in the list stay skipped, so framework defaults (NestJS, Angular, TypeORM) are unchanged.Use this when your codebase carries utility decorators that do not imply runtime reflection: Playwright’s Conservative semantics: a method decorated with both
@step("label"), internal labeling decorators like @measure, @log, @retry, or any custom decorator that wraps a method for logging or tracing.@step and @Inject stays skipped because @Inject is not in the ignore list. Only methods whose every decorator is in the list become subject to the standard usage check.Matching
- Bare entries (
"step"or"decorators") match the leftmost segment of the decorator path. A single bare"decorators"entry collapses every@decorators.*decorator, useful when an internal namespace exposes many utility decorators that should all be treated as non-reflective. - Dotted entries (
"decorators.log") match the full dotted path exactly. Sibling@decorators.auditdecorators stay skipped unless you also list"decorators.audit"or use the bare"decorators"form. - Both
"@step"and"step"round-trip equivalently; a leading@is stripped before matching.
Unmatched-entry warning
Entries that never match any decorator in the analyzed codebase produce a one-time warning at end of run, mirroringusedClassMembers’s warn-on-unmatched-pattern behavior. Treat unmatched entries as dead config and remove them.The default empty list preserves today’s skip-all-decorated behavior, so existing NestJS / Angular / TypeORM projects see no change. The first run after enabling this option will surface new unused-class-members findings on members previously hidden by the unconditional skip.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 |
crapRefactorBand | number | 5 | Band below maxCyclomatic where CRAP-only findings also receive a secondary refactor-function action when cognitive complexity is at least half of maxCognitive |
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. |
cacheMaxAgeDays | number | 30 | Max age (in days since last reuse or fresh create) of a persistent reusable base-snapshot worktree cache. Older entries are reclaimed at the top of the next fallow audit. 0 disables the GC. Overridable per-run via the FALLOW_AUDIT_CACHE_MAX_AGE_DAYS env var, which wins when both are set. |
fix
fix
Configure
fallow fix behavior.| Field | Type | Default | Description |
|---|---|---|---|
catalog.deletePrecedingComments | "auto" | "always" | "never" | "auto" | Controls contiguous YAML comment blocks immediately above removed pnpm catalog entries. |
auto removes a leading comment block when it clearly belongs to the deleted catalog entry: the block directly follows the parent catalog: / catalogs.<name>: header, or follows a blank separator. Use always to remove every adjacent leading comment block, or never to keep leading comments in place for manual review.Two escape hatches keep curated comments safe regardless of policy:-
Add
# fallow-keepto any line in a comment block to preserve the entire block even underalways. Mirrors the existingfallow-ignore-next-line/fallow-ignore-fileinline-suppression convention: -
Under
auto, section-banner blocks are automatically preserved. A banner is any comment whose body (after#and optional whitespace) starts with three or more repeats of=,-,*,_,~,+, or#:Underalwaysthe banner heuristic does not apply; use# fallow-keepto protect banners when running withalways.
fixes[N] carries both line (1-based first deleted line, the leading comment when auto / always absorb one) and entry_line (the catalog entry’s original 1-based line). CI annotators and dedup caches that key on the entry position should use entry_line for a stable anchor; tools that want to point at the actual file edit should use line.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, including pnpm catalog hygiene such as
error (default, fails CI with exit code 1), warn (reports but exits 0), or off (skip detection entirely).unused-catalog-entries and empty-catalog-groups, default severities, and per-glob overrides via the overrides field.flags
flags
Customize feature flag detection. Add SDK call patterns beyond the built-ins (LaunchDarkly, Statsig, Unleash, GrowthBook, Split, PostHog, Vercel Flags, ConfigCat, Flagsmith, Optimizely, Eppo), 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.cache
cache
Incremental cache tuning. Today the only knob is Default cap: 256 MB. The cap is the size of the serialized
maxSizeMb, which caps the on-disk extraction cache and triggers LRU eviction during save..fallow/cache.bin; saves that cross 80% of the cap evict the oldest entries down to 60%. The env var FALLOW_CACHE_MAX_SIZE overrides this field when both are set. Both values are interpreted as whole megabytes.The cache invalidates automatically when extraction-affecting config changes (currently: active plugin names + inline framework definition names). Detection-only fields (entry, ignorePatterns, severity overrides) do not bust the cache. See ADR-009 for the contract.--no-cache disables the cache entirely; this section is then irrelevant.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.