1 # Disallow or enforce spaces inside of blocks after opening block and before closing block (block-spacing)
5 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.
9 This rule has a string option:
11 * `"always"` (default) requires one or more spaces
12 * `"never"` disallows spaces
16 Examples of **incorrect** code for this rule with the default `"always"` option:
19 /*eslint block-spacing: "error"*/
21 function foo() {return true;}
23 function baz() {let i = 0;
28 Examples of **correct** code for this rule with the default `"always"` option:
31 /*eslint block-spacing: "error"*/
33 function foo() { return true; }
39 Examples of **incorrect** code for this rule with the `"never"` option:
42 /*eslint block-spacing: ["error", "never"]*/
44 function foo() { return true; }
48 Examples of **correct** code for this rule with the `"never"` option:
51 /*eslint block-spacing: ["error", "never"]*/
53 function foo() {return true;}
59 If you don't want to be notified about spacing style inside of blocks, you can safely disable this rule.