lines-between-class-members
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"lines-between-class-members": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
Require or disallow an empty line between class members
class MyClass {
x;
foo() {
//...
}
bar() {
//...
}
}class MyClass {
x;
foo() {
//...
}
bar() {
//...
}
}class MyClass {
x = 1
;in = 2
}Examples from the ESLint documentation.
lines-between-class-members
eslint
export default [
{
rules: {
"lines-between-class-members": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Require for-in loops to include an if statement
Enforce the use of variables within the scope they are defined
Require var declarations be placed at the top of their containing scope
Require grouped accessor pairs in object literals and classes
Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead