padded-blocks
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"padded-blocks": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
if (a) {
b();
}
if (a) { b(); }
if (a)
{
b();
}
if (a) {
b();
}
if (a) {
// comment
b();
}
class C {
static {
a();
}
}if (a) {
b();
}
if (a)
{
b();
}
if (a) {
b();
}
if (a) {
b();
}
class C {
static {
a();
}
}if (a) {
b();
}
if (a)
{
b();
}
if (a) {
b();
}
if (a) {
b();
}
class C {
static {
a();
}
}if (a) {
b();
}
if (a)
{
b();
}
if (a) {
// comment
b();
}
class C {
static {
a();
}
}if (a) {
b();
}
if (a)
{
b();
}
class C {
static {
a();
}
}if (a) {
b();
}
if (a)
{
b();
}
class C {
static {
a();
}
}
class D {
static {
a();
}
}Examples from the ESLint documentation.
padded-blocks
eslint
export default [
{
rules: {
"padded-blocks": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce the use of variables within the scope they are defined
Require for-in loops to include an if statement
Disallow the use of alert, confirm, and prompt