-
-
Notifications
You must be signed in to change notification settings - Fork 75
Fix: make no-unused-vars not reporting enum members #558
Conversation
I wonder if this is the right approach? My thinking: Enums are sort of like objects, and enum values are sort of like object properties. I don't think we check object properties in no-unused-vars. So I feel that enum values also shouldn't be considered variables and shouldn't be added to a variable scope. Maybe this isn't possible for other reasons? Let me know. |
It's better if the enum members behaved like properties. In fact, those close to variables. See also: #552 (comment) |
i'm unsure if this is good way to do it, it will be better if this will be supported by with actual checking if they are used? with that we are leaving users with possibility to turn on/off this |
I think that this approach is fair enough because:
|
The |
no-unused-vars is still turned off for ts, tsx waiting for eslint/typescript-eslint-parser#558
no-unused-vars is still turned off for ts, tsx waiting for eslint/typescript-eslint-parser#558
This issue is causing my team to sprinkle |
there is PR in |
@armano2 @bradzacher Will merging this PR interfere with the plugin's implementation in any way? |
@JamesHenry - I don't think so. In fact, it means we can delete some code! |
Closing this PR since the project has been moved to the TypeScript ESLint organization. Feel free to reopen the PR there. |
This is a small followup for #553.
Currently,
no-unused-vars
rule reports enum members.This behavior is not nice.
This PR makes to set
eslintUsed
flag to the enum member variables, as similar to/* exported */
directive comments. As a result,no-unused-vars
knows the enum members are exported (used on other places).