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 plugin in builtin.rs:
Assistant
Now register the module in plugins/mod.rs (module declarations):
Assistant
Now let's build to check compile errors:
Assistant
Compiles fine. Now let's run the tests for this new plugin and related registry tests.
Assistant
Now let's run the full core test suite to check nothing broke, and also check registry tests for plugin count etc.
Assistant
All 2467+541+... tests pass. Now let's also check the CLI/other crates for plugin count expectations or documentation listing plugins (docs, schema.json, migrate/knip_tables.rs) that might need updating.
Assistant
No issues found —
vercel.tsis no longer flagged. Let's confirm this is indeed fixed by testing with the plugin reverted (sanity check) to ensure without our fix it does report the file as unused.Assistant
Confirmed reproduction. Now restore our fix.
Assistant
Both
vercel.tsandvercel.jsare correctly not flagged. Now let's also verify a non-app-root nested vercel.ts (e.g. inside a subfolder) is NOT marked always-used incorrectly (should still only apply at app root per Vercel convention), and check unrelated file still gets flagged as unused to make sure we haven't disabled unused-file detection entirely.Assistant
Both edge cases behave correctly: unrelated unused files are still flagged, and a nested (non-root)
vercel.tsoutside the app root is still flagged, matching Vercel's actual convention (only root-level config files are auto-discovered).Now let's run broader test suites (cli, config, extract) to make sure nothing else broke.
Assistant
Confirmed: this test failure is pre-existing and unrelated to our change (likely fails because the test environment runs as root, so read-only directory permissions don't actually block writes). Let's continue running the rest of the workspace tests, skipping that known-failing test.
Assistant
Confirmed flaky (passes consistently now with our changes too — 1770 passed, 0 failed, three runs in a row). This confirms the earlier failure was a pre-existing flaky/environment-dependent test unrelated to our change, not caused by our fix.
Assistant
All tests pass across the whole workspace (excluding the two known-flaky/pre-existing tests unrelated to our change). Let's clean up temp files and review the final diff.
Assistant
Good, now formatted correctly with no fmt diff outstanding. Let's also run clippy on the new file to check code quality.
Assistant
No clippy warnings. Let's do a final review of the new plugin file and full diff.
Assistant
This looks solid. Let's do one final full-suite verification run to be safe before submission.
Assistant
All tests pass across the entire workspace (the only intentionally skipped test is the pre-existing environment-dependent failure unrelated to this change). Let's review the final diff once more before submitting.
Assistant
This all looks good. Now let me address the checklist explicitly:
Assistant
The fix is complete, well-tested, and verified. Let me submit the changes.
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 →