Skip to content

v3.47.0: namespace-escapes rule, export * as Name checks, Effect Schema members, React Router open redirects

Choose a tag to compare

@BartWaardenburg BartWaardenburg released this 23 Nov 10:59
· 99 commits to main since this release
Immutable release. Only release title and notes can be modified.
v3.47.0
3631c7d

Features

  • The new namespace-escapes rule reports a namespace import that hides exports from the unused-export check. When code uses import * as Ns as a whole value, fallow cannot see which members it reads. Examples are a cast, an assignment, a call argument, a spread, a computed read, Object.keys(Ns) and export { Ns }. Fallow then credits every export of the target module and of the modules that it re-exports from. So unused-exports and unused-types do not check them. The rule reports each such binding with the target module and the count of hidden exports. Fallow does not report a binding that hides no export. The rule is off by default:

    • Enable it in rules.
    • Select it with --namespace-escapes.
    • Suppress one finding with // fallow-ignore-next-line namespace-escape.

    JSON output has the new namespace_escapes array. The other report formats, the CI integrations, the LSP and fallow explain also show the findings. (#5065)

  • fallow security reports a non-literal target of React Router redirect, redirectDocument and replace. The new react-router-open-redirect category (CWE-601) is active when the project declares react-router or @react-router/dev. The callee must be an import from react-router, so a local function named redirect gives no candidate. Thanks @cr101 for the report and the reproduction. (#5001)

Changed

  • Fallow exits with code 2 for many global options that have no effect on a command. One table now states which global options each command accepts. Examples are fallow viz --output-file (use --out) and --output-file on commands that print to stdout. Another example is a global --dupes-* option on a command other than bare fallow. For that case, the message names the config key or the fallow dupes option to use. fallow schema --cli-reference exports the table in the new command_support field of each global option. CHANGELOG.md lists every rejected combination. (#4999)
  • Fallow rejects a --type-aware-project path that does not exist when FALLOW_TYPE_AWARE or typeAware.enabled enables type-aware analysis. When type-aware analysis is off for the run, fallow rejects the option with "has no effect". (#4999)
  • An empty HOME, XDG_CONFIG_HOME or PATH counts as unset. Commands that need a home folder use USERPROFILE in that case. So fallow agent and setup-hooks --user work on native Windows without HOME. A HOME that is not valid UTF-8 now resolves. (#5015)
  • Fallow rebuilds the duplication token cache once. Tokens of export * as name, namespace imports and type-only imports or exports now include the name or the type keyword. A clone group that holds one of these statements can change once. (#5044)

Bug fixes

Unused code

  • export * as Name in an entry file credits only the members that other code reads. With includeEntryExports on, such a line credited every export of the target module. It now works like import * as Name, also for nested chains such as Name.Inner.member. A namespace that code passes as a value, spreads or reads with a computed key keeps full credit. An entry file that a dynamic import() or require() loads also keeps full credit. Outside entry files, fallow no longer reports a false unused export for a nested chain or a namespace that code passes as a value. (#5063)

  • effect.schemaExportsAsTypes accepts more schema forms. With the option on, an export is a schema when each value that it can have is a schema. These forms now count:

    • conditional expressions with a schema in each branch;
    • members of a namespace import;
    • calls of a function that returns its schema argument;
    • members of a local const literal that no code changes;
    • each lowercase Schema member whose return type is a schema in effect 3 or effect 4, for example Schema.optional, Schema.mutable and Schema.tag.

    An unused export of these forms moves from unused-export to unused-type. A schema method that code reads without a call, such as User.annotations, is a function and no longer a schema. PascalCase values that are no schema, such as Schema.TypeId, keep their unused-export finding. (#5062, #5076)

  • Every dependency check reads a package.json with a leading byte order mark. Before, several checks skipped such a manifest and missed unused dependencies of that workspace. (#5068)

  • Settings that a tsconfig inherits through extends count everywhere. For example, jsx from a base config now credits react. Only a config that contains the importing file decides its paths. (#5022)

  • A tsconfig paths alias resolves with the one pattern that TypeScript selects. A paths target also resolves against the folder of the config that sets paths, as in TypeScript 7. baseUrl now resolves an import that no paths pattern resolves. (#5022, #5035)

  • An expression in Vue, Svelte or Astro markup goes to the graph and to fallow security like the same code in a script. A dispatch("save") call in Svelte markup now counts for unused-svelte-event. A Vue bus.emit("close") call no longer marks a declared close event as used. A component with a non-HTML root <template> reports no unused-component-emit finding. Template sinks can now give new security candidates. (#5013)

fallow fix

  • fallow fix checks each edit before it writes it. It drops an edit that breaks the parse or loses a kept member. (#5020)
  • fallow fix removes export from each overload signature. Before, it removed export only from the implementation, and the type check failed. (#5020)
  • fallow fix replaces a re-export with a bare import when it removes the last name. export { Widget } from './widget' becomes import './widget';, so the module still runs. Remove the bare import yourself when the module has no side effects. (#5074)

Audit and CI

  • fallow audit counts one paste as one clone finding. A small edit in every copy of an old clone no longer fails the introduced-clone-group gate. JSON output adds duplication.clone_regions[], a region index on each clone group, and the grade inherited-edited. The duplication_* attribution counts now count regions. (#5000)
  • fallow audit gives correct base findings for sparse checkouts and for renamed files with % or : in the path. The audit also runs the base analysis when a change can alter the findings without a token change. (#5030, #5032, #5044)
  • fallow audit --brief reports only new public exports when dead code and health use different production modes. (#5032)
  • fallow audit keeps the styling findings of changed files. (#5056)
  • fallow security --gate new fails when a change adds an import that lets client code reach a server-only module or a secret reader. (#5057)
  • Fallow now anchors review comments on files with brackets in their path. An example is app/[id]/page.tsx. (#5032)
  • Fallow creates a sticky PR or MR comment when only an enforced gate fails. fallow audit --format codeclimate now applies the report path prefix. (#5028)
  • The dedup-lookup-failed output of the GitHub Action and the GitLab marker report a failed lookup again. fallow ci post-pr-comment and fallow ci post-review give the new error code FALLOW_CI_DEDUP_LOOKUP_FAILED. A CI gate on these outputs can now fail. With a pinned fallow version that does not have this code, the outputs stay false. (#5033)
  • The GitHub Action finds the type-aware config through extends and parent folders. The Action also starts the type-aware sidecar on Windows. (#5029)
  • Fallow exits with code 2 when two save or report flags name one file. An example is --output-file out.sarif --sarif-file out.sarif. A device or a named pipe, such as /dev/null, is still allowed for more than one flag. (#5043)

Other fixes

  • fallow trace keeps every hop inside --depth. It also gives empty chains for a name that the file does not export. (#5036)
  • Fallow judges a barrel hop in a boundary chain by its own re-export kind. Same-named autoDiscover zones with different root values keep each root. (#5034)
  • A recursive workspace pattern no longer follows a link out of the project or into a loop. (#5038)
  • A deep package cycle always gets a package-cycle finding. (#5039)
  • Concurrent fallow mutation runs no longer delete the journal or the run directory of another run. (#5040)
  • fallow mutation --verdicts updates the function of the judged mutant. fallow mutation --kill-matrix no longer calls a test with a duplicate id redundant. (#5025)
  • fallow health --save-snapshot no longer overwrites a snapshot that it saved in the same second. --hotspots --ownership reads the configured codeowners path. Bare fallow scopes health duplication like fallow health. (#5031)
  • fallow health --complexity-breakdown gives Vue, Svelte and Astro contributions the lines of the file. (#5037)
  • The typed decision surface reads a moved package.json under its base path. This applies to the decision_surface MCP tool too. (#5032)
  • An @plugin inside a comment or a string no longer stops the theme token checks. (#5056)
  • The VS Code extension keeps a verified binary through a failed upgrade. A second window no longer deletes the download of the first window. Fallow: Fix saves only after you confirm. (#5051)
  • The editor action that dismisses a security candidate type keeps the hashbang on the first line. (#5071)
  • fallow watch applies a changed ignorePatterns or root .gitignore. (#5027)
  • Smaller fixes in fallow flags, the fallow agent follow-up commands, the ignoreFindings note, the local similar-code setup, the type-aware sidecar wildcard exports and the Impact store. (#5052, #5059, #5061, #5070, #5072)
  • On Windows, JSON output keeps the brackets of a route path. A finding in app/blog/[id]/page.tsx showed as app/blog/%5Bid%5D/page.tsx in --format json. SARIF and CodeClimate URIs still encode the brackets. (#5077)
  • On Windows, fallow mutation replaces a stale run directory while another process reads a file in it. Before, the run failed with os error 145. (#5077)
  • The url dependency is at 2.5.9 for RUSTSEC-2026-0592. (#5042)

Upgrade notes

  • Some command lines that gave an option with no effect now exit with code 2. Remove the option. When the message names a config key or another option, use it. (#4999)
  • The functions of @fallow-cli/fallow-node now return a rejected promise for an invalid option or a similar-code companion that is not ready. Before, they threw. await in a try block works as before. Code that caught the throw without await must handle the rejection. (#5048)
  • fallow flags --flag-state exits with code 2 when two keys name one flag. (#5052)
  • fallow cloud logout exits with code 2 when the keychain does not confirm the delete. (#5060)
  • fallow coverage upload-inventory and upload-static-findings fail on a 404, 409, 410 or 422 response, also with --ignore-upload-errors. A 413 response to upload-inventory exits with the payload-too-large code. A git-SHA keyed upload without --git-sha stops when git status fails, unless you pass --allow-dirty. (#5058)
  • A compact re-export-cycle: line has a line field after the path. A script that splits the line on : must read one more field. (#5014)
  • The css-dead-surface and css-broken-reference findings for unused scoped classes and undefined @keyframes point at the class or rule, not at line 1. Move a suppression comment from line 1 to the line above the class or rule. Their CodeClimate fingerprints change, so CI shows them as new one time. JSON output adds a line field to css_analytics.scoped_unused[] and css_analytics.undefined_keyframes[]. (#5014)
  • The extraction, graph and duplication caches rebuild once on the first run.

Full Changelog: v3.46.0...v3.47.0