refactor: drop unused exports detected by fallow auto-fix#944
Merged
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5 tasks
Base automatically changed from
05-18-ci_add_fallow_audit_job_pr-scoped_new-only_gate_
to
main
May 19, 2026 00:46
Run `fallow fix --auto-fixable` to remove `export` keywords from symbols fallow's reachability analysis identifies as unused. Keeps only the cases where the symbol is still referenced internally in its own file (so removing `export` doesn't surface a new oxlint `no-unused-vars` error). Result: fallow dead-code findings drop from 276 → 208 (68 fewer unused exports), with no behavior change — each symbol is still defined and used exactly the same way within its file. Reverted ~20 files where fallow's auto-fix would have created cascading "declared but never used" lint errors — those are cases where the symbol isn't used at all, and properly cleaning them up means deleting the declaration, not just dropping `export`. Better to land that as a separate, narrower PR rather than mixing it into a mechanical de-export. Also reverted four false positives where fallow missed real consumers: - `captureCost.ts` (renderOrchestrator has two separate import blocks from the same module; fallow only saw the first) - `propertyPanelHelpers.ts`, `domEditingLayers.ts` (real internal uses fallow's reachability missed) - `render.ts` (functions imported via `await import()` dynamic import, which fallow's static analysis doesn't follow) Test plan: bun run --filter '*' typecheck (clean), oxlint + oxfmt clean, cli/core/studio/engine vitest suites pass (335 + 917 + 576 + 605 tests).
4a464aa to
7e0a447
Compare
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Run
fallow fix --auto-fixableto drop theexportkeyword from symbols fallow identifies as unreachable from any entry point, restricted to cases where the symbol is still used internally in its own file.Why
After #938 + #942 landed the config + CI audit gate, fallow reports 276 dead-code findings. The biggest mechanical chunk is unused exports — symbols exported "in case someone needs them" that nothing currently imports. Removing the
exportkeyword makes them module-private, shrinks the public surface, and lets future cleanup catch genuinely-orphaned declarations.How
npx [email protected] fix --yeswould have applied 165 de-exports. Inspecting the result against typecheck + lint + the fallow audit surfaced three problem categories:False positives (4 files reverted):
captureCost.ts—renderOrchestrator.tshas two separateimport { ... } from "./render/captureCost.js"blocks. Fallow only saw the first and incorrectly flagged symbols from the second block as unused. (Real bug to file upstream.)propertyPanelHelpers.ts,domEditingLayers.ts— internal uses fallow's reachability missed.render.ts— exports consumed viaawait import("./render.js")dynamic imports in tests; fallow's static analysis doesn't follow these.Cascading dead code (20 files reverted):
When fallow removed
exportfrom a symbol that wasn't used in-file either, oxlint immediately surfacesno-unused-vars. Those cases are properly cleaned up by deleting the declaration, not just droppingexport. Doing that touches different code shapes (cascading unused imports, dead helpers) and is better as a separate, narrower PR.Barrel cascades (4 more files reverted):
After force-rebasing onto main, fallow audit caught a third pattern: dropping a single re-export from a barrel file or a single export from a tightly-coupled file made the other symbols in that file become unused. Examples:
Button.tsx— removingButton's andIconButton's exports orphaned the whole filerenderOrchestrator.ts— removing one captureCost re-export left other dead re-exportstelemetry/index.ts,portUtils.ts,ui/index.ts,hyperframeRuntimeLoader.ts— similar barrel-cleanup cascadesThese need a "whole-file cleanup" pass, not a per-symbol auto-fix.
Kept the remaining 38 files where the de-export is purely an access-modifier change — symbol is still used internally, no follow-on findings.
Result
Test plan
bun run --filter '*' typecheck— clean across all 8 packagesbun run lint— 0 errorsbun run format:check— cleannpx [email protected] audit --base origin/main --fail-on-issues— exit 0 (all 19 remaining changed-file findings are inherited)packages/cli335/335,packages/core917/917,packages/studio576/576,packages/engine605/605Follow-ups
Button.tsx,renderOrchestrator.tsre-export barrel,telemetry/index.ts,ui/index.ts, etc. Each is its own small whole-file decision.renderOrchestratorhub cycle — 8 circular deps, real refactor