Skip to content

v3.44.0: unused protected class members, exact allowed cycles, and range suppression of clones

Choose a tag to compare

@BartWaardenburg BartWaardenburg released this 19 Nov 09:13
· 51 commits to main since this release
Immutable release. Only release title and notes can be modified.
v3.44.0
2d55db7

Features

  • The new rule unused-protected-class-members reports protected class members that no code reads. The rule is off by default, so the default output does not change. A protected member is used when its class or a subclass reads it through this or super. When the base class calls a member, the subclass override of that member also counts as used. Fallow does not check classes of the public API of a package, because a user of the package can subclass them. Turn the rule on in rules, or select it with --unused-protected-class-members. Suppress one finding with // fallow-ignore-next-line unused-protected-class-member. The findings go to the new unused_protected_class_members JSON array, and also to SARIF, CodeClimate, the human report, the LSP and fallow explain. Known limits: a read through a string key gives no credit, and the rule does not check a constructor parameter property. Thanks @neumaennl for the report. (#4624)
  • circularDependencies.allow accepts exact cycles. Each entry lists the files of one cycle in import order, relative to the project root, for example [["src/a.ts", "src/b.ts"]]. An entry accepts only the cycle with exactly these files, from any start file. Fallow still reports a new cycle through the same imports. An inline fallow-ignore-next-line circular-dependency comment would hide that new cycle. Paths are case-sensitive, and an entry needs at least 2 files. An entry that matches no cycle gives a circular-dependencies-allow-unmatched diagnostic. An entry that the detector cannot check (more than 12 files) gives no diagnostic. When you add an entry, remove the fallow-ignore-next-line circular-dependency comment of that cycle, because it becomes a stale suppression. fallow migrate now translates the cycles.allow list of a migrated config. Thanks @cr101 for the report. (#4623)
  • fallow-ignore-start and fallow-ignore-end suppress one clone. Put // fallow-ignore-start code-duplication -- <reason> above a block and // fallow-ignore-end code-duplication below it. Fallow does not report a clone inside the range. Fallow cuts a clone that reaches into the range at the range border, and does not report a cut part below minTokens or minLines. A marker in a string or template literal does not count. The /* */, JSDoc and <!-- --> forms work too, each on its own line. Ranges support only code-duplication. fallow dupes and fallow audit list a marker with a problem in the new range_marker_problems array, and such a marker has no effect. Clone groups get a suppress-range action next to suppress-line. Thanks @neumaennl for the report. (#4706)
  • duplicates.normalization.consistentIdentifiers finds renamed copies without false matches. Use it together with ignoreIdentifiers. A clone then needs a one-to-one mapping between the names of its instances. For example, a = b + c matches x = y + z, but not x = x + x. When a token breaks the mapping, Fallow keeps each longest part of the clone that maps one-to-one and has minTokens or more tokens. The option is off by default, and no mode turns it on. fallow migrate now maps the ignoreIdentifiers and ignoreLiterals options of an imported duplication config. Thanks @neumaennl for the report. (#4626)
  • fallow audit can fail on a new clone group. The new rule introduced-clone-group (error, warn or off) sets how a clone group affects the audit verdict and exit code. The default is warn, so the verdict does not change for current configs. With error, a clone group that the change introduces fails the audit with exit code 1. With off, the group stays in the report but does not change the verdict. Under --gate new-only, an inherited clone group never gates. With overrides, Fallow resolves the rule for the file of each copy and uses the most severe result. fallow explain introduced-clone-group describes the rule. Thanks @cr101 for the report. (#4658)
  • A boundary zone can list its public entry files with publicFiles. Since 3.31.0, the boundary check judges a named or default import through a re-export chain by the file that declares the symbol. Thus each import through a single entry file such as src/modules/billing/index.ts gave a finding. Now a zone can set "publicFiles": ["src/modules/billing/index.ts"]. A file of another zone may then import only those files of the zone. A deep import that a rule allows gets a finding with reason: "internal_file" and public_files. On an autoDiscover zone, each glob is relative to each discovered folder. A project without publicFiles gets the same output as before. Thanks @robertrguerrero for the report. (#4760)
  • production.ignore drops paths from discovery in production mode only. The object form of production accepts ignore, an array of project-root-relative globs, for example "production": { "deadCode": true, "ignore": ["scripts/**"] }. A run in production mode excludes these paths, in addition to the built-in test, spec, story and dev patterns. The default run keeps them. The globs also apply when --production or a FALLOW_PRODUCTION* variable selects the mode. Thanks @cr101 for the report. (#4622)
  • Production mode reports a test pattern that drops a file that production code imports. A built-in production pattern such as **/test/** also matches production source, for example src/components/runner/test/Runner.vue. When a production file imports such a file, workspace_diagnostics[] gets one production-excluded-file-imported entry for each pattern. The entry has pattern, file_count and the first five files. The human output prints the same warning on stderr. The production patterns do not change. To analyze the file, move it out of the matched path, or run without production mode. (#4498)
  • client-server-leak now checks React Router Framework Mode apps. When the React Router plugin is active, route modules (root.tsx included) are client roots. Only the code that React Router keeps in the client build counts. Fallow does not follow an import or a process.env.X or import.meta.env.X read that only loader, action, middleware or headers use. In each package where the plugin is active, files named *.client.* or under a .client/ directory are client roots, and files named *.server.* or under a .server/ directory are server-only-import sinks. Such an app no longer gets the client-server-leak-no-client-roots diagnostic. Thanks @cr101 for the report. (#4582)
  • fallow type-aware setup installs the type-aware companion for a binary that did not come from npm. A Homebrew, cargo install or release-archive binary on macOS or Linux now gets the companion with one command. The command downloads the bundle of its own version from the GitHub release. It checks the signature with the release key in the binary before it unpacks. --from <file> installs a copied bundle on a machine with no route to GitHub. The download honors HTTPS_PROXY, HTTP_PROXY, NO_PROXY and FALLOW_CA_BUNDLE. fallow type-aware cleanup removes the companions of other versions. fallow type-aware status reports discovery_source: "setup-directory" for such a companion. (#4630)
  • fallow mutation can select Vitest projects with --runner-project. A root Vitest config can hold projects from separate config files, which the mutation companion cannot instrument. The run then failed at setup, also when the tests of interest were in an inline project. Now --runner-project <name>, which you can repeat, or the mutation.runnerProjects config key selects projects as the Vitest --project flag does. Wildcards work too. A selected project from a separate config file still fails at setup. With a runner other than Vitest, a selection exits with code 2. Thanks @michalius for the report. (#4785)
  • fallow fix reports each export that a kept re-export holds back. fix no longer removes the export of a declaration while a re-export that it keeps still names that declaration. Each withheld removal is a remove_export entry with skip_reason: "kept_re_export". The new JSON counter skipped_kept_re_exports counts these entries, and the human output and the CI step summary state them. The exit code does not change. Limit: a re-export in a file that ignorePatterns excludes does not stop a removal, because that file is not in the module graph. Run the type check after fallow fix when an ignored file re-exports project code. (#4636)

Changed

  • fallow audit --quiet now prints only the actionable part of the human, compact and markdown reports. Before, --quiet removed only the progress output. Now the report also drops unchanged inherited findings, aggregate metrics and the stale and active records of health.thresholdOverrides. The report keeps introduced and worsened findings, diff-risk findings, configuration errors, analysis failures and warnings about incomplete analysis. FALLOW_QUIET=1 gives the same view, and so does --ci with an explicit --format human, --format compact or --format markdown. The verdict, the exit code and the JSON, SARIF, CodeClimate, review and GitHub formats do not change. See the upgrade notes. Thanks @Fidasek009 for the report. (#4575)
  • fallow dupes now compares the static text of template literals. Before, every template literal matched every other template literal. Now the text outside the ${...} expressions must match, as for string literals. Code that differs only in template text is no longer a clone, so default results can show fewer clone groups. See the upgrade notes. (#4626)
  • fallow mutation --kill-matrix-for runs the target tests first and stops when no target kills the mutant. Such a mutant gets the new status not_killed_by_target, and Fallow runs no other covering test for it. After a target kill, the other covering tests run fastest first up to the first kill. Only a kill by exactly one target test and no other test gets a retry. For deterministic tests, each target keeps the same kills, unique_kills and target_only_kills, with fewer test runs. This mode has no score. summary.score is null, and --min-score exits 2. kill_matrix.target_mode names the mode (target-first or full). Thanks @cr101 for the report. (#4588)
  • A type-aware companion of another Fallow release stays valid while it uses the same wire protocol. Before, each upgrade needed a new companion, because Fallow compared the companion package version with its own version. Fallow now compares only the wire protocol version. The wire protocol is now 8. The npm launcher still selects the companion of the exact version. See the upgrade notes.
  • One rule now decides whether a run executes the duplication analysis. A run that names the analysis executes it. Without a name, the config key of the command decides (audit.dupes), and without that key duplicates.enabled decides. The bare fallow command, fallow audit, fallow_api::run_audit, fallow_api::run_combined, the language server and the health score all use this rule. The bug fixes below list the effects.
  • fallow migrate maps production exclusions to production.ignore. A !pattern! entry in a project setting of the migrated config, at the root or in a workspace, becomes a production.ignore glob. Before, fallow migrate dropped these entries and suggested an overrides entry, which hid the findings in every mode.
  • The VS Code and Cursor extension shows one Fallow status bar item instead of up to five. The item shows the finding count and the health grade, for example Fallow 9 · C. Its hover shows the issue breakdown, duplication, health, the audit verdict, the license state and the active workspace. A click opens a menu to run the analysis, hide or show findings, run the audit, switch the workspace or open the settings. The item gets an error background when the audit fails. All commands keep their ids, and the new Fallow: Show Status Menu command opens the menu.
    • The item text shows the license only when the license expires within 14 days, has expired, or is not valid.
    • When the license is past its grace window and Fallow blocks paid features, the item also gets a warning background.
    • License material that the CLI cannot read, for example a stale FALLOW_LICENSE value, now shows "license invalid". Before, the extension hid it.
  • The PR output states the result first and uses plain words.
    • The heading of the sticky comment is now Quality gate failed, Review needed or Quality gate passed. The line under it names the report and the counts.
    • The counts per severity and the gate line come before the finding tables. Each rule id links to its docs page, and the severity column uses error and warning.
    • The gate line is shorter, for example Gates: failed error-severity-findings (3 at or above error). The request line appears only when a request did not apply or applied over an empty scope.
    • In inline review comments, Other locations: is now Also in:, and > Fix intent: is now **Fix:**.
    • The CodeClimate description of a clone now reads 14 lines repeat in 2 places (clone group dup:7308a6eb).
    • The mutation section shows the partial-run line and the headline. The other details are in one Counts and details block that the reader opens. The job summary keeps every paragraph open.
    • The PR comment and the review leave out the mutation section when no mutant was in scope.
  • The maintainer plugin reference lists the Playwright config parsing and the correct plugin count. Thanks @VariableVince for the report. (#4710)

Deprecated

  • The fallow.diagnostics.statusBar setting has no effect. It controlled the separate eye button, which is gone. Use Hide findings in the editor in the menu of the Fallow status bar item, or the Fallow: Toggle Hide All Findings command.

Bug fixes

  • fallow dead-code handles more imports.
    • Fallow parses each inline HTML script body that the browser runs. A package or a module that only an inline module script imports is no longer unused. (#4728)
    • An html tagged template of a local tag, such as export const html = String.raw, no longer gives unresolved imports. An unresolved asset of an html template now points at its src or href value. (#4729, #4730)
    • A bare import with any query credits a package that is not installed, for example import('pkg/mod.wasm?binary'). (#4732)
    • A missing file under a baseUrl directory is an unresolved import, not an unlisted package. (#4731)
    • An import of ./x.ts resolves to x.d.ts when x.ts does not exist, as in TypeScript. (#4734)
    • A root-relative import in an MDX file now resolves from the directory of the file, the nearest package, or the project root. (#4733)
    • Under includeEntryExports, a type read through a namespace import of a JS module, such as lib.HelperOpts, credits the export in the sibling declaration file. (#4551)
    • A small .js file with JSX and a CommonJS file with a top-level return now parse without errors. (#4497)
  • fallow dead-code credits more dependencies, files and exports.
    • A package that only the inline code of node -e, --eval, -p or --print loads. (#4711)
    • A script that a quoted GitHub Actions run: value or a quoted GitLab CI script: item runs. (#4727)
    • A package that a Jest moduleNameMapper target names, such as identity-obj-proxy. (#4712)
    • A package replacement of a Vite or Vitest alias with a regular expression find. (#4713)
    • The build.rollupOptions.input of each Vite environment. Fallow now reads each input relative to its config file. (#4716)
    • A workspace package dependency whose entry file a build step creates. Fallow reports only the unresolved-imports finding. (#4717)
    • A Playwright reporter, globalSetup or globalTeardown value that a condition picks. Thanks @cr101 for the report. (#4620)
    • With includeEntryExports, the default export of a Playwright reporter, globalSetup or globalTeardown file. Thanks @cr101 for the report. (#4621)
  • fallow dead-code credits more class members.
    • A Durable Object method that a stub call from the Worker Env binding reaches, also through this.env and an inline call. A stub at the top level of a module gives no credit yet. (#4548)
    • A Durable Object method that a Worker handler calls through its untyped env parameter in an ExportedHandler<Env> object.
    • The Cloudflare Workers runtime handlers, such as fetch and alarm, on a class that extends a base class of cloudflare:workers. (#4649)
    • The static members of a class that code passes on as a value, for example run(Adapter). (#4723)
    • An instance member that code reads through Class.prototype.member, also through an object holder from another module. (#4724)
  • fallow dead-code reports class members and props more accurately.
    • A module-scope member read no longer credits a class binding of a function body. (#4603)
    • An unused overloaded method is one unused_class_members entry at the line of the implementation. (#4735)
    • unused-component-props does not check a component that memo wraps with a comparator. (#4725)
  • Fallow credits more uses in Vue and Svelte components.
    • A Vue <script setup> block or template that uses an import of the plain <script> block credits that import. A Svelte instance script and markup get the same fix for the module script. Thanks @Tinoooo-envelio for the report. (#4672)
    • Fallow reads the Svelte 5 declaration tag {const x = ...}. (#4714)
    • The expression of a Svelte {#await} shorthand now counts. (#4715)
  • Fallow now reports missed findings for test-only-dependencies, constant-parameter and the exports of import.meta.glob files.
    • test-only-dependencies counts the test files that a Vitest include, a Jest testMatch or a Playwright testDir selects. A file that a runtime or support entry point reaches does not count. Thanks @okize for the report. (#4618)
    • Fallow now reports unused exports in files that an import.meta.glob reads with ?raw or ?url. A glob with the import option credits only that export. Thanks @stanlrt for the report. (#4532)
    • constant-parameter follows a loaded value through ??, || and a ternary. Before, such code made the rule skip each exported function of the project. (#4594)
  • Workspace patterns follow pnpm.
    • A ** pattern skips a folder without a package.json, so source folders no longer give glob-matched-no-package-json. (#4719)
    • A dir/** pattern now includes dir itself. (#4721)
    • A folder that a ! pattern excludes no longer gets a workspace diagnostic. (#4720)
  • Fallow reports fewer false cycles and points a cycle edge at its re-export.
    • export * as Ns from "./self" is no longer a re-export self-loop. (#4722)
    • A cycle edge through a re-export points at the export ... from statement. A fallow-ignore-next-line circular-dependency comment above the re-export now hides the cycle. (#4737)
    • Fallow no longer reports a false import cycle inside the tailwindcss package. (#4740)
  • fallow fix keeps the type check green in more cases.
    • fix now removes unused names from an export list that spans several lines. Before, it kept the list, and the type check failed with TS2459. Thanks @MikeSpock for the report. (#4636)
    • fix keeps the export of a destructured or multi-name declaration while one of its names is in use. Each unused name gets skip_reason: "shared_declaration_in_use". (#4659)
  • duplicates.enabled: false now turns off duplication in every run that neither names the analysis nor sets audit.dupes: true.
    • fallow audit, the bare fallow command, fallow_api::run_combined, the MCP combined analysis and the language server no longer run the duplication analysis.
    • The health score has no duplication measure and no duplication penalty, so the score can go up by the size of that penalty.
    • The project keeps its Fallow Impact history, and Impact no longer counts stored clone groups as resolved.
    • A --dupes-baseline flag with no effect gives a note on stderr. The exit code does not change.
    • A run that names the analysis, such as --only dupes or fallow dupes, still runs it. fallow dead-code --include-dupes now runs its cross-reference too.
  • fallow audit reports fewer false introduced findings, and more config changes that lower a severity or hide findings.
    • Under --gate new-only, a refactor can move a complexity finding, an unused symbol or a clone group to another file. Such a finding can now match its base finding. The match needs the same name or text in a changed or deleted file. (#4670)
    • A change that lowers a rule severity gives a weakened-tests finding with kind: "rule-severity". The audit reads the full config chain, including relative extends files. (#4668)
    • A new or broader ignore entry gives a weakened-tests finding with the new kind ignore-pattern. This applies to ignorePatterns, ignoreFindings, entry, ignoreDependencies, duplicates.ignore and other keys that hide findings.
  • On Windows, the React Router .client and .server markers now apply in a workspace package. Before, client-server-leak read such a package as out of scope, so its *.client.* files were no client roots and its *.server.* files were no server-only-import sinks.
  • fallow security gives fewer false findings and finds one more injection.
    • A call of an inert local function is no longer a library sink candidate. The same is true for a shallow-safe function that a module imports directly from another project file. Thanks @Smrtnyk for the report. (#4611)
    • hardcoded-secret no longer reports sentences and public URLs. Thanks @Smrtnyk for the report. (#4610)
    • command-injection reports an untrusted argument of spawn and execFile when the options object literal turns the shell on. (#4550, #4549)
    • Fallow marks GraphQL resolver args only in a resolver map. (#4718)
  • fallow mutation respects --concurrency, skips more generated files and explains empty path selections.
    • The Vitest companion removes VITEST_MAX_WORKERS before it starts Vitest, so --concurrency is the only control of test parallelism. Thanks @DannyStreur for the report. (#4613)
    • An AUTO-GENERATED ... DO NOT EDIT header marks a generated file. (#4736)
    • fallow mutation <path> names the reason when a path selects no file. The JSON output adds unmatched_path_reasons. (#4739)
  • A missing type-aware companion no longer fails the gate on findings that the type-aware pass can disprove. With typeAware.enabled: true, the default require: best-effort and no type-aware companion, Fallow reports unused-export, unused-type, unused-class-member and private-type-leak at warn. This is also true under --fail-on-issues and --ci. gate_outcomes gets a type-aware-fallback entry with status: skipped. (#4606)
  • fallow health --css credits declarations in nested CSS blocks. A declaration in an @media, @supports, @container, @layer, @scope or @starting-style block inside a style rule now counts. A declaration after a nested rule counts too. An upgrade can show new findings for these declarations. Thanks @Smrtnyk for the report. (#4612)
  • A suppression marker inside a string or template literal no longer suppresses findings. This also applies to the scripts of Vue, Svelte, Astro, MDX and HTML files. (#4751)
  • A CSS clone group no longer starts on a declaration that differs between the files. (#4738)
  • fallow flags no longer takes a method call for a flag SDK call when the same file declares the class or object. A medium confidence SDK call also has no sdk_name in the output now. (#4726)
  • The Git hooks and the agent gate now run the project-local fallow first. They try ./node_modules/.bin/fallow before a fallow on PATH. A project that pins an old fallow now runs that version in its hooks. The Git hook needs fallow 3.43.0 or later for audit --staged. See the upgrade notes. (#4628)
  • This release fixes cycle filtering, the comment layout, escaping and wording in the GitHub Action and the GitLab template.
    • The sticky PR or MR summary now shows a cycle when the diff touches any of its files. The CodeClimate output of a cycle lists the imports of the other member files in other_locations. (#4779)
    • The comment-layout input of the GitHub Action now changes the sticky comment.
    • The live fallow --format pr-comment-github comment of the combined run is the same as the saved render.
    • The PR comment, the review and the check run show finding text without escape characters.
    • The title of the check run is the comment verdict with the counts.
    • The Action no longer tells you to remove a suppression that only lacks a reason.
    • "Fallow found 1 issues" now reads "Fallow found 1 issue". The job summary and the annotations use plain text.
    • The GitLab CI template keeps the mutation results when the job fails. A run that stopped at its time budget can now continue in the next pipeline.
  • The language server, MCP and more commands read the same config inputs as the CLI.
    • The editor fallow.production setting gives the rules of production mode.
    • MCP tools read FALLOW_PRODUCTION* on both routes, with the precedence of the CLI.
    • The Code Mode combined tool reports config-enabled coverage gaps.
    • fallow report --from, fallow audit, fallow audit --staged, fallow plugin-check, fallow coverage upload-inventory and fallow coverage upload-static-findings honor --config and --allow-remote-extends.
  • The VS Code extension opens the Settings editor in a way that cannot freeze it in Cursor. In VS Code, the actions do not change. (#4595)
  • fallow-report-protocol no longer pulls in chrono. Its optional schemars dependency turned on the chrono04 feature, and with it chrono, which RUSTSEC-2026-0543 lists as unmaintained.

Upgrade notes

  • The first run after the upgrade parses each file again. The extraction cache version and the graph cache version change. Fallow rebuilds the duplication token cache once.
  • Install the type-aware companion of this release. This release changes the wire protocol to 8, so a companion of an earlier release refuses the request. The error names fallow type-aware setup and the npm install.
  • Refresh installed hooks to run the project-local fallow first. Run fallow hooks install --target git --force for the Git hook. For a Lefthook job, copy the job that fallow hooks install --target git prints into lefthook.yml. For the agent gate, run fallow agent install.
  • Check scripts that post fallow audit --quiet output. A script that sets FALLOW_QUIET=1 and posts fallow audit --format markdown no longer gets the inherited context. For the complete report, run without --quiet, or use --format json.
  • To match template literals with different text again, set normalization.ignoreStringValues: true. mode: "weak" or "semantic" also matches them.
  • To keep a score in --kill-matrix-for runs, pass --kill-matrix-full. It keeps the earlier behavior, in which each mutant gets a normal status.
  • Save the duplication baseline again after you add a fallow-ignore-start range. A range cuts its neighbor clones, so a baseline gate can show a cut clone as new.

Full Changelog: v3.43.2...v3.44.0