Skip to content
Fallow home
All docs pages

Docs home

Deprecated exports in use

What a deprecated-export-in-use finding of fallow dead-code means, why it matters and how to fix it.

What it reports

Export marked @deprecated is still referenced.

Dead code explains how fallow finds it.

Why it matters

Exports whose leading JSDoc carries @deprecated and that still have at least one consumer in a reachable file. Each finding lists the exact consumer count, a sample of up to 10 consumers sorted by path and line, and the deprecation message. A deprecated export with no consumer is reported as an unused export instead, marked deprecated. A consumer in an unreachable file does not count, because that file is dead code itself. public_api is true when the export lives in an entry point or a re-export chain reaches one: external consumers are not visible, so the finding makes no removal claim. The rule is opt-in and defaults to off. A per-path override resolves on the file that declares the export, not on the consumer.

Example

/** @deprecated Use formatMoney. */ export function formatPrice() is still imported by src/cart.ts and src/checkout.ts.

Fix

Move each consumer to the replacement the message names, then remove the export. For the full consumer list, run fallow dead-code --trace <file>:<export>. Enable the rule with deprecated-exports-in-use: "warn" in rules, or pass --deprecated-exports-in-use for one run.

Facts

FactValue
Issue typedeprecated-export-in-use
Rule id in SARIF outputfallow/deprecated-export-in-use
Commandfallow dead-code
Default severityoff
Config key in rulesdeprecated-exports-in-use
Filter option--deprecated-exports-in-use
Suppression comment// fallow-ignore-next-line deprecated-export-in-use
Fixable with fallow fixNo
Opt-inYes

Note. Opt-in migration sweep; the rule defaults to off.

When to keep the code

  • When the export is public API (public_api: true in the finding), users outside the project can still use it. Follow your deprecation policy before you remove it.
  • An overrides entry applies to the file that declares the export, not to the file that uses it. You cannot allow the deprecated API only in some folders.