no-shadow bug
Closed this issue · 3 comments
vscode + typescript + eslint,
In TypeScript, when declaring an enum, the no-shadow rule reports an error(xxx is already declared in the upper scope on line 31), which is a false positive; it is actually comparing itself(line 31 is xxx it-self).
Can you please provide steps to reproduce this. Best would be a GitHub repository to clone. This ensures we are looking at the same problem.
vscode version: 1.95.2, eslint plugin version: 3.0.13, .eslinttrc.js use extends:['plugin:vue/vue3-recommended', 'eslint:recommended', '@vue/eslint-config-typescript', '@vue/eslint-config-prettier/skip-formatting', 'plugin:prettier/recommended'], use ts to declaring an enum, like: export enum AA { Yes, No }, the AA will reports an error(AA is already declared in the upper scope on line 31)。This is similar to error:typescript-eslint/typescript-eslint#4337
vscode version: 1.95.2, eslint plugin version: 3.0.13, .eslinttrc.js use extends:['plugin:vue/vue3-recommended', 'eslint:recommended', '@vue/eslint-config-typescript', '@vue/eslint-config-prettier/skip-formatting', 'plugin:prettier/recommended'], use ts to declaring an enum, like: export enum AA { Yes, No }, the AA will reports an error(AA is already declared in the upper scope on line 31)。This is similar to error:typescript-eslint/typescript-eslint#4337
it can deal with this problem: https://typescript-eslint.io/rules/no-shadow/#how-to-use