[New option] lines-between-class-members allow empty lines between properties but not member functions
See original GitHub issueWhat 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:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should absolutely discuss this if and when this syntax reaches stage 4.
In the meantime, the existing
"exceptAfterSingleLine": true
option might be useful.Thanks for the issue
class fields are still in stage 3 and eslint supports proposals which are in stage 4