ISSUE DESCRIPTION False positive unused file for Vercel vercel.ts config What happened?…
- User
ISSUE DESCRIPTION
False positive unused file for Vercel vercel.ts config
What happened?
fallow dead-codereportsapps/web/vercel.tsas an unused file, but Vercel treatsvercel.tsas 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.
Vercel docs say:
vercel.tsconfigures and overrides Vercel project behavior.- Unlike
vercel.json,vercel.tsexecutes at build time. - The final config must be exported as
config. - Vercel also supports
vercel.js,vercel.mjs,vercel.cjs, andvercel.mts.
The
@vercel/configpackage also treatsvercel.tsas the config input:packages/config/README.mdsays to create avercel.tsfile in the project root.packages/config/README.mdsaysvercel.tsis automatically compiled duringvercel build,vercel dev, andvercel deploy.packages/config/src/cli.tsresolvesprocess.cwd()/vercel.ts.packages/config/src/cli.tsimports the config module and collects named exports.packages/config/example/vercel.tsshows the expectedexport const configshape.
Because Vercel discovers this file by convention, Fallow should not report it as unused.
Reproduction
Create an app/workspace with a
package.jsonlike:{ "name": "@example/web", "private": true, "type": "module", "scripts": { "build": "next build", "env-pull": "vercel env pull" }, "devDependencies": { "@vercel/config": "latest", "vercel": "latest" } }Create
vercel.tsat the app root:import type { VercelConfig } from '@vercel/config/v1'; export const config = { regions: ['dub1'], fluid: true, installCommand: 'pnpm install --filter @example/web...', devCommand: 'next dev --port 3000', crons: [ { path: '/api/jobs/run', schedule: '*/5 * * * *', }, ], } satisfies VercelConfig;Run:
fallow dead-codevercel.tsis reported as an unused file.Expected behavior
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.tsvercel.jsvercel.mjsvercel.cjsvercel.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 usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto 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-$
Assistant
Now register the module and plugin in mod.rs and builtin.rs.
Assistant
Now update builtin.rs imports and the plugin list (add to Deployment section).
Assistant
Now let's build and run tests.
Assistant
Builds fine. Now run the plugin tests plus overall test suite for core.
Assistant
Now let's check that there are broader tests validating registry counts / all_builtin_plugins_have_enablers etc., and other places that may enumerate plugin names (docs, README, plugin count tests). Let's search.
Assistant
That's a >= check, fine. Let's run the full core test suite plus check docs/README mention plugin lists (maybe a docs file listing plugins needs updating too).
Assistant
This is a documentation/rules file that seems to log each fix. Let's add an entry for consistency, referencing this fix.
Assistant
Now let's write a quick reproduction test using the CLI to make sure
vercel.tsis no longer flagged as unused.Assistant
No issues found, meaning
vercel.tsis no longer flagged unused. Let's confirm before the fix it was flagged, by checking with git stash of the plugin change to compare (optional but good to confirm regression test validity).Assistant
Confirmed the bug reproduces without the fix. Now restore the fix.
Assistant
Fix confirmed. Now let's also test other extensions (js, mjs, cjs, mts) and monorepo nested location similar to
apps/web/vercel.ts.Assistant
Nested monorepo
vercel.mjshandled correctly too. Now let's run the full test suite for core and cli to ensure nothing broke.Assistant
All 541 tests pass. Let's check summary of test results (whether unit tests all passed).
Assistant
All 2467 unit tests pass. Now let's run cli tests too, and check formatting/clippy.
Assistant
Formatted successfully. Now re-run tests to confirm formatting change didn't break anything, and run clippy.
Assistant
No clippy warnings. Let's re-run full tests once more to be safe, then clean up the temp repro directories.
Assistant
All tests pass. Let's do a final review of the diff.
Assistant
The diff looks clean and complete. Let's review the final new plugin file once more for correctness.
Assistant
This looks complete and correct.
Assistant
Now let's go through the checklist explicitly and do a final sanity test run before submitting.
Assistant
Checklist review:
- Reproduced the reported error: Yes — I created a repro project mirroring the issue's
package.json/vercel.tsand confirmed (with the fix removed) thatfallow dead-codereportedvercel.tsas an unused file, matching the issue exactly. - Confirmed the fix resolves the error: Yes — after restoring the new
VercelPluginregistration, the same repro project now reports "No issues found", and I additionally verified a monorepo case (apps/web/vercel.mjs) resolves correctly too. - Thought about edge cases: Covered all five documented Vercel config extensions (
vercel.ts/js/mjs/cjs/mts) via the config pattern's brace expansion, nested/workspace locations via the**/always-used pattern, activation both from dependencies (vercel,@vercel/config) and from scripts invokingvercel(e.g.vercel env pull), and made sure unrelated projects (e.g. justnext) don't spuriously activate the plugin. Also preserved crediting of imported type-only packages (@vercel/config) so the CLI/package doesn't get flagged unused either. - Ran existing tests:
cargo test -p fallow-core(541 integration tests + 2467 unit tests) all pass,cargo fmt --checkandcargo clippyare clean.
- Reproduced the reported error: Yes — I created a repro project mirroring the issue's
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.5-35B-A3BCompare side by side →
Qwen/Qwen3.5-35B-A3BCompare side by side →