14 This rule enforces consistent spacing inside an open block token and the next token on the same line. This rule also enforces consistent spacing inside a close block token and previous token on the same line.
18 This rule has a string option:
20 * `"always"` (default) requires one or more spaces
21 * `"never"` disallows spaces
25 Examples of **incorrect** code for this rule with the default `"always"` option:
30 /*eslint block-spacing: "error"*/
32 function foo() {return true;}
34 function baz() {let i = 0;
39 static {this.bar = 0;}
45 Examples of **correct** code for this rule with the default `"always"` option:
50 /*eslint block-spacing: "error"*/
52 function foo() { return true; }
56 static { this.bar = 0; }
64 Examples of **incorrect** code for this rule with the `"never"` option:
69 /*eslint block-spacing: ["error", "never"]*/
71 function foo() { return true; }
75 static { this.bar = 0; }
81 Examples of **correct** code for this rule with the `"never"` option:
86 /*eslint block-spacing: ["error", "never"]*/
88 function foo() {return true;}
92 static {this.bar = 0;}
100 If you don't want to be notified about spacing style inside of blocks, you can safely disable this rule.