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
// 'MyDecorator' is defined but never used. ESLint (@typescript-eslint/no-unused-vars)
function MyDecorator<T extends Function>(_target: unknown, _key: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> {
return descriptor;
}
class MyClass {
@MyDecorator
public Foo() {
}
}
// Throw MyClass to the black hole.
void(MyClass)
ESLint Config
{
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_",
"caughtErrors": "none"
}
]
}
}
tsconfig
Expected Result
MyDecorator
is used as decorator of MyClass.Foo
.
Actual Result
'MyDecorator' is defined but never used. ESLint (@typescript-eslint/no-unused-vars)
Additional Info
I've just upgraded TypeScript from 4.7.4 to 4.8.1-rc and this lint error surfaces.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.33.1 |
@typescript-eslint/parser |
5.33.1 |
TypeScript |
4.8.1-rc |
ESLint |
8.22.0 |
node |
16.16.0 |