Skip to content

v3.49.0: test-only exports, shallow directories, MCP skills, and safer fix --production

Choose a tag to compare

@BartWaardenburg BartWaardenburg released this 26 Nov 12:26
· 127 commits to main since this release
Immutable release. Only release title and notes can be modified.
v3.49.0
4c2eede

Features

  • A test-only-export rule. It reports an exported value that production code does not use but that a test, story, fixture, bench or test-helper file uses. In a default run, these files keep such an export alive, so unused-export does not report it. The rule is off by default. Turn it on with rules: { "test-only-exports": "warn" } or the --test-only-exports selector. Only values are checked in this version, not types. Run fallow explain test-only-export for details. (#5252)
  • Shallow directories in fallow health. The opt-in --shallow-directories flag lists directories whose interface is as large as what they hide. A directory is shallow when files outside it use at least as many of its items as it keeps inside. The section is for information only. It has no weight in the health score and never fails a run. Set health.shallowDirectories.minInterface (default 8) and health.shallowDirectories.ignore in the config. (#5195)
  • The MCP server serves the fallow skills. fallow-mcp supports the MCP skills extension. A client that supports it, such as Claude Code 2.1.331 or later, can load the fallow and fallow-setup skills at the same version as the tools. Set FALLOW_MCP_SKILLS=off to stop serving the skills. fallow agent install also installs the skills on disk, so it writes FALLOW_MCP_SKILLS=off into the MCP entry that it registers. (#5236)
  • A note for an overrides[].files glob that matches no file. Such a glob has no effect. fallow dead-code now reports it as override-files-unmatched in workspace_diagnostics. The message names the key that works, for example ignoreBinaries. Thanks @crystalfp for the report. (#5227)
  • An mkdocs plugin for MkDocs and Zensical sites. Local extra_javascript and extra_css files of mkdocs.yml or zensical.toml are entry points. (#5161)
  • A vite-pwa-assets-generator plugin. When @vite-pwa/assets-generator is a dependency, pwa-assets.config.* at the project root or a workspace root is no longer an unused file. (#5160)

Bug fixes

  • fallow fix --production no longer breaks tests. A production run leaves out test, story, fixture and bench files, so fallow reports an export that only these files import as unused. fix --production removed its export keyword, and the test then failed. Now fix --production keeps the export, lists it with skip_reason: "test_importers" and counts it in skipped_test_importers. In fallow dead-code --production --format json, the finding has a new test_importers field and auto_fixable: false. (#5251)
  • The language server no longer runs again for a watched-file event that changes no content. A file watcher can report events for a file that another tool only touches, and each event started a new analysis, so the analysis did not stop. One editor save also started two runs. The server now compares the content of the file with the content that it saw last. The Output channel names the files that start a run. (#5278)
  • The VS Code status bar count agrees with the sidebar. It counts the same categories as the sidebar and leaves out the categories that fallow.issueTypes turns off. The language server also no longer writes INFO lines to stderr, which VS Code labels as [error]. (#5278)
  • An @expected-unused export that only tests import is no longer a stale suppression. (#5252)
  • A local with the name of a namespace import no longer hides unused exports. In import * as e from "./errors", a use of a local e, such as String(e) in catch (e), counted as a use of the whole namespace. Now only a use that resolves to the import gives credit. (#5064)
  • @sveltejs/kit gets credit for $app, $env, $service-worker and ./$types imports, also without svelte.config.js. Before, fallow fix could remove the package. Thanks @tlq5l for the patch in #5234. (#5019)
  • Fallow warns when the parse cache is too small for the project. The warning names the share of files that do not fit and a cache.maxSizeMb value that holds them. Thanks @1abdala for the patch in #5222, and @Bertie690 for the report. (#5216)
  • Nx local executors, generators and plugins are no longer unused files. Fallow reads executors.json, generators.json and the local plugins of nx.json. Thanks @Bertie690 for the report. (#5201)
  • --type-aware keeps an exported type that declaration emit of another file needs. Without the export, tsc --declaration fails with TS4029. The pass does this only in a project that emits declaration files. (#4850)
  • Vue, Svelte and Astro files get correct complexity, parse and credit results.
    • Vue <template> complexity units span the template block, not the whole file. Thanks @1abdala for the patch in #5079. (#4992)
    • Top-level return in Astro frontmatter is no longer a parse error. Thanks @aloneangel45 for the patch in #5175, and @Elia97 for the report. (#5129)
    • An expression in an attribute of an Astro <style> or <script> tag counts as a use. Thanks @aloneangel45 for the patch in #5123. (#5098)
    • A SvelteKit {data} shorthand attribute counts as a use of the whole data. Thanks @aloneangel45 for the patch in #5179. (#5171)
    • bind:data, data="{data}" and other plain mentions of data in markup also count as a use of the whole data. unused-load-data-key then reports no keys for that route. A data mention inside script text no longer counts. (#5171)
    • An exported Props type in a .astro file is no longer an unused type.
    • --trace File.svelte:default lists the files that import a component. (#5172)
  • unused-store-member credits more Pinia state reads. It credits reads through store.$state, through this.$state in an option store, and through a property typed with ReturnType<typeof useFooStore>. (#5168, #5203, #5207)
  • Fallow prints a note for stale config entries. This covers unmatched ignoreExports, duplicates.ignore and health.ignore entries, and a misnamed config file such as fallow.jsonc. fallow dupes and fallow health report their own ignore globs. A --production run reports none of the stale ignore notes. (#5167, #5166, #5202)
  • fallow mutation runs in more projects. Pruned mutants stay out of the instrumented copy, so the baseline passes with TanStack Router code splitting. Thanks @x7ddf74479jn5 for the report. (#5218) fallow mutation finds Vitest in a Vite+ project. (#5199, #5174)
  • Agent commands suggest and refresh the right skills. fallow agent status suggests --user commands for skills in the home folder. Thanks @aloneangel45 for the patch in #5102. (#5067) fallow agent install refreshes a stale .agents skill. (#5132)
  • The VS Code fix preview shows the available fixes when the dry run skips a file. Thanks @aloneangel45 for the patch in #5128. (#5126)
  • Fallow credits more framework and tooling code. Fallow now credits these items:
    • the Vite configs that the Electron Forge VitePlugin names (#5097);
    • the jsPlugins of an imported Oxlint preset (#5101);
    • the static properties that React reads (#5173);
    • toJSON and paired dispose class members;
    • a CSS Module default that a barrel re-exports (#5162);
    • re-exports on each React Native platform sibling;
    • a dependency that a config requires;
    • @effect/tsgo as the provider of the @effect/language-service tsconfig plugin (#5163).
  • A root Vitest test.include no longer replaces the test patterns of a workspace. (#5094)
  • A macro import is build time. A devDependency that only a macro module imports is no longer a devDependency in production.
  • Crafted input can no longer make the analysis hang. This covers stylesheets with nested color functions, and TypeScript or MDX files with nested < and parenthesized patterns. A stylesheet past the parse budget gets no CSS analytics. Vue and Svelte files with many unclosed attribute quotes, and package scripts with a very long command word, no longer slow the analysis. A Sass @use " " no longer adds an empty import.
  • Other fixes.
    • dynamic-segment-name-conflict accepts [slug] next to [...rest]. (#5169)
    • A stale fallow-ignore-next-line marker names the cause on the next line. (#5164)
    • The docs of duplicates.threshold and --threshold say that 0 turns the gate off. (#5165)
    • --changed-since finds changed and renamed files when diff.relative is true.
    • Impact matches moved findings one for one, and a passing gate clears a pending failure in the same worktree. The Impact containment total keeps growing after the event list fills.
    • fallow explain shared-state describes the inventory in each format, and the license activation help shows --stdin.
    • Config fix reports list only the ignore rules that Fallow adds.
    • Type coupling counts each signature edge, and a scoped file list keeps the file count of each boundary zone.
    • fallow trace, fallow trace-error, fallow migrate, watch, doctor, fallow audit, fallow dupes, the walkthroughs, the flag retirement report and CSS health got smaller fixes. The CHANGELOG lists each one.
  • Release SBOMs cover every shipped binary and only the crates that it links. (#5131, #5190)

Security

  • A repository that you analyze has fewer ways to make Fallow run programs or write files.
    • The agent gate and fallow agent install run only a fallow binary that the install recorded or that is in the install root. The gate removes unsafe PATH entries before the first program runs.
    • Fallow runs Git without a file system monitor program.
    • Fallow refuses a project root that a committed link moves out of its checkout, and a directory that holds the home directory.
    • Fallow reads config and manifest files only inside the project, up to a size limit.
    • The cache, setup and migrate commands do not write through a link into .git or node_modules.
    • Fallow refuses a user glob that folds to an absolute path.

Performance

  • Plugin used_exports rules no longer slow down monorepos with many workspaces. On a generated monorepo with 75 Next.js workspaces, the CPU time of fallow dead-code fell by about 40%. Thanks @Bertie690 for the report. (#5196)

Upgrade notes

  • Some extraction and parse cache versions changed, so the first run after the update parses each file again.
  • To see more language server detail in the editor Output channel, set RUST_LOG (for example RUST_LOG=fallow_core=info) in the environment of the editor.
  • fallow agent install now writes FALLOW_MCP_SKILLS=off into its MCP entry. An older fallow version treats that entry as user-edited and does not replace it without --force.
  • For a fallow dupes clone group with merged occurrences, the audit key and baseline entry can change once.

Full Changelog: v3.48.0...v3.49.0