Skip to content
Fallow home
All docs pages

Docs home

Type-only dependencies

What a type-only-dependency finding of fallow dead-code means, why it matters and how to fix it.

What it reports

Production dependency only used via type-only imports.

Dependencies explains how fallow finds it.

Why it matters

Production dependencies that are only imported via import type statements. These can be moved to devDependencies since they generate no runtime code and are stripped during compilation.

Example

zod is in dependencies but only appears in import type declarations.

Fix

Move the package to devDependencies unless runtime code imports it as a value.

Facts

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

Note. Only reported in --production mode; --unused-deps scopes it together with the other dependency kinds.