Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
// Fails with "'args' is already declared in the upper scope on line 2 column 65."
function testFail1<F extends (...args: any[]) => any>(fn: F, ...args: any[]) {
return [fn, args];
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error"
},
};
tsconfig
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
package | version |
---|---|
@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 |
{ "compilerOptions": { } }