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.
void (() => {})();
function foo() {}
void foo();
declare const box: { value: string };
void box;
void box.value;
void 1;(() => {})();
function foo() {}
foo(); // nothing to discard
function bar(x: number) {
return x * 2;
}
void bar(1);
declare const box: { value: string };
box;
box.value;
void 0;
declare const promise: Promise<number>;
void promise;
declare let x: number;
() => void (x = 1);Popular · 1 of 50
Disallow the void operator except when used to discard a value
void (() => {})();
function foo() {}
void foo();
declare const box: { value: string };
void box;
void box.value;
void 1;(() => {})();
function foo() {}
foo(); // nothing to discard
function bar(x: number) {
return x * 2;
}
void bar(1);
declare const box: { value: string };
box;
box.value;
void 0;
declare const promise: Promise<number>;
void promise;
declare let x: number;
() => void (x = 1);