fallow 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fallow",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "Codebase intelligence for TypeScript and JavaScript. Free static analysis of code and styles, optional paid runtime intelligence (Fallow Runtime). Quality, risk, architecture, dependencies, duplication, and design-system drift for humans, CI, and the agents writing your code. Zero-config framework support.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -87,13 +87,13 @@
87
87
  "@tanstack/intent": "0.3.2"
88
88
  },
89
89
  "optionalDependencies": {
90
- "@fallow-cli/darwin-arm64": "3.1.0",
91
- "@fallow-cli/darwin-x64": "3.1.0",
92
- "@fallow-cli/linux-x64-gnu": "3.1.0",
93
- "@fallow-cli/linux-arm64-gnu": "3.1.0",
94
- "@fallow-cli/linux-x64-musl": "3.1.0",
95
- "@fallow-cli/linux-arm64-musl": "3.1.0",
96
- "@fallow-cli/win32-arm64-msvc": "3.1.0",
97
- "@fallow-cli/win32-x64-msvc": "3.1.0"
90
+ "@fallow-cli/darwin-arm64": "3.3.0",
91
+ "@fallow-cli/darwin-x64": "3.3.0",
92
+ "@fallow-cli/linux-x64-gnu": "3.3.0",
93
+ "@fallow-cli/linux-arm64-gnu": "3.3.0",
94
+ "@fallow-cli/linux-x64-musl": "3.3.0",
95
+ "@fallow-cli/linux-arm64-musl": "3.3.0",
96
+ "@fallow-cli/win32-arm64-msvc": "3.3.0",
97
+ "@fallow-cli/win32-x64-msvc": "3.3.0"
98
98
  }
99
99
  }
package/schema.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "$schema": {
7
+ "description": "A string pointing at fallow's JSON Schema URL, used only by editors for autocomplete and validation of the config file; it has no effect on analysis and is stripped before serialization (serde skip_serializing, writeOnly in the schema). Set it to `https://fallow.dev/schema.json` to get editor IntelliSense; any other value is ignored by fallow.",
7
8
  "type": [
8
9
  "string",
9
10
  "null"
@@ -11,6 +12,7 @@
11
12
  "writeOnly": true
12
13
  },
13
14
  "extends": {
15
+ "description": "An ordered array of parent config sources to inherit before this file's own keys apply; each entry is a file-relative path, an `npm:<package>` specifier, or an `https://` URL (`http://` is rejected), deep-merged in order so objects merge field-by-field while arrays and scalars in this file replace the parent's, with cycle and depth guards. Set it to share a base config across a monorepo or team; it is consumed at load and stripped before serialization (serde skip_serializing).",
14
16
  "type": "array",
15
17
  "items": {
16
18
  "type": "string"
@@ -18,6 +20,7 @@
18
20
  "writeOnly": true
19
21
  },
20
22
  "entry": {
23
+ "description": "An array of project-root-relative glob patterns whose matching files are seeded as manual entry points, on top of the framework and package.json entries fallow discovers automatically, so their transitive imports are not reported as unused. Set it (e.g. `[\"src/main.ts\"]`) when a file is a real runtime root that no plugin or manifest declares; patterns are validated at load and matched against discovered files.",
21
24
  "type": "array",
22
25
  "items": {
23
26
  "type": "string"
@@ -25,6 +28,7 @@
25
28
  "default": []
26
29
  },
27
30
  "ignorePatterns": {
31
+ "description": "An array of project-root-relative glob patterns for files to exclude from analysis entirely; entries are unioned with fallow's built-in defaults (**/node_modules/**, **/dist/**, build/**, **/.git/**, **/coverage/**, **/*.min.js, **/*.min.mjs, **/*.min.cjs, **/*.bundle.js), so custom globs add to rather than replace them. Set it (e.g. `[\"generated/**\"]`) to drop generated or vendored trees from every detector; patterns are validated at load.",
28
32
  "type": "array",
29
33
  "items": {
30
34
  "type": "string"
@@ -32,6 +36,7 @@
32
36
  "default": []
33
37
  },
34
38
  "framework": {
39
+ "description": "Declares inline external framework plugins as data (array of plugin objects), each with `name` plus optional `enablers` (package names that activate it) or richer `detection` (dependency/file-existence/`all`/`any` checks, taking priority over `enablers`), `entryPoints` (+ `entryPointRole` runtime/support/test), `configPatterns`, `alwaysUsed`, `toolingDependencies`, `usedExports` (`{ pattern, exports }`), and `usedClassMembers`. Set it to keep a custom or in-house framework's entry points, config files, and conventions reachable without a Rust plugin; these definitions are appended to plugins discovered via `plugins`, `.fallow/plugins/`, and root `fallow-plugin-*` files (first occurrence of a name wins), and cannot do AST-based config parsing.",
35
40
  "type": "array",
36
41
  "items": {
37
42
  "$ref": "#/$defs/ExternalPluginDef"
@@ -39,6 +44,7 @@
39
44
  "default": []
40
45
  },
41
46
  "workspaces": {
47
+ "description": "Monorepo workspace configuration whose sole sub-key patterns (array of globs) adds workspace package roots beyond those discovered from package.json workspaces, pnpm-workspace.yaml, and tsconfig references. Optional and absent by default (discovery uses the manifests alone); set it only when workspaces live in directories the standard manifests do not declare.",
42
48
  "anyOf": [
43
49
  {
44
50
  "$ref": "#/$defs/WorkspaceConfig"
@@ -50,6 +56,7 @@
50
56
  "default": null
51
57
  },
52
58
  "ignoreDependencies": {
59
+ "description": "A list of exact package names excluded from BOTH unused-dependency and unlisted-dependency detection, so a runtime-provided or otherwise-untracked package (e.g. `bun:sqlite`, a peer supplied at deploy time) is never flagged as unused when declared nor as unlisted when imported. Set it for packages fallow cannot observe being used and cannot observe being declared; matching is exact string equality against the package name, not a glob.",
53
60
  "type": "array",
54
61
  "items": {
55
62
  "type": "string"
@@ -57,6 +64,7 @@
57
64
  "default": []
58
65
  },
59
66
  "ignoreUnresolvedImports": {
67
+ "description": "A list of glob patterns that suppress only `unresolved-import` findings whose raw import specifier matches; it does not change dependency usage accounting or resolver behavior. Patterns match the import string as written (not a filesystem path), so list both `@example/icons` and `@example/icons/**` to cover a bare package and its subpaths; parent-relative generated specifiers like `../generated/**` are valid, and broad values like `**` can hide real missing modules.",
60
68
  "type": "array",
61
69
  "items": {
62
70
  "type": "string"
@@ -64,6 +72,7 @@
64
72
  "default": []
65
73
  },
66
74
  "ignoreExports": {
75
+ "description": "A list of per-file rules that exempt named exports from `unused-export` and from duplicate-exports grouping for files matching a glob. Each entry is `{ file: <glob>, exports: [<name>, ...] }` where `exports: [\"*\"]` exempts every export in the file and a name list exempts only those names; built for component-library barrels (shadcn/Radix/bits-ui `index.ts`) that intentionally re-export the same short names across many files.",
67
76
  "type": "array",
68
77
  "items": {
69
78
  "$ref": "#/$defs/IgnoreExportRule"
@@ -71,28 +80,33 @@
71
80
  "default": []
72
81
  },
73
82
  "ignoreCatalogReferences": {
83
+ "description": "A list of rules that suppress `unresolved-catalog-reference` findings (a workspace `package.json` referencing a `catalog:` or `catalog:<name>` that the catalog does not declare); config-only because `package.json` has no inline-suppression comment surface. Each entry needs a `package` (exact match) plus optional `catalog` (exact catalog-name match) and `consumer` (glob on the consuming package.json path); use it for staged catalog migrations where the catalog edit lands in a separate change.",
74
84
  "type": "array",
75
85
  "items": {
76
86
  "$ref": "#/$defs/IgnoreCatalogReferenceRule"
77
87
  }
78
88
  },
79
89
  "ignoreDependencyOverrides": {
90
+ "description": "A list of rules that suppress `unused-dependency-override` and `misconfigured-dependency-override` findings for pnpm `overrides` entries; config-only, matched against the override's target package. Each entry needs a `package` (exact match) plus an optional `source` to scope the suppression to `\"pnpm-workspace.yaml\"` or `\"package.json\"`.",
80
91
  "type": "array",
81
92
  "items": {
82
93
  "$ref": "#/$defs/IgnoreDependencyOverrideRule"
83
94
  }
84
95
  },
85
96
  "ignoreExportsUsedInFile": {
97
+ "description": "Controls whether an export referenced only by another symbol in the same file is treated as used (suppressed from `unused-export`) until it becomes completely unreferenced; references inside an export specifier itself (`export { foo }`, `export default foo`) do not count as same-file uses. Accepts `true`/`false` (default `false`, suppress nothing) or the knip-parity object `{ \"type\": true, \"interface\": true }`, which restricts the suppression to type-only exports; fallow groups type aliases and interfaces under one kind, so both object fields behave identically.",
86
98
  "$ref": "#/$defs/IgnoreExportsUsedInFileConfig",
87
99
  "default": false
88
100
  },
89
101
  "ignoreDecorators": {
102
+ "description": "A list of decorator names that no longer grant a class member automatic exemption from `unused-class-member`: a member whose every decorator is in this set is checked normally, while a member carrying any decorator NOT listed here stays skipped (frameworks consume decorated members reflectively). Dotted entries match the full decorator path (`ns.foo`) and bare entries match the leftmost segment (so `\"decorators\"` collapses every `@decorators.*`); both `\"@step\"` and `\"step\"` are accepted (leading `@` stripped), and an unmatched entry emits a one-time warning.",
90
103
  "type": "array",
91
104
  "items": {
92
105
  "type": "string"
93
106
  }
94
107
  },
95
108
  "usedClassMembers": {
109
+ "description": "A list of class-member names or glob patterns treated as framework-used, so a method a library invokes reflectively (ag-Grid `agInit`/`refresh`, Web Component `connectedCallback`) is not reported as `unused-class-member`; it applies to class members only, not enum members. Each entry is either a plain string/glob (`\"agInit\"`, `\"enter*\"`, `\"*\"`) applied to every class, or a scoped object `{ extends?, implements?, members: [...] }` that applies only when the class matches that heritage clause (a scoped rule requires `extends` or `implements`); patterns matching zero members warn once.",
96
110
  "type": "array",
97
111
  "items": {
98
112
  "$ref": "#/$defs/UsedClassMemberRule"
@@ -100,6 +114,7 @@
100
114
  "default": []
101
115
  },
102
116
  "duplicates": {
117
+ "description": "Configures clone detection: `enabled` (default true), `mode` (`strict`, `mild` default, `weak`, `semantic`, from least to most identifier/literal blinding; `strict` and `mild` are equivalent under fallow's AST tokenizer, `weak` blinds string literals, `semantic` blinds all identifiers and literals for Type-2 renamed-variable detection), `minTokens` (50), `minLines` (5), `minOccurrences` (integer >= 2, deserialization fails below 2), `threshold` (max duplication percentage, 0 = no limit), `ignore` globs, `ignoreDefaults` (true, merge built-in generated-file ignores), `skipLocal` (only report cross-directory clones), `crossLanguage` (strip TS type annotations to match .ts against .js), `ignoreImports` (true, strip ES import/re-export/top-level require wiring from the token stream), and `normalization` (per-flag `ignoreIdentifiers`/`ignoreStringValues`/`ignoreNumericValues` overrides on top of `mode`). Raise `minOccurrences` to focus on widespread copy-paste, or set `mode` to `semantic` to catch renamed-variable clones.",
103
118
  "$ref": "#/$defs/DuplicatesConfig",
104
119
  "default": {
105
120
  "enabled": true,
@@ -119,12 +134,14 @@
119
134
  }
120
135
  },
121
136
  "health": {
137
+ "description": "Sets complexity and health thresholds for `fallow health` (also applied in combined `fallow` and `fallow audit`): `maxCyclomatic` (20), `maxCognitive` (15), `maxCrap` (30.0, findings at or above this are reported), `crapRefactorBand` (5, cyclomatic band below `maxCyclomatic` where a secondary refactor action is added), `maxUnitSize` (max function lines before a large-function finding, 60), `coverage`/`coverageRoot` (Istanbul coverage path and path-prefix strip for accurate CRAP), `ignore` globs (remove files from findings AND the health score), `thresholdOverrides` (per-file/per-function ceilings via `files`/`functions`/`maxCyclomatic`/`maxCognitive`/`maxCrap`/`maxUnitSize`/`reason`), `ownership` (`botPatterns` and `emailMode` for `--ownership`), and `suggestInlineSuppression` (true, emit `suppress-line` action hints in JSON). Raise thresholds to relax which functions are flagged, wire `coverage` for real CRAP scores, or exempt generated/test files via `ignore` (drops them from the score too) or `thresholdOverrides` (keeps them visible under a higher ceiling).",
122
138
  "$ref": "#/$defs/HealthConfig",
123
139
  "default": {
124
140
  "maxCyclomatic": 20,
125
141
  "maxCognitive": 15,
126
142
  "maxCrap": 30.0,
127
143
  "crapRefactorBand": 5,
144
+ "maxUnitSize": 60,
128
145
  "coverage": null,
129
146
  "coverageRoot": null,
130
147
  "ignore": [],
@@ -143,6 +160,7 @@
143
160
  }
144
161
  },
145
162
  "rules": {
163
+ "description": "Sets per-issue-type severity, keyed by kebab-case rule id: `error` reports and fails CI (non-zero exit), `warn` reports without failing, `off` disables detection and reporting entirely (e.g. `{ \"unused-files\": \"error\", \"unused-exports\": \"warn\", \"private-type-leaks\": \"off\" }`). Set a rule `off` to silence it, `warn` to demote below CI gating, or `error` to promote a warn/off-default rule to gating; most rules default to `error`, dev/optional-dependency and component/store/inject/CSS/catalog rules default to `warn`, and opt-in rules (`private-type-leaks`, `security-*`, `prop-drilling`, `thin-wrapper`, `duplicate-prop-shape`, `coverage-gaps`, `feature-flags`, `require-suppression-reason`) default to `off`. Singular aliases (`unused-file`) and `warning`/`none` severity spellings are accepted.",
146
164
  "$ref": "#/$defs/RulesConfig",
147
165
  "default": {
148
166
  "unused-files": "error",
@@ -201,9 +219,11 @@
201
219
  }
202
220
  },
203
221
  "unusedComponentProps": {
222
+ "description": "Options for the `unused-component-props` rule, currently only `ignorePattern`: a regex matched against each declared prop's local destructure binding name (falling back to the public prop name when unaliased) to exempt intentionally-unused props such as the leading-underscore convention. Set `{ \"ignorePattern\": \"^_\" }` to skip props like `_stage`; matching is unanchored (substring, like ESLint's `RegExp.test`) so anchor with `^`, the pattern is validated at config load (invalid regex fails load), and it applies to Vue, Svelte, Astro, and React/Preact props (unset leaves the rule unchanged).",
204
223
  "$ref": "#/$defs/UnusedComponentPropsConfig"
205
224
  },
206
225
  "boundaries": {
226
+ "description": "Configures architecture boundary enforcement: which source directories belong to which named zone and which zones may import which others, reported as boundary-violation, boundary-coverage-violation, and boundary-call-violation findings (severity via rules.boundary-violation, default error). Set to enforce a layered/module architecture; the object holds `preset` (one of layered, hexagonal, feature-sliced, bulletproof, whose default zones/rules are merged in with the user-declared zones/rules taking precedence), `zones` (each with `name`, `patterns`, `autoDiscover`, optional `root`), `rules` (each with `from`, `allow`, `allowTypeOnly` target-zone lists), `coverage` (`requireAllFiles` plus `allowUnmatched` globs for files matching no zone), and `calls` (a `forbidden` list of `{from, callee}` banned-call rules per zone).",
207
227
  "$ref": "#/$defs/BoundaryConfig",
208
228
  "default": {
209
229
  "zones": [],
@@ -211,16 +231,19 @@
211
231
  }
212
232
  },
213
233
  "flags": {
234
+ "description": "Configures feature-flag detection: `sdkPatterns` (custom flag-evaluating call signatures, each `{ function, nameArg (zero-based arg index of the flag name, default 0), provider? }`, merged with built-ins for LaunchDarkly, Statsig, Unleash, GrowthBook, Split, PostHog, Vercel Flags, ConfigCat, Flagsmith, Optimizely, and Eppo), `envPrefixes` (env-var prefixes marking `process.env.*` accesses as flags, merged with built-ins), and `configObjectHeuristics` (default false; when true, property accesses on objects whose name contains `feature`/`flag`/`toggle` are reported as low-confidence flags). Set `sdkPatterns`/`envPrefixes` to teach fallow a proprietary flag SDK or naming convention, or enable `configObjectHeuristics` for projects that read flags off config objects (higher false-positive rate). Feature-flag findings surface only when the `feature-flags` rule is enabled (default `off`).",
214
235
  "$ref": "#/$defs/FlagsConfig",
215
236
  "default": {
216
237
  "configObjectHeuristics": false
217
238
  }
218
239
  },
219
240
  "security": {
241
+ "description": "Scopes the opt-in `fallow security` catalogue: which candidate categories run and which extra local identifiers count as HTTP request objects. Set when tuning security-candidate detection; the object holds `categories` (an object with `include` and/or `exclude` string arrays of catalogue category ids, where `include` restricts to a whitelist and `exclude` removes from the admitted set, both unset admits all ordinary categories) and `requestReceivers` (a string array of project-local names that extend, not replace, the built-in `*.query`/`*.params`/`*.body` source-receiver allowlist). The `hardcoded-secret` and `secret-to-network` categories are include-required: they fire only when explicitly listed in `categories.include`, even when no include list is otherwise set. The valid category ids are enumerated (with title, CWE, and include-required flag) in the `security_categories` block of `fallow schema`, and also listed by `fallow security --help`; they are not in this config-schema.",
220
242
  "$ref": "#/$defs/SecurityConfig",
221
243
  "default": {}
222
244
  },
223
245
  "fix": {
246
+ "description": "Configures `fallow fix` behavior. Currently holds one nested section, `catalog` (a `CatalogFixConfig`), whose only key `deletePrecedingComments` (`auto` default, `always`, `never`) governs whether comment lines directly above a removed unused `pnpm-workspace.yaml` catalog entry are deleted with it.",
224
247
  "$ref": "#/$defs/FixConfig",
225
248
  "default": {
226
249
  "catalog": {
@@ -229,14 +252,17 @@
229
252
  }
230
253
  },
231
254
  "resolve": {
255
+ "description": "Configures the module resolver. Its one key `conditions` is a list of additional package.json `exports`/`imports` condition names to honor, matched at higher priority than fallow's built-ins (`development`, `import`, `require`, `default`, `types`, `node`, plus `react-native`/`browser` when the React Native or Expo plugin is active). Set it when a package's `exports` map has custom branches (e.g. `worker`, `deno`, `edge`) that fallow should follow instead of the default branch.",
232
256
  "$ref": "#/$defs/ResolveConfig",
233
257
  "default": {}
234
258
  },
235
259
  "production": {
260
+ "description": "Enables production mode, which excludes test/spec/story/dev files from discovery and forces `unused-dev-dependencies` and `unused-optional-dependencies` to `off`. Accepts a boolean (default false) applied to all analyses, or a per-analysis object `{ deadCode?, health?, dupes? }` (each boolean, default false) that scopes production mode to individual analyses in combined `fallow` and `fallow audit`. Set it to analyze only shipped code; the `--production`/`--no-production` and `--production-{dead-code,health,dupes}` CLI flags and `FALLOW_PRODUCTION*` env vars override this value (CLI flags win, then per-analysis env, then global env, then config).",
236
261
  "$ref": "#/$defs/ProductionConfig",
237
262
  "default": false
238
263
  },
239
264
  "plugins": {
265
+ "description": "List of paths (relative to the project root, must resolve within it) to external plugin definition files or directories in JSONC/JSON/TOML, loaded in addition to the auto-discovered `.fallow/plugins/` directory and root `fallow-plugin-*` files. Set it to load plugin definitions kept outside those default locations; a path resolving outside the project root is skipped with a `tracing::warn`, and paths listed here are searched before the auto-discovered locations (first occurrence of a plugin name wins).",
240
266
  "type": "array",
241
267
  "items": {
242
268
  "type": "string"
@@ -251,6 +277,7 @@
251
277
  }
252
278
  },
253
279
  "dynamicallyLoaded": {
280
+ "description": "An array of project-root-relative glob patterns for files loaded at runtime by a mechanism the static graph cannot see (dynamic path resolution, config-driven loading); matching files are seeded as entry points so they and their imports stay reachable. Empty by default; set it (e.g. `[\"plugins/**/*.ts\", \"locales/**/*.json\"]`) for plugin or locale trees pulled in dynamically.",
254
281
  "type": "array",
255
282
  "items": {
256
283
  "type": "string"
@@ -258,6 +285,7 @@
258
285
  "default": []
259
286
  },
260
287
  "overrides": {
288
+ "description": "An ordered list of per-file rule-severity overrides: each entry re-severities specific analysis rules for files its globs match, layered on top of the top-level `rules` defaults. Set to relax or tighten rules for a subset of paths (e.g. downgrade unused-exports to warn under a generated directory); each entry has `files` (glob-pattern array) and `rules` (a partial per-rule severity map of error/warn/off). Entries apply in list order and a file matched by several entries takes every matching entry's overrides (later entries win on conflict); inter-file rules (duplicate-exports, circular-dependencies, re-export-cycle) have no effect in an override (fallow warns during analysis and points to the right mechanism: top-level `ignoreExports` for duplicate-exports, a file-level `// fallow-ignore-file` comment for the others).",
261
289
  "type": "array",
262
290
  "items": {
263
291
  "$ref": "#/$defs/ConfigOverride"
@@ -265,12 +293,14 @@
265
293
  "default": []
266
294
  },
267
295
  "codeowners": {
296
+ "description": "A project-root-relative path to a CODEOWNERS file, used by fallow health --hotspots --ownership to attribute declared owners and compute unowned/drifting ownership state; setting it overrides the default probe order (CODEOWNERS, .github/CODEOWNERS, .gitlab/CODEOWNERS, docs/CODEOWNERS). String, defaults to null (auto-probe the standard locations); set it only when the CODEOWNERS file lives at a non-standard location.",
268
297
  "type": [
269
298
  "string",
270
299
  "null"
271
300
  ]
272
301
  },
273
302
  "publicPackages": {
303
+ "description": "An array of internal workspace package names (or globs matched against workspace package names) whose public API is intentionally consumed outside the analyzed graph; their entry points and re-export surface become reachability roots, so their exported files, exports, and class members are not reported as unused. Set it (e.g. `[\"@myorg/shared-lib\", \"@myorg/*\"]`) for library packages in a monorepo that ship an API to external consumers; only meaningful when workspaces are present (an empty list or no workspaces is a no-op).",
274
304
  "type": "array",
275
305
  "items": {
276
306
  "type": "string"
@@ -278,6 +308,7 @@
278
308
  "default": []
279
309
  },
280
310
  "regression": {
311
+ "description": "Holds a saved issue-count baseline that the `--fail-on-regression` gate compares the current run against, failing only when counts grow beyond tolerance relative to the baseline. Usually written by `--save-baseline` rather than hand-authored; the object has a single `baseline` sub-key holding per-issue-type counts (total_issues plus per-kind fields like unused_exports, boundary_violations, policy_violations, each defaulting to 0). Absent means no baseline is embedded in config.",
281
312
  "anyOf": [
282
313
  {
283
314
  "$ref": "#/$defs/RegressionConfig"
@@ -288,21 +319,26 @@
288
319
  ]
289
320
  },
290
321
  "audit": {
322
+ "description": "Sets in-repo defaults for `fallow audit` (the changed-files quality gate) so CLI flags need not repeat per run. Set to pin audit behavior; the object holds `gate` (`new-only` or `all`, which findings drive the verdict), `css`/`cssDeep` (booleans toggling styling analysis and the project-wide CSS reachability pass), `deadCodeBaseline`/`healthBaseline`/`dupesBaseline` (per-sub-analysis baseline file paths), and `cacheMaxAgeDays` (GC window in days for the reusable base-snapshot worktree cache). The matching CLI flag overrides each field.",
291
323
  "$ref": "#/$defs/AuditConfig"
292
324
  },
293
325
  "sealed": {
326
+ "description": "When true, restricts this config's extends entries to file-relative paths that resolve inside the config file's own directory; any https:// URL, npm: package, or relative path escaping that directory is rejected at load with a hard error. Boolean, defaults to false (URL, npm, and any-relative extends are permitted); set it to true to harden a config against pulling in remote or out-of-tree bases.",
294
327
  "type": "boolean",
295
328
  "default": false
296
329
  },
297
330
  "includeEntryExports": {
331
+ "description": "When true, exports of entry-point files are subject to unused-export detection instead of being auto-credited as used, so a typo'd or stray export in a framework route or package entry (e.g. meatdata for metadata) is flagged; plugin used_exports allowlists are still honored. Boolean, defaults to false; the CLI flag --include-entry-exports applies the same behavior for one run.",
298
332
  "type": "boolean",
299
333
  "default": false
300
334
  },
301
335
  "autoImports": {
336
+ "description": "When true, drops Nuxt convention-based entry-pattern fallbacks: component fallbacks are dropped unless nuxt.config declares components:, and composable/util fallbacks are dropped unless it declares imports:, so genuinely-unreferenced convention files surface as unused-file. Boolean, defaults to false; set it for a Nuxt project that has explicitly configured its auto-import directories. Synthesis of auto-import graph edges (resolving `<Card />` or `useUserStore()` to their convention files) happens regardless of this flag.",
302
337
  "type": "boolean",
303
338
  "default": false
304
339
  },
305
340
  "cache": {
341
+ "description": "Overrides the location and size ceiling of fallow's persistent extraction cache (default `.fallow/cache.bin` under the project root). Set to relocate the cache or cap its footprint; the object holds `dir` (cache directory, relative paths resolve from the project root) and `maxSizeMb` (extraction-cache size limit in megabytes). The `FALLOW_CACHE_MAX_SIZE` environment variable overrides `maxSizeMb`.",
306
342
  "$ref": "#/$defs/CacheConfig"
307
343
  }
308
344
  },
@@ -349,6 +385,14 @@
349
385
  "$ref": "#/$defs/EntryPointRole",
350
386
  "default": "support"
351
387
  },
388
+ "manifestEntries": {
389
+ "description": "Entry points DERIVED from framework manifest files.\n\nUnlike `entryPoints` (static globs), each rule finds manifest files by a\nrecursive glob, parses them, and seeds sibling entries resolved relative\nto each manifest's directory, gated on the manifest's own fields. Seeded\nentries use this plugin's `entryPointRole`.",
390
+ "type": "array",
391
+ "items": {
392
+ "$ref": "#/$defs/ManifestEntryRule"
393
+ },
394
+ "default": []
395
+ },
352
396
  "configPatterns": {
353
397
  "description": "Glob patterns for config files (marked as always-used when active).",
354
398
  "type": "array",
@@ -493,6 +537,72 @@
493
537
  }
494
538
  ]
495
539
  },
540
+ "ManifestEntryRule": {
541
+ "description": "A rule that seeds entry points DERIVED from framework manifest files.\n\nFor every file matching `manifests` (a recursive glob) that passes the\nmanifest-level `when` gate, each rule in `entries` is resolved relative to\nthe manifest's directory (with `${dotted.field}` interpolation) into an entry\npoint. Seeded entries use the owning plugin's `entryPointRole`.\n\n```jsonc\n{\n \"manifests\": \"**/kibana.jsonc\",\n \"when\": { \"type\": \"plugin\" },\n \"entries\": [\n { \"path\": \"public/index.{ts,tsx}\", \"when\": { \"plugin.browser\": true } },\n { \"path\": \"server/index.{ts,tsx}\", \"when\": { \"plugin.server\": true } },\n { \"path\": \"${plugin.extraPublicDirs}/index.{ts,tsx}\" }\n ]\n}\n```",
542
+ "type": "object",
543
+ "properties": {
544
+ "manifests": {
545
+ "description": "Recursive glob selecting the manifest files to read (e.g. `**/kibana.jsonc`).",
546
+ "type": "string"
547
+ },
548
+ "format": {
549
+ "description": "Manifest format. Defaults to `jsonc` (which also parses plain JSON).",
550
+ "$ref": "#/$defs/ManifestFormat",
551
+ "default": "jsonc"
552
+ },
553
+ "when": {
554
+ "description": "Manifest-level gate: a map of dotted field path to an expected scalar\nvalue. ALL entries must match by STRICT EQUALITY for the manifest to be\nprocessed. An empty map matches every manifest.",
555
+ "type": "object",
556
+ "additionalProperties": true,
557
+ "default": {}
558
+ },
559
+ "entries": {
560
+ "description": "Entry rules seeded per matching manifest.",
561
+ "type": "array",
562
+ "items": {
563
+ "$ref": "#/$defs/ManifestSeedRule"
564
+ }
565
+ }
566
+ },
567
+ "required": [
568
+ "manifests",
569
+ "entries"
570
+ ]
571
+ },
572
+ "ManifestFormat": {
573
+ "description": "Format of the manifest files a [`ManifestEntryRule`] reads.\n\n`jsonc` (the default) also parses plain JSON, so it is the tolerant choice.",
574
+ "oneOf": [
575
+ {
576
+ "description": "JSONC (comments + trailing commas). Also accepts plain JSON.",
577
+ "type": "string",
578
+ "const": "jsonc"
579
+ },
580
+ {
581
+ "description": "Strict JSON.",
582
+ "type": "string",
583
+ "const": "json"
584
+ }
585
+ ]
586
+ },
587
+ "ManifestSeedRule": {
588
+ "description": "A single entry seeded by a [`ManifestEntryRule`], resolved relative to the\nmanifest's directory.",
589
+ "type": "object",
590
+ "properties": {
591
+ "path": {
592
+ "description": "Entry glob relative to the manifest directory. May contain\n`${dotted.field}` interpolation that fans out over string / array\nmanifest field values (a missing or empty field seeds nothing). The glob\nmust encode its own extension (e.g. `public/index.{ts,tsx}`); glob entry\npatterns are matched literally against discovered files without\nsource-extension probing.",
593
+ "type": "string"
594
+ },
595
+ "when": {
596
+ "description": "Per-entry gate (strict equality), evaluated against the same manifest.\nAn empty map always passes.",
597
+ "type": "object",
598
+ "additionalProperties": true,
599
+ "default": {}
600
+ }
601
+ },
602
+ "required": [
603
+ "path"
604
+ ]
605
+ },
496
606
  "ExternalUsedExport": {
497
607
  "description": "Exports considered used for files matching a pattern.",
498
608
  "type": "object",
@@ -563,7 +673,7 @@
563
673
  "type": "object",
564
674
  "properties": {
565
675
  "patterns": {
566
- "description": "Additional workspace patterns (beyond what's in root package.json).",
676
+ "description": "Additional workspace patterns (beyond what's in root package.json).\n\n`packages` is accepted as a back-compat alias: an older `fallow init --toml`\nwrote `[workspaces]` with a `packages` key, and reading it as `patterns`\nkeeps those existing configs scoping correctly. schemars omits serde\naliases, so `schema.json` documents only `patterns`.",
567
677
  "type": "array",
568
678
  "items": {
569
679
  "type": "string"
@@ -598,15 +708,18 @@
598
708
  "type": "object",
599
709
  "properties": {
600
710
  "package": {
711
+ "description": "Required exact package name whose `unresolved-catalog-reference` finding this rule suppresses; compared by string equality against the referenced package, so one rule targets one package's catalog reference (further narrowed by the optional `catalog` and `consumer` filters, all of which must match).",
601
712
  "type": "string"
602
713
  },
603
714
  "catalog": {
715
+ "description": "Optional catalog-name filter: when set, the rule suppresses only references to this exact catalog name (string equality), and when omitted it applies regardless of which catalog is referenced. Use it to scope suppression to one catalog (e.g. `\"react18\"`) while leaving other catalog references for the same package reportable.",
604
716
  "type": [
605
717
  "string",
606
718
  "null"
607
719
  ]
608
720
  },
609
721
  "consumer": {
722
+ "description": "Optional glob matched against the consuming workspace `package.json` path (compiled into a glob matcher at config load): when set, the rule suppresses the finding only for consumers whose path matches, and when omitted it applies to every consumer. Use it to suppress a catalog reference in one specific workspace during a staged migration.",
610
723
  "type": [
611
724
  "string",
612
725
  "null"
@@ -623,9 +736,11 @@
623
736
  "type": "object",
624
737
  "properties": {
625
738
  "package": {
739
+ "description": "Required exact package name whose `unused-dependency-override` or `misconfigured-dependency-override` finding this rule suppresses; compared by string equality against the override's target package, so one rule targets one override entry (further narrowable with the optional `source` filter).",
626
740
  "type": "string"
627
741
  },
628
742
  "source": {
743
+ "description": "Optional source filter matched by exact string equality against the override's declaring-file label: set it to `\"pnpm-workspace.yaml\"` or `\"package.json\"` to scope the suppression to overrides declared in that file, or omit it to suppress the package's override regardless of where it is declared.",
629
744
  "type": [
630
745
  "string",
631
746
  "null"
@@ -651,10 +766,12 @@
651
766
  "type": "object",
652
767
  "properties": {
653
768
  "type": {
769
+ "description": "When `true`, enables the same-file-use suppression for type-only exports (serialized as `type`; part of the object form of `ignoreExportsUsedInFile`). Because fallow groups type aliases and interfaces under one issue kind, setting either `type` or `interface` enables the identical type-only suppression, applied only to exports fallow classifies as type-only.",
654
770
  "type": "boolean",
655
771
  "default": false
656
772
  },
657
773
  "interface": {
774
+ "description": "When `true`, enables the same-file-use suppression for type-only exports (part of the object form of `ignoreExportsUsedInFile`). Fallow does not distinguish interfaces from type aliases in this issue kind, so `interface` behaves identically to `type`: setting either one turns on the type-only same-file suppression.",
658
775
  "type": "boolean",
659
776
  "default": false
660
777
  }
@@ -836,6 +953,13 @@
836
953
  "maximum": 65535,
837
954
  "default": 5
838
955
  },
956
+ "maxUnitSize": {
957
+ "description": "Maximum function length in lines of code before it is reported as an\noversized \"large function\" (default: 60). Raise it globally, or per file\nvia `thresholdOverrides[].maxUnitSize`, to relax the bar for generated or\ntest files (where a `describe()` block spans hundreds of lines) without\ndisabling complexity checks on those files. This filters the reported\nlarge-functions list only; the descriptive unit-size profile and the\nhealth score still reflect raw sizes (use `health.ignore` to remove a\nfile from the score entirely).",
958
+ "type": "integer",
959
+ "format": "uint32",
960
+ "minimum": 0,
961
+ "default": 60
962
+ },
839
963
  "coverage": {
840
964
  "description": "Path to Istanbul-format coverage data for accurate per-function CRAP\nscores. Relative paths resolve against the project root. The CLI\n`--coverage` flag and `FALLOW_COVERAGE` environment variable override\nthis value.",
841
965
  "type": [
@@ -936,6 +1060,15 @@
936
1060
  ],
937
1061
  "format": "double"
938
1062
  },
1063
+ "maxUnitSize": {
1064
+ "description": "Local unit-size ceiling: maximum function length in lines of code before\nit is reported as an oversized \"large function\". Leave `functions` empty\nto relax the bar for every function in the matching files (which covers\nboth the `describe()` wrapper and the individual `it()` blocks in a test\nsuite).",
1065
+ "type": [
1066
+ "integer",
1067
+ "null"
1068
+ ],
1069
+ "format": "uint32",
1070
+ "minimum": 0
1071
+ },
939
1072
  "reason": {
940
1073
  "description": "Human-readable rationale for the exception.",
941
1074
  "type": [
@@ -1579,6 +1712,7 @@
1579
1712
  "type": "object",
1580
1713
  "properties": {
1581
1714
  "catalog": {
1715
+ "description": "Groups `fallow fix` settings for pnpm workspace catalog cleanup. Its only key, `deletePrecedingComments` (`auto` default, `always`, `never`), controls whether a comment block directly above a removed unused `pnpm-workspace.yaml` catalog entry is deleted with the entry.",
1582
1716
  "$ref": "#/$defs/CatalogFixConfig",
1583
1717
  "default": {
1584
1718
  "deletePrecedingComments": "auto"
@@ -1590,6 +1724,7 @@
1590
1724
  "type": "object",
1591
1725
  "properties": {
1592
1726
  "deletePrecedingComments": {
1727
+ "description": "Controls whether comment lines immediately above an unused `pnpm-workspace.yaml` catalog entry are removed when `fallow fix` deletes that entry: `auto` (default: delete only when the comment block is preceded by a blank line or sits directly under the parent catalog header, and never when it is a section banner like `# ====`), `always` (always remove the adjacent comment block), or `never` (leave all preceding comments). A `fallow-keep` marker anywhere in the block always preserves it regardless of this setting. Set `never` for teams that keep hand-authored notes above catalog pins.",
1593
1728
  "$ref": "#/$defs/CatalogPrecedingCommentPolicy",
1594
1729
  "default": "auto"
1595
1730
  }
@@ -1630,14 +1765,17 @@
1630
1765
  "type": "object",
1631
1766
  "properties": {
1632
1767
  "deadCode": {
1768
+ "description": "When `production` is a per-analysis object, enables production mode for dead-code analysis only (boolean, default false): unused-files/exports/dependencies detection excludes test/spec/story/dev files and forces `unused-dev-dependencies`/`unused-optional-dependencies` to `off`, while health and dupes stay on the full tree. Set it to scope production analysis to dead code independently.",
1633
1769
  "type": "boolean",
1634
1770
  "default": false
1635
1771
  },
1636
1772
  "health": {
1773
+ "description": "When `production` is a per-analysis object, enables production mode for the health/complexity analysis only (boolean, default false), so `fallow health` in combined `fallow` and `fallow audit` scores only shipped code (test/spec/story/dev files excluded) while dead-code and dupes stay on the full tree. Set it to scope production analysis to health independently.",
1637
1774
  "type": "boolean",
1638
1775
  "default": false
1639
1776
  },
1640
1777
  "dupes": {
1778
+ "description": "When `production` is a per-analysis object, enables production mode for duplication analysis only (boolean, default false), so clone detection runs on shipped code only (test/spec/story/dev files excluded) while dead-code and health stay on the full tree. Set it to scope production analysis to dupes independently.",
1641
1779
  "type": "boolean",
1642
1780
  "default": false
1643
1781
  }
@@ -1649,12 +1787,14 @@
1649
1787
  "type": "object",
1650
1788
  "properties": {
1651
1789
  "files": {
1790
+ "description": "Glob-pattern string array selecting which source files this override entry applies to (patterns are validated and compiled to matchers at config load). Set to scope the entry's rule severities to a subset of paths (e.g. `[\"src/generated/**\", \"**/*.test.ts\"]`); when several override entries match one file, its severities come from every matching entry, applied in list order (later entries win on conflict).",
1652
1791
  "type": "array",
1653
1792
  "items": {
1654
1793
  "type": "string"
1655
1794
  }
1656
1795
  },
1657
1796
  "rules": {
1797
+ "description": "Partial per-rule severity map applied only to files matching this entry's `files` globs; each rule key takes `error`, `warn`, or `off`, and omitted rules keep their top-level severity. Set to change how specific rules (e.g. unused-exports, unused-files) behave for the scoped paths. Inter-file rules (duplicate-exports, circular-dependencies, re-export-cycle) have no effect in an override; fallow warns during analysis and names the right mechanism instead (top-level `ignoreExports` for duplicate-exports, a file-level `// fallow-ignore-file` comment for circular-dependencies and re-export-cycle).",
1658
1798
  "$ref": "#/$defs/PartialRulesConfig",
1659
1799
  "default": {}
1660
1800
  }
@@ -2203,6 +2343,7 @@
2203
2343
  "type": "object",
2204
2344
  "properties": {
2205
2345
  "baseline": {
2346
+ "description": "The saved per-issue-type issue counts that `--fail-on-regression` compares the current run against; the gate fails only when counts grow beyond the configured tolerance. Typically written by `--save-baseline` rather than hand-authored; each field (total_issues plus per-kind counts like unused_exports, boundary_violations, policy_violations) is an integer defaulting to 0 when omitted. Absent means no baseline is embedded.",
2206
2347
  "anyOf": [
2207
2348
  {
2208
2349
  "$ref": "#/$defs/RegressionBaseline"
@@ -2349,39 +2490,46 @@
2349
2490
  "type": "object",
2350
2491
  "properties": {
2351
2492
  "gate": {
2493
+ "description": "Selects which findings affect the `fallow audit` verdict: `new-only` (default) fails only on findings introduced by the current changeset (running a base-snapshot attribution pass), while `all` fails on every finding in changed files and skips that pass. Set to `all` to gate the full backlog in changed files; the `--gate` CLI flag overrides this.",
2352
2494
  "$ref": "#/$defs/AuditGate"
2353
2495
  },
2354
2496
  "css": {
2497
+ "description": "Toggles styling analytics (CSS and CSS-in-JS) in the `fallow audit` health sub-pass; these findings are descriptive and verdict-neutral by default (they change the exit code only when a css-* rule is set to error). Defaults to on when unset; set `false` to skip styling analysis. The `--no-css` CLI flag forces it off regardless.",
2355
2498
  "type": [
2356
2499
  "boolean",
2357
2500
  "null"
2358
2501
  ]
2359
2502
  },
2360
2503
  "cssDeep": {
2504
+ "description": "Toggles the project-wide CSS reachability pass in `fallow audit`, whose cross-file findings are narrowed back to changed anchors. Defaults to on when unset and runs only when css analytics are enabled; set `false` to keep local styling analytics but skip the whole-project scan. The `--css-deep` flag re-enables it and `--no-css-deep` forces it off.",
2361
2505
  "type": [
2362
2506
  "boolean",
2363
2507
  "null"
2364
2508
  ]
2365
2509
  },
2366
2510
  "deadCodeBaseline": {
2511
+ "description": "Path to a saved dead-code baseline file (produced by `fallow dead-code --save-baseline`) that the audit's dead-code sub-analysis compares against, suppressing pre-existing dead-code issues. The `--dead-code-baseline` CLI flag overrides it and both resolve relative to the project root; each sub-analysis uses a distinct baseline format, so this is separate from `healthBaseline` and `dupesBaseline`.",
2367
2512
  "type": [
2368
2513
  "string",
2369
2514
  "null"
2370
2515
  ]
2371
2516
  },
2372
2517
  "healthBaseline": {
2518
+ "description": "Path to a saved health/complexity baseline file (produced by `fallow health --save-baseline`) that the audit's health sub-analysis compares against, suppressing pre-existing complexity/health findings. The `--health-baseline` CLI flag overrides it and both resolve relative to the project root; its baseline format is distinct from the dead-code and dupes baselines.",
2373
2519
  "type": [
2374
2520
  "string",
2375
2521
  "null"
2376
2522
  ]
2377
2523
  },
2378
2524
  "dupesBaseline": {
2525
+ "description": "Path to a saved duplication baseline file (produced by `fallow dupes --save-baseline`) that the audit's duplication sub-analysis compares clone groups against, suppressing pre-existing duplicate clones. The `--dupes-baseline` CLI flag overrides it and both resolve relative to the project root; its baseline format is distinct from the dead-code and health baselines.",
2379
2526
  "type": [
2380
2527
  "string",
2381
2528
  "null"
2382
2529
  ]
2383
2530
  },
2384
2531
  "cacheMaxAgeDays": {
2532
+ "description": "Garbage-collection threshold, in whole days, for the persistent reusable base-snapshot worktree caches `fallow audit` creates: entries older than this window are swept on each audit run. Set to control cache accumulation; `0` disables the sweep and unset defaults to 30 days. The `FALLOW_AUDIT_CACHE_MAX_AGE_DAYS` environment variable overrides this field.",
2385
2533
  "type": [
2386
2534
  "integer",
2387
2535
  "null"
@@ -13,7 +13,7 @@ function getPlatformPackage(platform, arch, libcFamily) {
13
13
  }
14
14
 
15
15
  if (platform === "linux") {
16
- const libc = libcFamily === "musl" ? "musl" : "gnu";
16
+ const libc = libcFamily === "glibc" ? "gnu" : "musl";
17
17
  if (arch === "x64" || arch === "arm64") {
18
18
  return `@fallow-cli/linux-${arch}-${libc}`;
19
19
  }
@@ -9,9 +9,9 @@ test("maps Windows x64 and arm64 to MSVC packages", () => {
9
9
  });
10
10
 
11
11
  test("maps Linux packages with libc awareness", () => {
12
- assert.equal(getPlatformPackage("linux", "x64", "gnu"), "@fallow-cli/linux-x64-gnu");
13
- assert.equal(getPlatformPackage("linux", "arm64", "musl"), "@fallow-cli/linux-arm64-musl");
14
- assert.equal(getPlatformPackage("linux", "arm64"), "@fallow-cli/linux-arm64-gnu");
12
+ assert.equal(getPlatformPackage("linux", "x64", "glibc"), "@fallow-cli/linux-x64-gnu");
13
+ assert.equal(getPlatformPackage("linux", "x64", "musl"), "@fallow-cli/linux-x64-musl");
14
+ assert.equal(getPlatformPackage("linux", "x64", null), "@fallow-cli/linux-x64-musl");
15
15
  });
16
16
 
17
17
  test("maps macOS packages by architecture", () => {
@@ -11,6 +11,7 @@
11
11
  const { execFileSync } = require("node:child_process");
12
12
  const path = require("node:path");
13
13
  const fs = require("node:fs");
14
+ const os = require("node:os");
14
15
 
15
16
  const { getPlatformPackage } = require("./platform-package");
16
17
  const { ensureVerified } = require("./lazy-verify");
@@ -107,6 +108,15 @@ function writeVerifiedLineIfVersionQuery(verifyResult, version) {
107
108
  }
108
109
  }
109
110
 
111
+ // Exit code for a child failure caught from execFileSync. A signal death has
112
+ // status === null; map it to the shell convention 128 + signal number so CI
113
+ // gates see a crash, never a success.
114
+ function exitCodeForChildFailure(e) {
115
+ if (e.status !== null) return e.status;
116
+ const signalNumber = os.constants.signals[e.signal];
117
+ return signalNumber ? 128 + signalNumber : 1;
118
+ }
119
+
110
120
  // Read the resolved CLI version from the platform package manifest (its version
111
121
  // is released in lockstep with the CLI). Best-effort: never throws, so a
112
122
  // missing/garbled manifest just omits the signing annotation on --version.
@@ -159,10 +169,13 @@ function runBinary(binaryBaseName) {
159
169
  execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
160
170
  } catch (e) {
161
171
  if (e.status === undefined) throw e;
172
+ if (e.status === null) {
173
+ process.stderr.write(`fallow binary terminated by signal ${e.signal ?? "unknown"}\n`);
174
+ }
162
175
  // Child has already written its --version line via inherited stdio;
163
176
  // append the verified line here only on a clean exit.
164
177
  if (e.status === 0) writeVerifiedLineIfVersionQuery(verifyResult, resolvedVersion);
165
- process.exit(e.status);
178
+ process.exit(exitCodeForChildFailure(e));
166
179
  }
167
180
 
168
181
  writeVerifiedLineIfVersionQuery(verifyResult, resolvedVersion);
@@ -173,4 +186,5 @@ module.exports = {
173
186
  describeVerified, // test-only
174
187
  isVersionQuery, // test-only
175
188
  guardBrokenStdout, // test-only
189
+ exitCodeForChildFailure, // test-only
176
190
  };