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
I'll explore the repository to find how Vercel and other framework config entrypoints are marked as always-used.
- Assistant
Let me search more specifically for Vercel-related code and always-used patterns.
- Assistant
Interesting - no vercel mentions found. Let me search plugins more carefully.
- Assistant
Let me look at the plugins directory and how config files are marked as always used.
- Assistant
There's no vercel plugin yet. Checking how similar tools (Next.js, OpenNext) treat config entrypoints.
- Assistant
I'll inspect how simple config plugins are structured and whether Next/OpenNext already cover Vercel.
- Assistant
I'll inspect plugin registration and a simple always-used config plugin pattern.
- Assistant
Checking builtin registration and similar config-entry plugins for the pattern to follow.
- Assistant
Checking how always-used config files interact with the unused-files analysis and reviewing a recent similar plugin test.
- Assistant
Checking monorepo
always_usedpattern conventions and rest of plugin module registration. - Assistant
Looking at nextjs always_used for vercel.json maybe:
- Assistant
Checking how always-used patterns apply in monorepos and whether script enablers need special handling.
- Assistant
Checking how always-used globs are matched relative to package roots:
- Assistant
Let me look at entry_points.rs for how always_used is applied.
- Assistant
Checking how plugins aggregate patterns for workspace packages:
- Assistant
Checking how workspace plugin patterns get rewritten relative to the monorepo root:
- Assistant
Let me look how workspace plugin results prefix always_used patterns
- Assistant
Reading apply_workspace_prefix fully.
- Assistant
I'll inspect the enabler matching logic, then add the Vercel plugin.
- Assistant
I'll create the vercel plugin now. Also need to check if there's documentation listing plugins that needs update - CLAUDE.md or README. The issue says no new interfaces. I'll focus on the code fix.
- Assistant
Looking at tiene builtin_entry_point_role
- Assistant
Creating the Vercel plugin and wiring it into the registry.
- Assistant
Rewriting the plugin cleanly with the
define_plugin!pattern. - Assistant
Overwriting the incomplete file contents.
- Assistant
Registering the module and plugin in the registry.
- Assistant
Fixing the remaining registration edits.
- Assistant
Checking the plugin name list at line 90 and applying remaining edits.
- Assistant
Adding the module declaration and plugin instantiation.
- Assistant
Checking for plugin-count or name-list assertions that need updates:
- Assistant
There's a hard-coded plugin-count test — I'll leave it per the instructions and verify the fix with a compile plus a temporary reproduction.
- Assistant
Need to import PluginResult
- Assistant
Re-running the tests:
- Assistant
Building the CLI and reproducing the reported false positive end-to-end:
- Assistant
Need to check how to run fallow on a directory.
- Assistant
Root case works. Verifying monorepo packaging and config extensions next.
- Assistant
Confirming we don't over-activate without Vercel deps:
- Assistant
Adding script-based activation so
"vercel ..."package scripts enable the plugin without a declared dependency. - Assistant
Re-running tests and checking for a tooling catalogue that should include Vercel:
- Assistant
Rebuilding the CLI to confirm the manual plugin impl still fixes the issue, and checking for clippy cleanups.
- Assistant
Clippy failed due to cwd; re-running from the repo root.
- Assistant
Checking final diff and whether type-only imports are credited:
- Assistant
The new plugin file may be untracked — checking git status:
- Assistant
Staging the new file with intent-to-add so
git diffincludes it for 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
claude-sonnet-5Compare side by side →
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 →