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
type X = string | number; // 'X' is defined but never used. 1:6 - 1:7
type Id<T> = T extends { id: infer Id extends X } ? Id : never; // X is used here!
declare function f<T>(value: T, id: Id<T>): void;
f({ id: 1 }, 2);
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/no-unused-vars": ["error"],
},
};
tsconfig
Expected Result
I expected no error.
Actual Result
There was an error on line 1.
Additional Info
This is using the new infer
+ extends
syntax from TypeScript 4.7.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.30.5 |
@typescript-eslint/parser |
5.30.5 |
TypeScript |
4.7.4 |
ESLint |
8.19.0 |
node |
18.4.0 |