Config file formats
Fallow searches for config files in this order:.fallowrc.json(JSONC, comments allowed)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. Use this for files that aren’t auto-detected.Entry point auto-detection
Entry point auto-detection
Even without an
The
entry config, fallow automatically discovers entry points from your package.json fields. These files are treated as 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 (recursively resolved, 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 as well.Output directories (dist/, build/, out/, esm/, cjs/) referenced in these fields are mapped back to src/ equivalents with source extension fallback, since 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.
ignoreExports
ignoreExports
Rules for ignoring specific exports. Useful for public API packages.
duplicates
duplicates
Configuration for
fallow dupes:production
production
Enable production mode to focus on code that ships to users.
workspaces
workspaces
Override configuration for specific workspace packages in a monorepo:
extends
extends
Inherit from one or more base config files. This is useful for sharing configuration across projects or maintaining a base config with per-project overrides.Key behaviors:
- Deep merge: Object fields (like
rules) are deep-merged. The child config’s values override 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.overrides
overrides
Apply different rules to specific file patterns. This is useful for relaxing rules in test files or tightening 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.
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.