-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[no-unused-vars] False positive: type import used in typeof #2453
Comments
This is stupidly weird and not all what I expect. When I see
Instead for all intents and purposes, TS treats This breaks the assumption that I'd made that all |
I confirm that the error is fixed in 4.0.2-alpha.9. |
Hi, i am still having this bug in 4.0.3 example of my problem // file 1
export type FieldDefinition = {
[key: string]: string[];
};
// file 2
interface FruitsFormDefinition {
apple: string;
orange: string;
}
export type FruitsFieldDefinition = { [K in keyof FruitsFormDefinition]: FieldDefinition[string] };
export const fruitsFieldDefiniton: FruitsFieldDefinition = {
apple: [],
orange: ['isRequired'],
}; the error i get is |
^ made a new ticket, since it's not directly related #2615 |
Repro
.eslintrc.js
tsconfig.json
Expected Result
No lint errors
Actual Result
b.ts 1:15 'foo' is defined but never used. Allowed unused vars must match /^_/u. (@typescript-eslint/no-unused-vars)
Additional Info
Versions
@typescript-eslint/eslint-plugin
4.0.1
@typescript-eslint/parser
4.0.1
TypeScript
4.0.2
ESLint
7.8.0
node
10.16.3
The text was updated successfully, but these errors were encountered: