Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
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 havesearched for related issues and found none that matched my issue.
- I haveread 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."functiontestFail1<Fextends(...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
{"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 twoargs
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 |