empty-brace-spaces
UnreleasedConfiguration
Rule Details
Enforce no spaces between braces.
Empty blocks and object literals do not need internal whitespace, so this rule enforces a compact, consistent style. It applies to block statements, class bodies, static blocks, and object literals whose braces hold nothing but whitespace.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
The rule has no options. It is automatically fixable by removing the whitespace between the braces.
A comment between the braces counts as content, so the whitespace around it is left untouched:
A brace pair in a class header is not mistaken for the class body: class Foo extends mixin({}) { } reports the body's space and fixes it to class Foo extends mixin({}) {}, and a header pair that is itself empty is reported
separately.
Differences from ESLint
None.