Skip to content
Fallow home
All docs pages

Docs home

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

FactValue
Issue typetest-only-dependency
Rule id in SARIF outputfallow/test-only-dependency
Commandfallow dead-code
Default severitywarn
Config key in rulestest-only-dependencies
Filter option--unused-deps
Fixable with fallow fixNo
Opt-inNo

Note. Not reported in --production mode (test files are excluded there); --unused-deps scopes it together with the other dependency kinds.