question-mark
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.

[New option] lines-between-class-members allow empty lines between properties but not member functions

See original GitHub issue

What rule do you want to change?

lines-between-class-members

Does this change cause the rule to produce more or fewer warnings?

depends

How will the change be implemented? (New option, new default behavior, etc.)?

default behavior as is

new additional option

Please provide some example code that this change will affect:

// Lint rule turned on, but no necessary blank lines between properties / instance fields so they can grouped together
class ClassWithInstanceField {
  fieldA = 'Field A'
  fieldB = this.fieldA

  fieldC = 42

  instanceMethodA() {
    return 'abc'
  }

  instanceMethodB() {
    return 'def'
  }
}

What does the rule currently do for this code?

Instance methods should have blank lines but properties can be grouped together

What will the rule do after it’s changed?

No warnings for missing blank lines between properties

Are you willing to submit a pull request to implement this change?

Don’t know if I’m experienced enought with eslint code-base
If someone guide me to a file and say what needs to be changed, I could try

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mdjermanoviccommented, May 14, 2020

We should absolutely discuss this if and when this syntax reaches stage 4.

In the meantime, the existing "exceptAfterSingleLine": true option might be useful.

2reactions
anikethsahacommented, May 13, 2020

Thanks for the issue

class fields are still in stage 3 and eslint supports proposals which are in stage 4

Read more comments on GitHub >

github_iconTop Results From Across the Web

lines-between-class-members
This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the...
Read more >
[lines-between-class-members] Add @typescript-eslint ...
[New option] lines-between-class-members allow empty lines between properties but not member functions eslint/eslint#13295.
Read more >
lines-between-class-members | typescript-eslint
This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the...
Read more >
"lines-between-class-members" ESLint Error When ...
Docs It will skips checks for empty lines after a single-line class member. Share.
Read more >
Require or disallow an empty line between class members ...
This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the ......
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found