X Tutup
Skip to content

no-shadow false positive when used with typescript #126

@stephenotalora

Description

@stephenotalora

hello there 👋🏽

We're actively working to adopt github/recommended and github/typescript rules. Typescript enums are widely used in our repository, however, the recommended GitHub plugin yields a no-shadow error for every enum occurrence.

repro:

export enum DataType {
  Title = 'title',
  Text = 'text',
  Date = 'date',
  // ...
}

export enum SystemId {
  Title = 'Title',
   // ...
}

Expected Result
No lint error since enum has been defined just once.

error(s):
<enum name> is already declared in the upper scope (eslint no-shadow)

version:

package version
eslint-plugin-github ^4.1.3
@typescript-eslint/eslint-plugin ^4.28.3
Typescript ^4.3.4
ESLint ^7.29.0
node v14.17.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup