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
| Fact | Value |
|---|---|
| Issue type | duplicate-export |
| Rule id in SARIF output | fallow/duplicate-export |
| Command | fallow dead-code |
| Default severity | error |
Config key in rules | duplicate-exports |
| Filter option | --duplicate-exports |
| Suppression comment | // fallow-ignore-file duplicate-export |
Fixable with fallow fix | No |
| Opt-in | No |
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-exportabove its export, or add the name toignoreExports.
Notes
Fallow does not report an overlay: a file that has export * from a module and also replaces one of its names.