Skip to content
Fallow home
All docs pages

Docs home

Duplicate exports

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

What it reports

Export name appears in multiple modules.

Dead code explains how fallow finds it.

Why it matters

The same export name is defined in multiple modules. Consumers may import from the wrong module, leading to subtle bugs. Consider renaming or consolidating.

Example

Button is exported from both src/ui/button.ts and src/components/button.ts.

Fix

Rename or consolidate the exports so consumers have one intentional import target.

Facts

FactValue
Issue typeduplicate-export
Rule id in SARIF outputfallow/duplicate-export
Commandfallow dead-code
Default severityerror
Config key in rulesduplicate-exports
Filter option--duplicate-exports
Suppression comment// fallow-ignore-file duplicate-export
Fixable with fallow fixNo
Opt-inNo

Note. fallow fix can add an ignoreExports rule to the fallow config instead of editing source.

When to keep the code

  • A wrapper exports its own version of a name that it imports from another file. Fallow reports this pair, because importers see two exports with different behavior. To keep the wrapper, add // fallow-ignore-next-line duplicate-export above its export, or add the name to ignoreExports.

Notes

Fallow does not report an overlay: a file that has export * from a module and also replaces one of its names.