accessor-pairs option to check classes
See original GitHub issueWhat rule do you want to change?
accessor-pairs
Does this change cause the rule to produce more or fewer warnings?
More if the option is set.
How will the change be implemented? (New option, new default behavior, etc.)?
New option.
Please provide some example code that this change will affect:
/*eslint accessor-pairs: ["error", { "class": true }]*/
class foo {
set a(bar) {}
}
What does the rule currently do for this code?
Nothing
What will the rule do after it’s changed?
Warn that the ‘getter is not present’, as it already does for object literals and property descriptors.
I guess there is no reason to skip classes in this rule, the option instead of the default behavior is there just to avoid a breaking change.
Are you willing to submit a pull request to implement this change?
Yes, I’ll be glad to do it. #12062 fix should be merged first.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:10 (10 by maintainers)
Top GitHub Comments
@platinumazure
That was very helpful, now I have a much better understanding of the stage 3 policy 😃
I’ll champion this!