Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 659 Bytes

no-useless-rest-spread.md

File metadata and controls

31 lines (21 loc) · 659 Bytes

Disallow unnecessary rest/spread operators (no-useless-rest-spread)

(fixable) The --fix option on the command line automatically fixes problems reported by this rule.

Rule Details

Examples of incorrect code for this rule:

/*eslint no-useless-rest-spread: "error"*/

let list = [a, ...[b, c], d]
foo(...[a, b, c])

let [a, b, ...[c, d]] = list;
function foo(a, b, ...[c, d]) {
}

Examples of correct code for this rule:

/*eslint no-useless-rest-spread: "error"*/

let list = [a, b, c, d]
foo(a, b, c)

let [a, b, c, d] = list;
function foo(a, b, c, d) {
}