Repository navigation
chore: check import cycles with fallow - #16
Conversation
Add `fallow` 3.43.2 and a `check:fallow` script that fails on any import cycle. Only the circular dependency rule is on, and imports inside a function (`import()`) are left out. knip stays the check for unused code.
Bundle Stats✅ No significant changes. All scenario measurements (1)🗺️ View treemap · Artifacts
Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3c00ed7. Configure here.
| }, | ||
| "scripts": { | ||
| "build": "pkg-utils build --strict --check", | ||
| "check:fallow": "fallow dead-code", |
There was a problem hiding this comment.
Fallow cache directory not ignored
Low Severity
pnpm check:fallow writes incremental cache under .fallow/, but .gitignore does not exclude that directory. fallow init adds it automatically, and this repo already ignores similar tool caches such as .vitest and .bundle-stats. Local runs can therefore stage generated cache files.
Reviewed by Cursor Bugbot for commit 3c00ed7. Configure here.


Adds fallow as a check for import cycles, beside knip, the same setup as in the editor.
fallowis pinned to exactly 3.43.2,pnpm check:fallowruns it, and.fallowrc.jsonturns on only the cycle rule and leaves outimport()inside functions. The package has no cycles today, so the check starts green.The shared checks workflow gets a matching
fallowjob in a separate PR in portabletext/.github, which runspnpm check:fallowin every repo that calls it. That PR lands after this one, because the job fails where the script is missing.Note
Low Risk
Dev-only tooling and config with no runtime or production behavior changes.
Overview
Introduces fallow (
3.43.2, pinned) as a dev dependency and addspnpm check:fallow(fallow dead-code) alongside existing checks like knip..fallowrc.jsonenables onlycircular-dependenciesas an error; all other fallow rules stay off. Cycle detection ignores lazyimport()viacircularDependencies.ignoreLazyImports. The repo is expected to pass this check from day one.Reviewed by Cursor Bugbot for commit 3c00ed7. Bugbot is set up for automated code reviews on this repo. Configure here.