Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
113
rated 0 times [  114] [ 1]  / answers: 1 / hits: 7478  / 4 Years ago, wed, june 24, 2020, 12:00:00

As I like the "lines-between-class-members" rule, I'd like to enforce spaces between my classes' functions, but in the same time I want the properties declarations packed at the beginning of my classes in the following format:


class Foo {
a: number;
b: number;
c: string;
d: string;

constructor() {
// constructor stuff
}

doSomething() {
// do something
}
}

Is there a way to ignore this rule specifically on types declarations?


More From » typescript

 Answers
16

It seems like you'll have to do this


'lines-between-class-members': [
'error',
'always',
{ 'exceptAfterSingleLine': true },
]

Docs It will skips checks for empty lines after a single-line class member.


[#3385] Monday, June 22, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
byrondonavanc

Total Points: 675
Total Questions: 107
Total Answers: 105

Location: Peru
Member since Fri, Oct 14, 2022
2 Years ago
byrondonavanc questions
;