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 Vercel/plugin configuration patterns and related tests. Then I’ll reproduce the current classification, make the smallest convention-aligned change, and run the focused and broader relevant tests.
- Assistant
ripgrepis unavailable, so I’ll usegrep/find. The repository is Rust-based; I’ll identify plugin definitions and fixture conventions before editing anything. - Assistant
There is currently no dedicated Vercel plugin. I’ll inspect the registry and several small plugins that activate from package dependencies/scripts and mark root config files as entrypoints, plus the integration-test harness so the implementation matches established behavior.
- Assistant
The registry has explicit plugin categories and activation tests. I’ll now read the trait’s static pattern semantics and compact deployment/config plugins in isolation, then locate how config patterns become “always used” in dead-code analysis.
- Assistant
The code distinguishes
config_patterns(files parsed by a plugin) fromalways_used(files exempt from unused reporting). Since Vercel config need not be parsed, a small always-used plugin is appropriate. I’ll verify macro syntax, activation’s dependency/script combination, and whether root-relative patterns are correctly workspace-prefixed. - Assistant
For the reported project, activation should cover both
verceland@vercel/config; script activation by thevercelCLI is also consistent with “when Vercel is active” and existing registry capabilities. I’ll inspect analogous manually implemented plugins and test naming/style, then compile a baseline and use a temporary fixture/CLI invocation to confirm the false positive before changing source. - Assistant
I won’t add or modify repository tests per the task constraints. To reproduce safely, I’ll create a fixture under
/tmp, run the current CLI against it, and remove/leave it outside the repository. I’ll first check CLI usage and build the binary if needed. - Assistant
The CLI is built. I’ll reproduce with an app-root
vercel.ts, a normal imported source entry, and the reported dependencies, requesting JSON unused-file output so the assertion is unambiguous. - Assistant
The false positive is reproduced exactly. I’ll add a dedicated Vercel deployment plugin with:
- dependency activation for
verceland@vercel/config, - script activation for the
vercelCLI, - app/workspace-root patterns for all five documented executable extensions,
- both packages credited as tooling dependencies.
I’ll register it in the module list and built-in deployment category. The registry prefixes root patterns for workspace runs, so a bare
vercel.{...}pattern protects only each active package root rather than arbitrary same-named nested files. - dependency activation for
- Assistant
I confirmed workspace prefixing. I’ll now create the plugin and wire it into the registry. I’ll use brace expansion in one exact root pattern, which covers precisely
ts,js,mjs,cjs, andmtswithout unintentionally matchingvercel.ctsor nested non-root files. - Assistant
The plugin is wired and formatted. Before running the full focused suite, I’ll inspect invariant tests that require every built-in plugin to have an explicit entry-point role/category; because this plugin contributes no entry patterns, it may still need classification in the support list for registry consistency.
- Assistant
All 1,012 plugin-focused unit/registry tests pass, including built-in invariants. Next I’ll rebuild the CLI and verify:
- the original reproduction now has zero unused files,
- every documented extension is protected,
- similarly named unsupported/nested files are not globally suppressed,
- script-only activation works as intended.
- Assistant
The fix now resolves the exact reproduction. All five supported root filenames are protected under script-only activation, while
vercel.ctsandnested/vercel.tsremain reportable, confirming the pattern is neither too narrow nor overly broad.I’ll run the complete
fallow-coretest suite and Clippy for the affected crate, then inspect the final diff/status for unintended changes. - Assistant
The full core suite and Clippy completed successfully, formatting and diff checks are clean, and only the three intended source files are changed. I’ll do one final end-to-end check without the
--unused-filesfilter (to ensure the exportedconfigis not separately flagged) and a monorepo workspace check matchingapps/web/vercel.ts. Then I’ll review the final patch summary and submit.
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 →