[no-shadow] false positive for class static generics #3312
Labels
duplicate
This issue or pull request already exists
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
Expected Result
No ESLint errors about shadowed name.
The generic parameter of a class is not available in static functions, thus there is no real shadowing:
Renaming the static members will reduce readability, as the function and meaning of the generic parameter is the same.
The use case is very similar to a class member and a member function parameter, which is allowed, and rightly so:
This issue was mentioned as part of #2480 (2.), but I suspect it was overlooked.
Actual Result
'K' is already declared in the upper scope. eslint(@typescript-eslint/no-shadow)
Versions
@typescript-eslint/eslint-plugin-tslint
4.22.0
@typescript-eslint/parser
4.22.0
TypeScript
3.9.9
ESLint
7.24.0
node
12.19.1
The text was updated successfully, but these errors were encountered: