✅ This rule is part of the recommended config.
🔧 This rule is auto-fixable.
let foo = undefined;
const {foo = undefined} = bar;
const noop = () => undefined;
function foo() {
return undefined;
}
function* foo() {
yield undefined;
}
function foo(bar = undefined) {
}
function foo({bar = undefined}) {
}
foo(undefined);
let foo;
const {foo} = bar;
const noop = () => {};
function foo() {
return;
}
function* foo() {
yield;
}
function foo(bar) {
}
function foo({bar}) {
}
foo();
Type: object
Type: boolean
Default: true
Forbid the use of undefined
at the end of function call arguments. Pass checkArguments: false
to disable checking them.
// eslint unicorn/no-useless-undefined: ["error", {"checkArguments": true}]
foo(bar, baz, undefined);
// eslint unicorn/no-useless-undefined: ["error", {"checkArguments": false}]
foo(bar, baz, undefined);
We recommend setting the ESLint array-callback-return
rule option allowImplicit
to true
:
{
"rules": {
"array-callback-return": [
"error",
{
"allowImplicit": true
}
]
}
}