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.
function doSomething(condition) {
if (condition) {
return true;
} else {
return;
}
}
function doSomethingElse(condition) {
if (condition) {
return true;
}
}function doSomething(condition) {
if (condition) {
return true;
} else {
return false;
}
}
function Foo() {
if (!(this instanceof Foo)) {
return new Foo();
}
this.a = 0;
}Popular · 1 of 1
Require return statements to either always or never specify values
function doSomething(condition) {
if (condition) {
return true;
} else {
return;
}
}
function doSomethingElse(condition) {
if (condition) {
return true;
}
}function doSomething(condition) {
if (condition) {
return true;
} else {
return false;
}
}
function Foo() {
if (!(this instanceof Foo)) {
return new Foo();
}
this.a = 0;
}