Skip to content

[no-shadow] False positive for enum #2360

@mshustov

Description

@mshustov

Repro

I created a repo to reproduce the problem https://github.com/restrry/typescript-eslint-scope-bug

{
  "rules": {
    "@typescript-eslint/no-shadow": "error"
  }
}
enum Direction {
    left = 'left',
    right = 'right',
}

Expected Result
No errors reported.

Actual Result
1:6 error 'Direction' is already declared in the upper scope @typescript-eslint/no-shadow

Versions

package version
@typescript-eslint/eslint-plugin 4.0.0-alpha.5
@typescript-eslint/parser 4.0.0-alpha.5
TypeScript 3.9.5
ESLint 6.8.0
node 10.21.0
npm N/A
yarn 1.21.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions