This rule enforces consistent spacing inside single-line blocks.
This rule has a string option:
"always"
(default) requires one or more spaces"never"
disallows spaces
Examples of incorrect code for this rule with the default "always"
option:
/*eslint block-spacing: "error"*/
function foo() {return true;}
if (foo) { bar = 0;}
Examples of correct code for this rule with the default "always"
option:
/*eslint block-spacing: "error"*/
function foo() { return true; }
if (foo) { bar = 0; }
Examples of incorrect code for this rule with the "never"
option:
/*eslint block-spacing: ["error", "never"]*/
function foo() { return true; }
if (foo) { bar = 0;}
Examples of correct code for this rule with the "never"
option:
/*eslint block-spacing: ["error", "never"]*/
function foo() {return true;}
if (foo) {bar = 0;}
If you don't want to be notified about spacing style inside of blocks, you can safely disable this rule.