Disallow or enforce spaces inside of blocks after opening block and before closing block
Some problems reported by this rule are automatically fixable by the --fix
command line option
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.
This rule has a string option:
"always"
(default) requires one or more spaces"never"
disallows spacesExamples of incorrect code for this rule with the default "always"
option:
Examples of correct code for this rule with the default "always"
option:
Examples of incorrect code for this rule with the "never"
option:
Examples of correct code for this rule with the "never"
option:
If you don’t want to be notified about spacing style inside of blocks, you can safely disable this rule.
This rule was introduced in ESLint v1.2.0.
© OpenJS Foundation and other contributors
Licensed under the MIT License.
https://eslint.org/docs/latest/rules/block-spacing