# no-empty-static-block

> Disallow empty `static {}` blocks in classes

A `static` block runs once, when the class is defined. An empty one does nothing. It's usually something a refactor left behind, or setup code that was never written.

A block with a comment in it isn't reported.

This rule is on by default.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

On by default as a warning. To turn it off:

```toml bunfig.toml
[lint.rules]
"no-empty-static-block" = "off" # or "error"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```js
class Config {
  static values = new Map();

  static {}
}
```

Not reported:

{/* good */}
```js
class Config {
  static values = new Map();

  static {
    Config.values.set("mode", process.env.NODE_ENV);
  }
}
```

{/* good */}
```js
class Config {
  static {
    // Values are loaded on first use.
  }
}
```
