Test-only dependencies
What a test-only-dependency finding of fallow dead-code means, why it matters and how to fix it.
What it reports
Production dependency only imported by test files.
Dependencies explains how fallow finds it.
Why it matters
Production dependencies that are only imported from test files. These can usually move to devDependencies because production entry points do not require them at runtime.
Example
vitest is listed in dependencies, but only test files import it.
Fix
Move the package to devDependencies unless production code imports it at runtime.
Facts
| Fact | Value |
|---|---|
| Issue type | test-only-dependency |
| Rule id in SARIF output | fallow/test-only-dependency |
| Command | fallow dead-code |
| Default severity | warn |
Config key in rules | test-only-dependencies |
| Filter option | --unused-deps |
Fixable with fallow fix | No |
| Opt-in | No |
Note. Not reported in --production mode (test files are excluded there); --unused-deps scopes it together with the other dependency kinds.