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.
if (condition) {
console.log("Hello");
return 13;
} else {
console.log("Hello");
return 42;
};
if (condition) {
doSomething();
cleanup();
} else {
doSomethingElse();
cleanup();
}console.log("Hello");
if (condition) {
return 13;
} else {
return 42;
};
if (condition) {
doSomething();
} else {
doSomethingElse();
}
cleanup();Popular · 1 of 10
Checks if the if and else blocks contain shared code that can be moved out of the blocks.
if (condition) {
console.log("Hello");
return 13;
} else {
console.log("Hello");
return 42;
};
if (condition) {
doSomething();
cleanup();
} else {
doSomethingElse();
cleanup();
}console.log("Hello");
if (condition) {
return 13;
} else {
return 42;
};
if (condition) {
doSomething();
} else {
doSomethingElse();
}
cleanup();