-
-
Notifications
You must be signed in to change notification settings - Fork 437
Open
Labels
Description
Description
Consisitent style.
Examples
// ❌
switch(foo) {
case 1: {
doStuff();
}
break;
}
switch(foo) {
case 1:
{
doStuff();
}
break;
}
// ✅
switch(foo) {
case 1: {
doStuff();
break;
}
}Proposed rule name
switch-case-break-position
Additional Info
This can happen when refactoring.
switch(foo) {
case 1:
if (something) {
// ^^^^^^^^^^^^^^ this condition no longer needed.
doStuff();
}
break;
}switch(foo) {
case 1:
{
doStuff1();
}
// ^^^^^^^^^^^^ no longer need this block
{
doStuff2();
}
break;
}Reactions are currently unavailable