complete/newline-between-switch-case
💼 This rule is enabled in the ✅ recommended config.
📝 Requires newlines between switch cases.
🔧 This rule is automatically fixable by the
--fix CLI option.
Having newlines between each case can make code easier to read, as it better delineates each block.
Based on this rule.
Rule Details
Section titled “Rule Details”This rule does not apply to “fall through” switch cases; those should be squished together with the other cases. See below for an example.
// Badswitch (foo) { case 1: case 2: case 3: { doSomething(); break; } case 4: { doSomething(); break; }}
// Goodswitch (foo) { case 1: case 2: case 3: { doSomething(); break; }
case 4: { doSomething(); break; }}Options
Section titled “Options”This rule is not configurable.
