close

no-empty-static-block

Configuration

rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-empty-static-block': 'error',
    },
  },
]);

Rule Details

Disallow empty class static blocks. Empty static blocks usually indicate that a refactor was left unfinished or that an intentional placeholder needs an explanatory comment.

Examples of incorrect code for this rule:

class Foo {
  static {}
}

class Bar {
  static {
  }
}

Examples of correct code for this rule:

class Foo {
  static {
    initialize();
  }
}

class Bar {
  static {
    // intentionally empty
  }
}

Original Documentation