Clear and concise description of the problem
Hey there, I'm back with another suggestion: /// keep-sorted for switch statements. The idea comes from this file
Suggested solution
Basic
/// keep-sorted
switch (x) {
case "b":
doB();
break
case "a":
doA();
break;
}
// ->
/// keep-sorted
switch (x) {
case "a":
doA();
break
case "b":
doB();
break;
}
Complex/weird
/// keep-sorted
switch (x) {
case "fallback":
falling();
case "c":
case "b":
common();
break;
case "d":
case "a":
aOrD();
break;
}
// ->
/// keep-sorted
switch (x) {
case "a": // `a` comes before `fallback`
case "d":
aOrD();
break;
case "fallback":
falling();
case "b":
case "c":
common();
break;
}
Alternative
No response
Additional context
No response
Validations
Clear and concise description of the problem
Hey there, I'm back with another suggestion:
/// keep-sortedforswitchstatements. The idea comes from this fileSuggested solution
Basic
Complex/weird
Alternative
No response
Additional context
No response
Validations