Skip to content

Latest commit

 

History

History
83 lines (64 loc) · 652 Bytes

no-useless-undefined.md

File metadata and controls

83 lines (64 loc) · 652 Bytes

Disallow useless undefined

This rule is fixable.

Fail

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);

Pass

let foo;
const {foo} = bar;
const noop = () => {};
function foo() {
	return;
}
function* foo() {
	yield;
}
function foo(bar) {
}
function foo({bar}) {
}
foo();