Repository navigation
v3.44.0: unused protected class members, exact allowed cycles, and range suppression of clones
·
51 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Features
- The new rule
unused-protected-class-membersreportsprotectedclass members that no code reads. The rule isoffby default, so the default output does not change. A protected member is used when its class or a subclass reads it throughthisorsuper. 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 inrules, 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 newunused_protected_class_membersJSON array, and also to SARIF, CodeClimate, the human report, the LSP andfallow 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.allowaccepts 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 inlinefallow-ignore-next-line circular-dependencycomment would hide that new cycle. Paths are case-sensitive, and an entry needs at least 2 files. An entry that matches no cycle gives acircular-dependencies-allow-unmatcheddiagnostic. An entry that the detector cannot check (more than 12 files) gives no diagnostic. When you add an entry, remove thefallow-ignore-next-line circular-dependencycomment of that cycle, because it becomes a stale suppression.fallow migratenow translates thecycles.allowlist of a migrated config. Thanks @cr101 for the report. (#4623)fallow-ignore-startandfallow-ignore-endsuppress one clone. Put// fallow-ignore-start code-duplication -- <reason>above a block and// fallow-ignore-end code-duplicationbelow 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 belowminTokensorminLines. A marker in a string or template literal does not count. The/* */, JSDoc and<!-- -->forms work too, each on its own line. Ranges support onlycode-duplication.fallow dupesandfallow auditlist a marker with a problem in the newrange_marker_problemsarray, and such a marker has no effect. Clone groups get asuppress-rangeaction next tosuppress-line. Thanks @neumaennl for the report. (#4706)duplicates.normalization.consistentIdentifiersfinds renamed copies without false matches. Use it together withignoreIdentifiers. A clone then needs a one-to-one mapping between the names of its instances. For example,a = b + cmatchesx = y + z, but notx = x + x. When a token breaks the mapping, Fallow keeps each longest part of the clone that maps one-to-one and hasminTokensor more tokens. The option is off by default, and nomodeturns it on.fallow migratenow maps theignoreIdentifiersandignoreLiteralsoptions of an imported duplication config. Thanks @neumaennl for the report. (#4626)fallow auditcan fail on a new clone group. The new ruleintroduced-clone-group(error,warnoroff) sets how a clone group affects the audit verdict and exit code. The default iswarn, so the verdict does not change for current configs. Witherror, a clone group that the change introduces fails the audit with exit code 1. Withoff, the group stays in the report but does not change the verdict. Under--gate new-only, an inherited clone group never gates. Withoverrides, Fallow resolves the rule for the file of each copy and uses the most severe result.fallow explain introduced-clone-groupdescribes 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 assrc/modules/billing/index.tsgave 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 withreason: "internal_file"andpublic_files. On anautoDiscoverzone, each glob is relative to each discovered folder. A project withoutpublicFilesgets the same output as before. Thanks @robertrguerrero for the report. (#4760) production.ignoredrops paths from discovery in production mode only. The object form ofproductionacceptsignore, 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--productionor aFALLOW_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 examplesrc/components/runner/test/Runner.vue. When a production file imports such a file,workspace_diagnostics[]gets oneproduction-excluded-file-importedentry for each pattern. The entry haspattern,file_countand the first fivefiles. 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-leaknow checks React Router Framework Mode apps. When the React Router plugin is active, route modules (root.tsxincluded) are client roots. Only the code that React Router keeps in the client build counts. Fallow does not follow an import or aprocess.env.Xorimport.meta.env.Xread that onlyloader,action,middlewareorheadersuse. 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 areserver-only-importsinks. Such an app no longer gets theclient-server-leak-no-client-rootsdiagnostic. Thanks @cr101 for the report. (#4582)fallow type-aware setupinstalls the type-aware companion for a binary that did not come from npm. A Homebrew,cargo installor 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 honorsHTTPS_PROXY,HTTP_PROXY,NO_PROXYandFALLOW_CA_BUNDLE.fallow type-aware cleanupremoves the companions of other versions.fallow type-aware statusreportsdiscovery_source: "setup-directory"for such a companion. (#4630)fallow mutationcan 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 themutation.runnerProjectsconfig key selects projects as the Vitest--projectflag 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 fixreports each export that a kept re-export holds back.fixno longer removes theexportof a declaration while a re-export that it keeps still names that declaration. Each withheld removal is aremove_exportentry withskip_reason: "kept_re_export". The new JSON counterskipped_kept_re_exportscounts 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 thatignorePatternsexcludes does not stop a removal, because that file is not in the module graph. Run the type check afterfallow fixwhen an ignored file re-exports project code. (#4636)
Changed
fallow audit --quietnow prints only the actionable part of the human, compact and markdown reports. Before,--quietremoved only the progress output. Now the report also drops unchanged inherited findings, aggregate metrics and thestaleandactiverecords ofhealth.thresholdOverrides. The report keeps introduced and worsened findings, diff-risk findings, configuration errors, analysis failures and warnings about incomplete analysis.FALLOW_QUIET=1gives the same view, and so does--ciwith an explicit--format human,--format compactor--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 dupesnow 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-forruns the target tests first and stops when no target kills the mutant. Such a mutant gets the new statusnot_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 samekills,unique_killsandtarget_only_kills, with fewer test runs. This mode has no score.summary.scoreisnull, and--min-scoreexits 2.kill_matrix.target_modenames the mode (target-firstorfull). 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 keyduplicates.enableddecides. The barefallowcommand,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 migratemaps production exclusions toproduction.ignore. A!pattern!entry in aprojectsetting of the migrated config, at the root or in a workspace, becomes aproduction.ignoreglob. Before,fallow migratedropped these entries and suggested anoverridesentry, 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 newFallow: Show Status Menucommand 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_LICENSEvalue, 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 neededorQuality 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
errorandwarning. - 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 nowAlso 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 detailsblock 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 heading of the sticky comment is now
- The maintainer plugin reference lists the Playwright config parsing and the correct plugin count. Thanks @VariableVince for the report. (#4710)
Deprecated
- The
fallow.diagnostics.statusBarsetting 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 theFallow: Toggle Hide All Findingscommand.
Bug fixes
fallow dead-codehandles 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
htmltagged template of a local tag, such asexport const html = String.raw, no longer gives unresolved imports. An unresolved asset of anhtmltemplate now points at itssrcorhrefvalue. (#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
baseUrldirectory is an unresolved import, not an unlisted package. (#4731) - An import of
./x.tsresolves tox.d.tswhenx.tsdoes 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 aslib.HelperOpts, credits the export in the sibling declaration file. (#4551) - A small
.jsfile with JSX and a CommonJS file with a top-levelreturnnow parse without errors. (#4497)
fallow dead-codecredits more dependencies, files and exports.- A package that only the inline code of
node -e,--eval,-por--printloads. (#4711) - A script that a quoted GitHub Actions
run:value or a quoted GitLab CIscript:item runs. (#4727) - A package that a Jest
moduleNameMappertarget names, such asidentity-obj-proxy. (#4712) - A package replacement of a Vite or Vitest alias with a regular expression
find. (#4713) - The
build.rollupOptions.inputof 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-importsfinding. (#4717) - A Playwright
reporter,globalSetuporglobalTeardownvalue that a condition picks. Thanks @cr101 for the report. (#4620) - With
includeEntryExports, the default export of a Playwright reporter,globalSetuporglobalTeardownfile. Thanks @cr101 for the report. (#4621)
- A package that only the inline code of
fallow dead-codecredits more class members.- A Durable Object method that a stub call from the Worker
Envbinding reaches, also throughthis.envand 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
envparameter in anExportedHandler<Env>object. - The Cloudflare Workers runtime handlers, such as
fetchandalarm, on a class that extends a base class ofcloudflare: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)
- A Durable Object method that a stub call from the Worker
fallow dead-codereports class members and props more accurately.- 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)
- A Vue
- Fallow now reports missed findings for
test-only-dependencies,constant-parameterand the exports ofimport.meta.globfiles.test-only-dependenciescounts the test files that a Vitestinclude, a JesttestMatchor a PlaywrighttestDirselects. 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.globreads with?rawor?url. A glob with theimportoption credits only that export. Thanks @stanlrt for the report. (#4532) constant-parameterfollows 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.
- 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 ... fromstatement. Afallow-ignore-next-line circular-dependencycomment above the re-export now hides the cycle. (#4737) - Fallow no longer reports a false import cycle inside the
tailwindcsspackage. (#4740)
fallow fixkeeps the type check green in more cases.fixnow 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)fixkeeps theexportof a destructured or multi-name declaration while one of its names is in use. Each unused name getsskip_reason: "shared_declaration_in_use". (#4659)
duplicates.enabled: falsenow turns off duplication in every run that neither names the analysis nor setsaudit.dupes: true.fallow audit, the barefallowcommand,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-baselineflag with no effect gives a note on stderr. The exit code does not change. - A run that names the analysis, such as
--only dupesorfallow dupes, still runs it.fallow dead-code --include-dupesnow runs its cross-reference too.
fallow auditreports 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-testsfinding withkind: "rule-severity". The audit reads the full config chain, including relativeextendsfiles. (#4668) - A new or broader ignore entry gives a
weakened-testsfinding with the new kindignore-pattern. This applies toignorePatterns,ignoreFindings,entry,ignoreDependencies,duplicates.ignoreand other keys that hide findings.
- Under
- On Windows, the React Router
.clientand.servermarkers now apply in a workspace package. Before,client-server-leakread such a package as out of scope, so its*.client.*files were no client roots and its*.server.*files were noserver-only-importsinks. fallow securitygives 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-secretno longer reports sentences and public URLs. Thanks @Smrtnyk for the report. (#4610)command-injectionreports an untrusted argument ofspawnandexecFilewhen the options object literal turns the shell on. (#4550, #4549)- Fallow marks GraphQL resolver args only in a resolver map. (#4718)
fallow mutationrespects--concurrency, skips more generated files and explains empty path selections.- The Vitest companion removes
VITEST_MAX_WORKERSbefore it starts Vitest, so--concurrencyis the only control of test parallelism. Thanks @DannyStreur for the report. (#4613) - An
AUTO-GENERATED ... DO NOT EDITheader marks a generated file. (#4736) fallow mutation <path>names the reason when a path selects no file. The JSON output addsunmatched_path_reasons. (#4739)
- The Vitest companion removes
- A missing type-aware companion no longer fails the gate on findings that the type-aware pass can disprove. With
typeAware.enabled: true, the defaultrequire: best-effortand no type-aware companion, Fallow reportsunused-export,unused-type,unused-class-memberandprivate-type-leakatwarn. This is also true under--fail-on-issuesand--ci.gate_outcomesgets atype-aware-fallbackentry withstatus: skipped. (#4606) fallow health --csscredits declarations in nested CSS blocks. A declaration in an@media,@supports,@container,@layer,@scopeor@starting-styleblock 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 flagsno longer takes a method call for a flag SDK call when the same file declares the class or object. Amediumconfidence SDK call also has nosdk_namein the output now. (#4726)- The Git hooks and the agent gate now run the project-local fallow first. They try
./node_modules/.bin/fallowbefore afallowonPATH. A project that pins an old fallow now runs that version in its hooks. The Git hook needs fallow 3.43.0 or later foraudit --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-layoutinput of the GitHub Action now changes the sticky comment. - The live
fallow --format pr-comment-githubcomment 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 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
- The language server, MCP and more commands read the same config inputs as the CLI.
- The editor
fallow.productionsetting gives the rules of production mode. - MCP tools read
FALLOW_PRODUCTION*on both routes, with the precedence of the CLI. - The Code Mode
combinedtool reports config-enabled coverage gaps. fallow report --from,fallow audit,fallow audit --staged,fallow plugin-check,fallow coverage upload-inventoryandfallow coverage upload-static-findingshonor--configand--allow-remote-extends.
- The editor
- 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-protocolno longer pulls inchrono. Its optionalschemarsdependency turned on thechrono04feature, and with itchrono, 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 setupand the npm install. - Refresh installed hooks to run the project-local fallow first. Run
fallow hooks install --target git --forcefor the Git hook. For a Lefthook job, copy the job thatfallow hooks install --target gitprints intolefthook.yml. For the agent gate, runfallow agent install. - Check scripts that post
fallow audit --quietoutput. A script that setsFALLOW_QUIET=1and postsfallow audit --format markdownno 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-forruns, 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-startrange. 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