Bug: no-unnecessary-type-parameters false positive #11295
Labels
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
working as intended
Issues that are closed as they are working as intended
Uh oh!
There was an error while loading. Please reload this page.
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.8.2&fileType=.tsx&code=MYewdgzgLgBAtgTwGIFczCgS3DAvDAHgBkBDAIwFMAbGCgDygrABMIZoAnTMAcwD4AFFXLUAXDFKUqASjx8YAbwBQMGKEixhUgEzjJ1PDC3UA3CrXgIIKhQB0VEDyEiq26WYC%2BQA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tiacTJTIAhtEK0ipWsRFCAtonyJoqDJCXQO0SODABfELqA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
When a type parameter is used only once in the function signature, but also referenced elsewhere in the function, the error should not be thrown.
Actual Result
tseslint doesn't seem to detect the second reference to the type outside the signature.
Additional Info
const label2: Label = label
is redundant and has no real world use, but it is the minimum code to reproduce it. I've ran into this error a few times when manipulation objects with a value of typeLabel[]
for example.The text was updated successfully, but these errors were encountered: