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
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
I’ll first inspect the repository structure and locate the Vercel plugin/config conventions and nearby tests. Then I’ll reproduce the current classification, make the smallest convention-aligned change, and run focused plus broader validation.
- Assistant
The initial search shows no obvious Vercel plugin by name, so I’ll inspect the plugin registry/data model and examples of framework config entrypoints. I’ll also locate plugin-specific unit/integration fixtures to determine whether Vercel activation is already modeled under another plugin or needs a dedicated plugin.
- Assistant
There is currently no Vercel plugin, while plugins expose static
config_patternsandalways_used. Since the expected behavior is conditional on Vercel being active and supports bothverceland@vercel/config, I’ll inspect registration/detection invariants and a small analogous plugin before implementing it consistently. - Assistant
The architecture supports a dedicated static plugin, which is preferable to attaching deployment behavior to Next.js because Vercel can host many frameworks. I’ll verify exact dependency matching semantics and the distinction between config patterns and always-used patterns, then create a
verceldeployment plugin activated by either supported package and protecting only app-root convention files. - Assistant
Activation checks all dependency sections and script-resolved packages, and static patterns are workspace-prefixed during workspace analysis. Thus root-only patterns (
vercel.{…}rather than**/vercel…) correctly become each active workspace’s app root without suppressing arbitrary nested files. I’ll now add the plugin module, register it in the deployment category, and include it in the support-entrypoint invariant because config files are build-time support entrypoints rather than application runtime entrypoints. - Assistant
One nuance is that
vercel.tsimports@vercel/config/v1; merely suppressing the file finding could leave its dependency uncredited if config files were not parsed. Following the OpenNext deployment plugin pattern, the Vercel plugin will both discover/parse the config imports and mark the convention file always used. I’ll use the exact five documented extensions and script activation for thevercelCLI. - Assistant
The source is registered and formatting is clean. Before testing the reproduction, I’ll compile and run plugin registry/unit tests; these include invariants ensuring every built-in plugin has a deliberate coverage role and unique name. This should also reveal whether the support-role list is appropriate for a plugin contributing no ordinary application entry globs.
- Assistant
All 1,012 plugin-focused tests pass, including built-in registry and config-pattern invariants. I’ll now reproduce the reported scenario in a temporary project outside the repository, first using the pre-change source via a temporary worktree if practical, then using the modified CLI. At minimum I’ll verify the modified analyzer does not report
vercel.ts, still reports a control orphan, and recognizes all five extensions in app-root scope. - Assistant
The CLI crate has multiple binaries, so I’ll explicitly build/run
--bin fallow. I’ll use JSON output for deterministic assertions against the temporary reproduction rather than relying on presentation text. - Assistant
I’ll create one temporary package with the issue’s dependencies/scripts and all five supported convention variants plus an unrelated orphan. Although a real project normally uses one config variant, including all variants is useful to validate the glob comprehensively; each should be suppressed while the unrelated file remains reportable.
- Assistant
The modified CLI reports exactly one issue (
src/orphan.ts), zero Vercel config findings, and counts all five config variants as plugin entrypoints. To explicitly satisfy the reproduction requirement rather than relying only on the report, I’ll temporarily save the patch, rebuild the unmodified baseline, confirm it reports the Vercel files, then restore and rebuild the fix. No repository test files will be changed. - Assistant
The baseline reproduction reported all five Vercel files as unused; after restoring the fix, only the control orphan is reported. The exact app-root glob avoids suppressing nested files, while workspace prefixing handles
apps/web/vercel.tswhen that workspace activates Vercel. I’ll now run the full core test suite and Clippy for the affected crate, then review the final diff for accidental changes and scope. - Assistant
Full validation passed: 2,461 unit tests plus integration tests/doc tests in the core package, Clippy with warnings denied, formatting, and diff checks. I’ll do one final semantic review of entrypoint-role assignment and workspace pattern prefixing, and inspect untracked/ignored state so only the intended three source files are submitted.
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
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →