Bug: [typescript-eslint/no-shadow] Rest (...args) parameter name in generic declaration shadows actual parameter name #5853
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=4.8.4&sourceType=module&code=PTAEDEEMEsBsGdQHdoBcAWoBEBySAnAc3h1GkUlnwFNIATAT1DuoGNYDq6yA7UDaqACuABxHV8oeKwD240DL6xoPQQCZQs2EIC2fAGwBWAHRYAUADMhPVqmiL+1eKihwAjAB5woagA9U1Dx0iAAUxuEExABcoJA8DADaALoAlKAAvAB8sfGZIRY8MeAANKDhxpHwMXGJqaAA3magoDSoQvh8CQWllUkA3GYAvmZmIBAwCMhomHhEJGQUVLSMzGwcNNwq-OiCouKS0nKCDsqqoADsmjLaeqD6asaW1rb2fAHOrrBqXj7+gcGgMIRObVeLJNJZHIMPIFIo9EFQ8ENJotahtDqgLo8eHEfpDEZjAAiMicoB4MlQoAsEyeNjsDneqAA6jJ8ABreA-PwBIKhSqghgQ7I1GGFCClcr8xF1RrNVrtTrdWJzPHDIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUBILkB2A9gLTIAWAhgCYEDu6UBAZo5ADQg6QACALgJ4AHFAGNoASwE8iKeGLw8A9IRIVqdDJETRoBaJHBgAviENA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYwYAviDUA
Repro Code
ESLint Config
tsconfig
{ "compilerOptions": { } }
Expected Result
I expect no errors.
Actual Result
I get the error
'args' is already declared in the upper scope on line 2 column 65.
Additional Info
The argument name in the generic has no effect on the rest of the code. Granted, it's a bit confusing to read, because the two
args
are completely unrelated, but there's no shadowing going on here.Versions
@typescript-eslint/eslint-plugin
5.40.1
@typescript-eslint/parser
5.40.1
TypeScript
4.7.4
ESLint
8.25.0
node
16.18.0
The text was updated successfully, but these errors were encountered: