Skip to content

[no-shadow] False positive on export enum X declaration #2471

Closed
@AArnott

Description

@AArnott
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

git clone https://github.com/AArnott/pr-autocomplete-app
cd pr-autocomplete-app
git checkout eslintbug_2471
yarn
yarn lint

A single export enum in the entire compilation, with no imports, such as this:

export enum MergeMethods3 {
  merge = "merge",
}

Expected Result

No lint errors

Actual Result

/home/andrew/git/pr-autocomplete-app/GitHubHook/index.ts
  1:13  error  'MergeMethods3' is already declared in the upper scope  no-shadow

Additional Info

This regressed in AArnott/pr-autocomplete-app#65 where we upgrade @typescript-eslint/parser from 3.10.1 to 4.0.1.

No matter what I name the enum, it rejects it with the same error.

Versions

package version
@typescript-eslint/eslint-plugin 4.0.1
@typescript-eslint/parser 4.0.1
TypeScript 4.0.2
ESLint 7.8.1
node 12.16.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    fix: user errorissue was fixed by correcting the configuration / correcting the codepackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions