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.
const a = 3;
function b() {
const a = 10;
}
const c = function () {
const a = 10;
}
function d(a) {
a = 10;
}
d(a);
if (true) {
const a = 5;
}
const f = wrap(function f() {});
const C = wrap(class C {});const a = 3;
function b(c) {
const d = 10;
if (c) {
const e = 20;
}
}
/*
* Function and class names are allowed to shadow a variable
* if the function/class expression is assigned to the variable
* as its initializer or default value.
*/
const f = function f() {};
const g = foo ? (bar || function g() {}) : baz;
const { h = function h() {} } = obj;
function qux(i = function i() {}) {}
const C = class C {};Popular · 1 of 50
Disallow variable declarations from shadowing variables declared in the outer scope
const a = 3;
function b() {
const a = 10;
}
const c = function () {
const a = 10;
}
function d(a) {
a = 10;
}
d(a);
if (true) {
const a = 5;
}
const f = wrap(function f() {});
const C = wrap(class C {});const a = 3;
function b(c) {
const d = 10;
if (c) {
const e = 20;
}
}
/*
* Function and class names are allowed to shadow a variable
* if the function/class expression is assigned to the variable
* as its initializer or default value.
*/
const f = function f() {};
const g = foo ? (bar || function g() {}) : baz;
const { h = function h() {} } = obj;
function qux(i = function i() {}) {}
const C = class C {};