-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[no-unused-vars] false-positive for class expressions #2831
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
Comments
that's an interesting pattern I've never seen before. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I have a very similar case. Only difference is that the class is declared as an object property instead of an array element, and the object is exported for use in other files. export const objectWithClasses = {
controller: class MyClass { //warning: 'MyClass' is defined but never used
//...
}
} I assume this is the same problem, but I can open a new issue if desired. |
@derekparsons718 - yup that's the same issue with class expressions. |
Assume this is the same too:
|
Yep that one as well, just ran into that exact issue. |
Just added the examples above into the origin issue description. In case someone else ran into the same cases. |
@bradzacher I can confirm that version 4.9.1 fixes this issue. Thanks for your help. |
@bradzacher |
That is strange because I run through all the examples (including yours) and it seems to be okay. Can you check your lock files (e.g. |
Yup - working fine against master. |
Sorry! I made a mistake and had accidentally reverted the dependabot branch to 2.9.0 |
Repro
Thanks for @derekparsons718 and @lukeapage for more examples.
Expected Result
No warning.
Actual Result
Additional Info
If I downgrade
@typescript-eslint/eslint-plugin
and@typescript-eslint/parser
to version4.8.2
, no warning occurs.Versions
@typescript-eslint/eslint-plugin
4.9.0
@typescript-eslint/parser
4.9.0
TypeScript
4.1.2
ESLint
7.14.0
node
15.2.1
The text was updated successfully, but these errors were encountered: