Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
switch (foo) {
default:
bar();
break;
case "a":
baz();
break;
}
switch (foo) {
case 1:
bar();
break;
default:
baz();
break;
case 2:
quux();
break;
}
switch (foo) {
case "x":
bar();
break;
default:
case "y":
baz();
break;
}
switch (foo) {
// …switch (foo) {
case "a":
baz();
break;
default:
bar();
break;
}
switch (foo) {
case 1:
bar();
break;
case 2:
quux();
break;
default:
baz();
break;
}
switch (foo) {
case "x":
bar();
break;
case "y":
default:
baz();
break;
}
switch (foo) {
// …Popular · 1 of 50
Enforce default clauses in switch statements to be last
switch (foo) {
default:
bar();
break;
case "a":
baz();
break;
}
switch (foo) {
case 1:
bar();
break;
default:
baz();
break;
case 2:
quux();
break;
}
switch (foo) {
case "x":
bar();
break;
default:
case "y":
baz();
break;
}
switch (foo) {
// …switch (foo) {
case "a":
baz();
break;
default:
bar();
break;
}
switch (foo) {
case 1:
bar();
break;
case 2:
quux();
break;
default:
baz();
break;
}
switch (foo) {
case "x":
bar();
break;
case "y":
default:
baz();
break;
}
switch (foo) {
// …