export enum Asefsadfasdf { X }
flags the error "'Asefsadfasdf' is already declared in the upper scope".
(You can even remove the export and the error remains, but of course you will also get an additional "unused" error.)
And yes, nothing else in my codebase uses this name...
"rules": {
"no-shadow": [
"error",
"hoist": "all"
export enum Asefsadfasdf { X }
Expected Result
No error on a unique enum.
Actual Result
The unique enum is flagged with "is already declared in the upper scope".
Versions
package
version
https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#i-am-using-a-rule-from-eslint-core-and-it-doesnt-work-correctly-with-typescript-code
You ticked the box saying you read the FAQ...
If everyone has to make this change to allow exporting of enums
The issue is not with the code at all. Nothing to do with enums being exported.
The issue is with the eslint config.
Read the FAQ article - it explains how to correctly configure your code.
why is it not in the default config?
no-shadow is not a recommended rule in the eslint set, so we do not recommend it in our configs either.
If a user decides to manually turns on no-shadow, there's nothing we can do to stop them
A user has to manually configure our extension rule which understands TS.