no-empty-static-block
eslint
SuggestionRecommended
eslint.config.js
export default [
{
rules: {
"no-empty-static-block": "error",
},
},
];class Foo {
static {}
}class Foo {
static {
bar();
}
}
class Bar {
static {
// comment
}
}Examples from the ESLint documentation.
no-empty-static-block
eslint
export default [
{
rules: {
"no-empty-static-block": "error",
},
},
];no-empty-static-block
eslint plugin · correctness
{
"rules": {
"no-empty-static-block": "error"
}
}suspicious/noEmptyBlockStatements
suspicious · since 1.3.0
{
"linter": {
"rules": {
"suspicious": {
"noEmptyBlockStatements": "error"
}
}
}
}Disallow expressions where the operation doesn't affect the value
Disallow let or var variables that are read but never assigned
Disallow invalid regular expression strings in RegExp constructors
Disallow fallthrough of case statements
Disallow multiple spaces in regular expressions