False positive unused file for Vercel vercel.ts config
What happened?
fallow dead-code reports apps/web/vercel.ts as an unused file, but Vercel treats vercel.ts as a project configuration file that is discovered and executed by convention.
The file is not imported by application source, so it looks unused to a pure import graph. It should be treated as a Vercel config entrypoint.
Fallow should treat Vercel programmatic config files as used config entrypoints when Vercel is active.
At minimum, the Vercel plugin/config detection should mark these app-root files as always used:
vercel.ts
vercel.js
vercel.mjs
vercel.cjs
vercel.mts
A fix could add these to the relevant Vercel plugin config/always-used patterns, similar to how other framework config files are protected from unused-file reporting.
Fallow version
2.85.0
Operating system
macOS
Configuration
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work.
For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state.
You can also reset all changes in the repository using git reset --hard command.
Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later.
Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands.
However you don't need to use git add or git commit before submitting your changes. In fact,
submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.
CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
If an error was reported in the issue description, I have successfully reproduced it.
If an error was reported in the issue description, I have confirmed that my fix resolves the error.
I have thought about edge cases and made sure my fix handles them as well.
I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.
I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /fallow, current file: none) bash-$
Solution
New vercel built-in plugin (crates/core/src/plugins/vercel.rs), registered in plugins/mod.rs and registry/builtin.rs (Deployment category):
Activation: vercel / @vercel/config dependency, a vercel package script (vercel env pull, vercel deploy, …), a root vercel.json, or a discovered package-root vercel.* config.
Always used / config patterns: vercel.ts, vercel.js, vercel.mjs, vercel.cjs, vercel.mts (exactly the documented set) → they become support entry points, so they are never unused-file and their imports stay reachable.
Used exports: "*" for those files (@vercel/config collects every named export; config is the documented one), so --include-entry-exports doesn’t flag export const config.
resolve_config: credits packages imported by the config (@vercel/config) and credits nested monorepo app configs (apps/web/vercel.ts) when the plugin is active at a higher root — gated on a sibling package.json so a src/lib/vercel.ts helper module stays reportable.
Tooling deps: vercel, @vercel/config not flagged as unused devDependencies.
Docs updated (.claude/rules/detection.md, .claude/rules/plugins.md, README plugin count, CHANGELOG, re-blessed scripts/agent-files.sha256) plus a tests/fixtures/vercel-config repro fixture.
Checklist
Reproduced the reported error: Yes. I built a workspace matching the issue (apps/web/package.json with vercel/@vercel/config, apps/web/vercel.ts) and, with the fix stashed, fallow dead-code reported apps/web/vercel.ts as an unused file.
Confirmed the fix resolves it: Yes. With the plugin in place the same run reports only the control orphan (apps/web/src/orphan.ts); vercel.ts is now a plugin entry point.
Edge cases: verified all five extensions (ts/js/mjs/cjs/mts), single-package root config, monorepo where only the root manifest declares vercel, activation via vercel.json with no dependency, --production mode, --include-entry-exports (the config export isn’t flagged), imports from the config staying reachable, vercel/@vercel/config credited as tooling while a control dep (left-pad) is still reported, and no false negative for a same-named helper module (src/lib/vercel.ts remains reported).
Existing tests pass: cargo test --workspace --no-fail-fast shows only one failure, fix_batch_aborts_when_a_target_directory_is_read_only, which I confirmed also fails on the pristine tree (test runs as root, so read-only dirs stay writable) — unrelated to this change. cargo fmt --all --check and cargo clippy --workspace --all-targets are clean, and the agent-file manifest gate passes. I added no tests to existing test files (only unit tests inside the new plugin module).
What I did
Added a new built-in vercel plugin (crates/core/src/plugins/vercel.rs), registered in plugins/mod.rs and registry/builtin.rs (Deployment category):
Activation: vercel / @vercel/config dependency, a vercel package script (vercel env pull, vercel deploy, …), a root vercel.json, or a discovered package-root vercel.* config.
Always used / config patterns: vercel.ts, vercel.js, vercel.mjs, vercel.cjs, vercel.mts (exactly the documented set), so they become support entry points (their imports stay reachable too) and are never reported as unused files.
Used exports: "*" for those files, because @vercel/config collects every named export (config), so --include-entry-exports doesn't produce a false positive.
resolve_config: credits packages imported by the config (e.g. @vercel/config/v1) and credits nested monorepo app configs (apps/web/vercel.ts) when the plugin is active at a higher root — gated on a sibling package.json so an unrelated src/lib/vercel.ts helper module stays reportable.
Tooling deps: vercel, @vercel/config are no longer flagged as unused devDependencies.
Docs: .claude/rules/detection.md, .claude/rules/plugins.md (+ re-blessed scripts/agent-files.sha256), README plugin counts, CHANGELOG [Unreleased], plus a tests/fixtures/vercel-config fixture mirroring the issue's repro.
Checklist
Reproduced the reported error: Yes. Built the CLI on the clean tree (git stash) and ran fallow dead-code on a repro workspace (apps/web/package.json with vercel/@vercel/config, apps/web/vercel.ts) — apps/web/vercel.ts was listed under "Unused files".
Confirmed the fix resolves it: Yes. With the fix, vercel.ts is gone from the report (2 entry points detected (1 plugin)) while the control orphan apps/web/src/orphan.ts is still reported.
Edge cases: verified single-package root config, monorepo config where only the root package.json declares vercel, activation via vercel.json alone (no deps), all five extensions (ts/js/mjs/cjs/mts), --production, --include-entry-exports (the config export not flagged), config imports credited (@vercel/config not unused, control left-pad still unused), and the false-negative guard (src/lib/vercel.ts helper still reported, no activation from it).
Ran existing tests: cargo test --workspace --no-fail-fast → only fix_batch_aborts_when_a_target_directory_is_read_only fails, which I verified also fails on the unmodified tree (running as root makes read-only dirs writable). cargo fmt --all --check and cargo clippy --workspace --all-targets are clean, and the agent-file manifest gate passes. I did not modify or add to any existing test file (new tests live only inside the new plugin module).
What I changed
New crates/core/src/plugins/vercel.rs (vercel plugin, registered in plugins/mod.rs + registry/builtin.rs under "Deployment"):
Activates from the vercel / @vercel/config dependency, a vercel package script, a root vercel.json, or a discovered package-root vercel.* config (the CLI is often only in a root/global install).
always_used + config_patterns: vercel.ts, vercel.js, vercel.mjs, vercel.cjs, vercel.mts (exactly the documented set) → they become support entry points, so the file is no longer unused-file and modules it imports stay reachable.
used_exports: "*" for those files (@vercel/config collects all named exports, e.g. config), so --include-entry-exports doesn't flag them.
tooling_dependencies: vercel, @vercel/config.
resolve_config credits packages imported by the config and additionally credits nested (monorepo app) configs when the plugin is active at a higher root, gated on a sibling package.json so a src/lib/vercel.ts helper module stays reportable (no blanket **/vercel.ts false negative).
Added tests/fixtures/vercel-config/ reproducing the issue (workspace app with vercel.ts, plus left-pad, an orphan module and a same-named helper as controls).
Checklist
Reproduced the reported error: yes — built the CLI on the pristine tree (git stash) and ran fallow dead-code on a repro matching the issue (apps/web/vercel.ts + app package.json with vercel/@vercel/config): vercel.ts was reported under "Unused files".
Confirmed the fix resolves it: yes — after restoring the change, the same repro reports only the control orphan (apps/web/src/orphan.ts); vercel.ts is credited as a plugin entry point. Also verified on the committed fixture.
Edge cases: verified single-package root config, monorepo where only the root package.json declares vercel (nested config still credited), activation via vercel.json with no vercel dependency, all five extensions (ts/js/mjs/cjs/mts), --production mode, --include-entry-exports (the config export is not flagged), imports from the config being reachable, vercel/@vercel/config not reported as unused devDeps while left-pad still is, and that an unrelated src/lib/vercel.ts helper is still reported (no false negative).
Ran existing tests: cargo test --workspace --no-fail-fast passes except fallow-cli::fix_tests::fix_batch_aborts_when_a_target_directory_is_read_only, which I confirmed fails identically on the pristine tree (root user can write read-only dirs in this container) — unrelated to my change. cargo fmt --all --check and cargo clippy --workspace --all-targets are clean, and the agent-file manifest gate passes. I did not modify or add any repository test files other than my plugin's own inline unit tests.
What I did
Root cause: Fallow had no Vercel plugin at all, so vercel.ts (a config file Vercel discovers by convention and executes at build time) looked like an orphan module to the import graph.
Fix: new built-in plugin crates/core/src/plugins/vercel.rs (registered in plugins/mod.rs + registry/builtin.rs, "Deployment" group):
Activation:vercel / @vercel/config dependency, a vercel package script (vercel env pull, vercel deploy, …), a root vercel.json, or a discovered package-root vercel.* config.
Always used / config patterns:vercel.ts, vercel.js, vercel.mjs, vercel.cjs, vercel.mts (exactly the documented set), so they become support entry points — their own imports stay reachable too.
Used exports:"*" for those files (@vercel/config collects every named export; config is the documented one), so --include-entry-exports doesn’t flag export const config.
resolve_config: credits packages imported by the config (e.g. @vercel/config/v1) and credits nested monorepo app configs (apps/web/vercel.ts) when the plugin is active at a higher root — gated on a sibling package.json so an unrelated src/lib/vercel.ts helper module stays reportable (no false negatives).
Tooling deps:vercel, @vercel/config not reported as unused devDependencies.
Docs updated (.claude/rules/detection.md, .claude/rules/plugins.md, README plugin counts, CHANGELOG [Unreleased]), agent-file manifest re-blessed, plus a fixture tests/fixtures/vercel-config/ reproducing the issue.
Checklist
Reproduced the reported error: Yes. Built the exact repro from the issue (apps/web workspace with vercel/@vercel/config devDeps + vercel.ts); with the fix stashed, fallow dead-code reported apps/web/vercel.ts as an unused file.
Confirmed the fix resolves it: Yes. After the fix the same run reports only the control orphan (apps/web/src/orphan.ts); vercel.ts is credited as a plugin entry point.
Edge cases: Verified single-package root config; monorepo where only the root package.json declares vercel (nested config still credited); activation via vercel.json with no vercel dependency; all five extensions (ts/js/mjs/cjs/mts); --production mode; --include-entry-exports (the config export is not flagged); src/lib/vercel.ts helper still reported unused (no over-crediting); config imports keep @vercel/config off the unused-deps list while a control dep (left-pad) is still reported.
Existing tests pass:cargo test --workspace --no-fail-fast shows only one failure, fix_batch_aborts_when_a_target_directory_is_read_only, which I confirmed also fails on the clean tree (environment runs as root, so read-only dirs remain writable) — unrelated to my change. cargo fmt --all --check and cargo clippy --workspace --all-targets are clean; the agent-file manifest gate passes.