Closed chirokas closed 1 month ago
I think we should add a check that these are TS or TSX files. For javascript files, this behavior looks unsafe.
That has nothing to do with sort-exports
.
If there are two wildcard exports statements that implicitly re-export the same name, neither one is re-exported.
// -- mod1.js --
export const a = 1
// -- mod2.js --
export const a = 3
// -- barrel.js --
export * from './mod1.js'
export * from './mod2.js'
// -- main.js --
import * as ns from './barrel.js'
console.log(ns.a) // undefined
Attempting to import the duplicate name directly will throw an error.
import { a } from './barrel.js'
// Uncaught SyntaxError: The requested module './barrel.js' contains conflicting star exports for name 'a'
Okay. Thank you!
Description
Fixes #119 .
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).