Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

accessor-pairs option to check classes

See original GitHub issue

What rule do you want to change?


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?


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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

mdjermanoviccommented, Aug 8, 2019


That was very helpful, now I have a much better understanding of the stage 3 policy 😃

kaicataldocommented, Aug 5, 2019

I’ll champion this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

accessor-pairs - ESLint - Pluggable JavaScript Linter
This rule always checks object literals and property descriptors. By default, it also checks class declarations and class expressions. Options. setWithoutGet ...
Read more >
Grouped-accessor-pairs - ESLint - W3cubDocs
Require grouped accessor pairs in object literals and classes ... See accessor-pairs if you also want to enforce getter/setter pairs.
Read more >
Class Registration - University of South Florida
Log in to view your registration appointment time and prepare to register for classes through OASIS following the steps and using the helpful...
Read more >
Disallow Early Use (no-use-before-define) - ESLint - Breword 文档集合
This rule accepts "nofunc" string as an option. "nofunc" is the same as { "functions": false, "classes": true, "variables": true } .
Read more >
digitalrevolution/accessorpair-constraint - Packagist
Digital Revolution PHPUnit Constraint for accessorpairs. ... Optionally, the asserter can also check the initial values of all your class properties and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found