Enforces block statements in case blocks
- ⭐️ This rule is included in
plugin:cupcake/recommended
preset.- ✒️ The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
Enforces block statements in case blocks.
This rule is a stricter version of
no-case-declarations
,
to always use blocks in case statements
Examples of incorrect code:
/*eslint cupcake/case-block: error */
switch (foo) {
case 1:
break;
}
Examples of correct code:
/*eslint cupcake/case-block: error */
switch (foo) {
case 1: {
break;
}
}
Nothing.