Skip to content

exportUniqueNames

Reports duplicate export names in a module.

✅ This rule is included in the ts untyped presets.

Having multiple exports with the same name creates ambiguity about which value is exported. This can lead to confusion and runtime errors when consuming the module.

export const value = 1;
Error ts(2323) ― Cannot redeclare exported variable 'value'.
export { value };
Error ts(2323) ― Cannot redeclare exported variable 'value'.
Error ts(2484) ― Export declaration conflicts with exported declaration of 'value'.
const
const a: 1
a
= 1;
const
const b: 2
b
= 2;
export { a };
Error ts(2300) ― Duplicate identifier 'a'.
export {
const b: 2
b
as a };
Error ts(2300) ― Duplicate identifier 'a'.

This rule is not configurable.

This rule catches actual errors, so you should generally keep it enabled. TypeScript itself will catch many of these cases, but this rule provides earlier feedback.

Made with ❤️‍🔥 around the world by the Flint team and contributors.