Require or disallow an empty line between class members.
// code-linter.json5
{
"rules": {
"@typescript-eslint/lines-between-class-members": "error"
}
} This rule has two options. The first option can be a string or an object, and the second option must be an object. For details, see eslint/lines-between-class-members.
The second option supports configuring the exceptAfterOverload property, which indicates whether to skip checking for blank lines after overloaded class members. exceptAfterOverload is a Boolean value: when set to true, it means skipping the check; when set to false, it means not skipping the check. The default value is true.
Example:
"@typescript-eslint/lines-between-class-members": [
"error",
"always",
{
"exceptAfterOverload": true
},
] // By default, an empty line is required between class members.
export class Foo {
public baz() {
console.info('baz');
}
public qux() {
console.info('qux');
}
} // By default, an empty line is required between class members.
export class Foo {
public baz() {
console.info('baz');
}
public qux() {
console.info('qux');
}
} plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.