Closed mqwerty closed 1 month ago
Just stumbled upon the problem, would really like a fix
This is done for security reasons.
Example:
// a.js
export function func {
return 1
}
// b.js
export function func {
return 2
}
Depending on the priority, we will have different function values.
We intentionally do not sort exports with an *
because there may be conflicts.
Actually, this problem doesn’t exist in TypeScript because these conflicts are immediately visible. Maybe we could consider implementing sorting just for ts files?
Could you please demonstrate what the conflicts look like in the TS files?
// a.ts
export function func () {
return 1
}
// b.ts
export function func () {
return 2
}
And if you had put exports in index.ts like this
export * from './b'
export * from './a'
You'd get a TS error:
Module './b' has already exported a member named 'func'. Consider explicitly re-exporting to resolve the ambiguity.ts(2308)
Describe the bug
sort-exports rule does not work for 'export *'
Code example
ESLint version
8.57.0
ESLint Plugin Perfectionist version
2.6.0
Additional comments
No response
Validations