Pattern: Duplicate export
Issue: -
Having multiple exports of the same name creates ambiguity in the codebase and can lead to runtime errors. This happens when directly exporting the same name multiple times or when export conflicts occur through re-exports from other modules.
Example of incorrect code:
let foo;
export { foo };
export * from "./export-all"; // Potential conflict if export-all.js exports foo
Example of correct code:
let foo;
export { foo as foo1 }; // Renamed to avoid conflict
export * from "./export-all";