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 foo(x: number, y: string = "default", z?: number) {
// ...
}
foo(42, undefined); // Noncompliant
foo(42, undefined, undefined); // Noncompliant
foo(42, undefined, 5); // OK, there is no other way to force default value for second parameterfunction foo(x: number, y: string = "default", z?: number) {
// ...
}
foo(42);Popular · 1 of 50
"undefined" should not be passed as the value of optional parameters
function foo(x: number, y: string = "default", z?: number) {
// ...
}
foo(42, undefined); // Noncompliant
foo(42, undefined, undefined); // Noncompliant
foo(42, undefined, 5); // OK, there is no other way to force default value for second parameterfunction foo(x: number, y: string = "default", z?: number) {
// ...
}
foo(42);