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.
Assistant
Let me analyze the issue:
- The issue is about a false positive "unused file" report for Vercel's
vercel.tsconfig file - Fallow's
dead-codecommand incorrectly reportsvercel.tsas unused - The fix should add Vercel config files (
vercel.ts,vercel.js,vercel.mjs,vercel.cjs,vercel.mts) to patterns that mark them as always-used
Let me first explore the repository structure to understand how it's organized and where the dead-code detection logic lives.
- The issue is about a false positive "unused file" report for Vercel's
Assistant
Let me explore the structure more and look for the dead-code related files.
Assistant
Let me search for files specifically related to "unused files" in the context of dead code detection.
Assistant
Let me explore the relevant files:
Assistant
Let me examine the key files for understanding how unused file detection works:
Assistant
Now let me look at the
is_config_filepredicate:Assistant
Now I understand the issue. The
is_config_filefunction needs to include Vercel config file patterns. Let me also check if there's a Vercel plugin file:Assistant
Let me explore the repository structure first to understand how it's organized.
Assistant
Now I understand the issue clearly. The
is_config_filefunction in/fallow/crates/core/src/analyze/predicates/file.rsdetermines which files are considered config files and excluded from unused file detection. Vercel'svercel.ts(and related extensions) should be added to this list.Let me make the fix:
Assistant
Now I can see the issue clearly. The
is_config_filefunction needs to include Vercel'svercel.tsand related config file patterns. Let me add them to theconfig_patternsarray:Assistant
I need to add Vercel config file patterns to the
config_patternsarray. Based on the issue description, the Vercel programmatic config files are:vercel.ts,vercel.js,vercel.mjs,vercel.cjs, andvercel.mts. I'll add a patternvercel.to match all of these.Assistant
I need to fix my edit command syntax. Let me check the open file first and then properly edit it.
Assistant
Let me fix the edit command syntax. I need to use the proper format.
Assistant
Let me use sed to make the edit instead:
Assistant
I need to add the Vercel config pattern after the
react-router.config.line (line 83). Let me use sed to insert the new line.Assistant
Let me verify the change was applied correctly.
Assistant
The sed command seems to have inserted the content. Let me verify the actual file content more carefully:
Assistant
The edit was applied correctly. Now let me verify the file looks good and add a test case for the new pattern. First, let me build the project to make sure it compiles:
Assistant
The build is in progress. Let me wait for it to complete.
Assistant
The package name uses hyphens instead of underscores. Let me fix that.
Assistant
The code compiles. Now let me run the existing tests to make sure they pass, and then add test cases for the new Vercel config pattern:
Assistant
Let me run the tests for
is_config_filemore broadly:Assistant
All tests pass. Now let me add a test case for the Vercel config pattern. Let me look at the tests in the file:
Assistant
Good. Now let me look at the end of the test section to add a test for Vercel config patterns:
Assistant
Let me look at the last test in the file to understand where to add a new test:
Assistant
Now let me add a test for the Vercel config pattern. I need to insert it before the closing brace of the test module:
Assistant
The test file has the following structure:
- Line 624-627:
config_file_double_dot_prefix_not_matchedtest - Line 628: Closing brace
}of the tests module
I need to add a test case for Vercel config files between line 627 and line 628. Let me use sed to insert the new test.
- Line 624-627:
Assistant
Let me verify the test was added correctly:
Assistant
Let me run the tests to verify everything works:
Assistant
All tests pass. Let me verify the Vercel test was run:
Assistant
The new test is passing. Let me run a broader test suite to ensure everything still works:
Assistant
All 541 tests pass. Let me verify the complete change by looking at the diff:
Assistant
The fix looks complete. Let me summarize what was done:
Summary of Changes
Issue: Vercel's programmatic config files (
vercel.ts,vercel.js,vercel.mjs,vercel.cjs,vercel.mts) were incorrectly reported as "unused files" by Fallow'sdead-codecommand, because they are not imported by application source code.Root Cause: The
is_config_filefunction in/fallow/crates/core/src/analyze/predicates/file.rsdetermines which files should be excluded from unused-file detection. Vercel config patterns were missing from the list.Fix: Added
"vercel.",to theconfig_patternsarray in theis_config_filefunction. This pattern matches all Vercel programmatic config file extensions (.ts,.js,.mjs,.cjs,.mts), following the same prefix-matching convention used by other framework config patterns like"next.config.","nuxt.config.", etc.Test Added: A new test case
config_file_vercel_programmatic_configverifies that all Vercel programmatic config files are correctly identified as config files.Assistant
Let me try the submit command properly.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.