Closed
Description
Follow-up to #40513, which surfaced an example of export duplicates that should be allowed:
exports.x = undefined
function x() { }
exports.x = x
This pattern is used in the async package's index.js.
Expected behavior:
No error; TS' emit uses this pattern too.
Actual behavior:
Error: "Cannot redeclare exported variable 'x'."
Currently commonjs exports use excludeFlags of SymbolFlags.None instead of SymbolFlags.Alias as normal aliases do. However, most duplicate alias detection happens in the checker already. All exports should switch to None instead of Alias, and then the above undefined
exception can be added in one place in the checker.