The actual snapshot is saved in prefer-spread.mjs.snap
.
Generated by AVA.
1 | const x = Array.from(set);
Output
`␊
1 | const x = [...set];␊
`
Error 1/1
`␊
> 1 | const x = Array.from(set);␊
| ^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from(set).map(() => {});
Output
`␊
1 | [...set].map(() => {});␊
`
Error 1/1
`␊
> 1 | Array.from(set).map(() => {});␊
| ^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from(set, mapFn).reduce(() => {});
Output
`␊
1 | [...set].map(mapFn).reduce(() => {});␊
`
Error 1/1
`␊
> 1 | Array.from(set, mapFn).reduce(() => {});␊
| ^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from(set, mapFn, thisArg).reduce(() => {});
Output
`␊
1 | [...set].map(mapFn, thisArg).reduce(() => {});␊
`
Error 1/1
`␊
> 1 | Array.from(set, mapFn, thisArg).reduce(() => {});␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from(set, () => {}, thisArg).reduce(() => {});
Output
`␊
1 | [...set].map(() => {}, thisArg).reduce(() => {});␊
`
Error 1/1
`␊
> 1 | Array.from(set, () => {}, thisArg).reduce(() => {});␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from(new Set([1, 2])).map(() => {});
Output
`␊
1 | [...new Set([1, 2])].map(() => {});␊
`
Error 1/1
`␊
> 1 | Array.from(new Set([1, 2])).map(() => {});␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from(document.querySelectorAll("*")).map(() => {});
Output
`␊
1 | [...document.querySelectorAll("*")].map(() => {});␊
`
Error 1/1
`␊
> 1 | Array.from(document.querySelectorAll("*")).map(() => {});␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = []
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = []␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = []␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = "1"
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = "1"␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = "1"␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = null
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = null␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = null␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = true
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = true␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = true␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = 1
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = 1␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = 1␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = /./
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = /./␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = /./␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = /./g
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = /./g␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = /./g␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = bar
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = bar␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = bar␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = bar.baz
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = bar.baz␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = bar.baz␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | function* foo() {
2 | yield Array.from(arrayLike).forEach(doSomething)
3 | }
Output
`␊
1 | function* foo() {␊
2 | yield [...arrayLike].forEach(doSomething)␊
3 | }␊
`
Error 1/1
`␊
1 | function* foo() {␊
> 2 | yield Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
3 | }␊
`
1 | const foo = `bar`
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = \`bar\`␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = \`bar\`␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = [];
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = [];␊
2 | [...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = [];␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | for (const key of Array.from(arrayLike)) {
2 | }
Output
`␊
1 | for (const key of [...arrayLike]) {␊
2 | }␊
`
Error 1/1
`␊
> 1 | for (const key of Array.from(arrayLike)) {␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
2 | }␊
`
1 | for (const key in Array.from(arrayLike)) {
2 | }
Output
`␊
1 | for (const key in [...arrayLike]) {␊
2 | }␊
`
Error 1/1
`␊
> 1 | for (const key in Array.from(arrayLike)) {␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
2 | }␊
`
1 | const foo = `${Array.from(arrayLike)}`
Output
`␊
1 | const foo = \`${[...arrayLike]}\`␊
`
Error 1/1
`␊
> 1 | const foo = \`${Array.from(arrayLike)}\`␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | async function foo(){
2 | return await Array.from(arrayLike)
3 | }
Output
`␊
1 | async function foo(){␊
2 | return await [...arrayLike]␊
3 | }␊
`
Error 1/1
`␊
1 | async function foo(){␊
> 2 | return await Array.from(arrayLike)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
3 | }␊
`
1 | foo()
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | foo()␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | foo()␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | const foo = {}
2 | Array.from(arrayLike).forEach(doSomething)
Output
`␊
1 | const foo = {}␊
2 | ;[...arrayLike].forEach(doSomething)␊
`
Error 1/1
`␊
1 | const foo = {}␊
> 2 | Array.from(arrayLike).forEach(doSomething)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array).from(foo)
Output
`␊
1 | [...foo]␊
`
Error 1/1
`␊
> 1 | (Array).from(foo)␊
| ^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array.from)(foo)
Output
`␊
1 | [...foo]␊
`
Error 1/1
`␊
> 1 | (Array.from)(foo)␊
| ^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | ((Array).from)(foo)
Output
`␊
1 | [...foo]␊
`
Error 1/1
`␊
> 1 | ((Array).from)(foo)␊
| ^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array).from((0, foo))
Output
`␊
1 | [...(0, foo)]␊
`
Error 1/1
`␊
> 1 | (Array).from((0, foo))␊
| ^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array.from)((0, foo))
Output
`␊
1 | [...(0, foo)]␊
`
Error 1/1
`␊
> 1 | (Array.from)((0, foo))␊
| ^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | ((Array).from)((0, foo))
Output
`␊
1 | [...(0, foo)]␊
`
Error 1/1
`␊
> 1 | ((Array).from)((0, foo))␊
| ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array).from(foo, bar)
Output
`␊
1 | ([...foo]).map(bar)␊
`
Error 1/1
`␊
> 1 | (Array).from(foo, bar)␊
| ^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array.from)(foo, bar)
Output
`␊
1 | ([...foo].map)(bar)␊
`
Error 1/1
`␊
> 1 | (Array.from)(foo, bar)␊
| ^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | ((Array).from)(foo, bar)
Output
`␊
1 | (([...foo]).map)(bar)␊
`
Error 1/1
`␊
> 1 | ((Array).from)(foo, bar)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array).from((0, foo), bar)
Output
`␊
1 | ([...(0, foo)]).map(bar)␊
`
Error 1/1
`␊
> 1 | (Array).from((0, foo), bar)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array.from)((0, foo), bar)
Output
`␊
1 | ([...(0, foo)].map)(bar)␊
`
Error 1/1
`␊
> 1 | (Array.from)((0, foo), bar)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | ((Array).from)((0, foo), bar)
Output
`␊
1 | (([...(0, foo)]).map)(bar)␊
`
Error 1/1
`␊
> 1 | ((Array).from)((0, foo), bar)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array).from(foo, bar, baz)
Output
`␊
1 | ([...foo]).map(bar, baz)␊
`
Error 1/1
`␊
> 1 | (Array).from(foo, bar, baz)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array.from)(foo, bar, baz)
Output
`␊
1 | ([...foo].map)(bar, baz)␊
`
Error 1/1
`␊
> 1 | (Array.from)(foo, bar, baz)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | ((Array).from)(foo, bar, baz)
Output
`␊
1 | (([...foo]).map)(bar, baz)␊
`
Error 1/1
`␊
> 1 | ((Array).from)(foo, bar, baz)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array).from((0, foo), bar, baz)
Output
`␊
1 | ([...(0, foo)]).map(bar, baz)␊
`
Error 1/1
`␊
> 1 | (Array).from((0, foo), bar, baz)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | (Array.from)((0, foo), bar, baz)
Output
`␊
1 | ([...(0, foo)].map)(bar, baz)␊
`
Error 1/1
`␊
> 1 | (Array.from)((0, foo), bar, baz)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | ((Array).from)((0, foo), bar, baz)
Output
`␊
1 | (([...(0, foo)]).map)(bar, baz)␊
`
Error 1/1
`␊
> 1 | ((Array).from)((0, foo), bar, baz)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from(a, (0, bar), (0, baz),)
Output
`␊
1 | [...a].map((0, bar), (0, baz),)␊
`
Error 1/1
`␊
> 1 | Array.from(a, (0, bar), (0, baz),)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from(a ? b : c)
Output
`␊
1 | [...(a ? b : c)]␊
`
Error 1/1
`␊
> 1 | Array.from(a ? b : c)␊
| ^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from([...a, ...b], b, c)
Output
`␊
1 | [...a, ...b].map(b, c)␊
`
Error 1/1
`␊
> 1 | Array.from([...a, ...b], b, c)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from([1])
Output
`␊
1 | [1]␊
`
Error 1/1
`␊
> 1 | Array.from([1])␊
| ^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | Array.from([...a, ...b])
Output
`␊
1 | [...a, ...b]␊
`
Error 1/1
`␊
> 1 | Array.from([...a, ...b])␊
| ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | /* 1 */ Array /* 2 */ .from /* 3 */ ( /* 4 */ a /* 5 */, /* 6 */ b /* 7 */, /* 8 */ c /* 9 */,)
Output
`␊
1 | /* 1 */ [...a] /* 2 */ .map /* 3 */ ( /* 4 */ /* 5 *//* 6 */ b /* 7 */, /* 8 */ c /* 9 */,)␊
`
Error 1/1
`␊
> 1 | /* 1 */ Array /* 2 */ .from /* 3 */ ( /* 4 */ a /* 5 */, /* 6 */ b /* 7 */, /* 8 */ c /* 9 */,)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | /* 1 */ Array /* 2 */ .from /* 3 */ ( /* 4 */ a /* 5 */,)
Output
`␊
1 | /* 1 */ [...a]␊
`
Error 1/1
`␊
> 1 | /* 1 */ Array /* 2 */ .from /* 3 */ ( /* 4 */ a /* 5 */,)␊
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
1 | [1].concat(2)
Output
`␊
1 | [1, 2]␊
`
Error 1/1
`␊
> 1 | [1].concat(2)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1].concat([2, 3])
Output
`␊
1 | [1, 2, 3]␊
`
Error 1/1
`␊
> 1 | [1].concat([2, 3])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1].concat(2,)
Output
`␊
1 | [1, 2]␊
`
Error 1/1
`␊
> 1 | [1].concat(2,)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1].concat([2, ...bar],)
Output
`␊
1 | [1, 2, ...bar]␊
`
Error 1/1
`␊
> 1 | [1].concat([2, ...bar],)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1,].concat(2)
Output
`␊
1 | [1, 2,]␊
`
Error 1/1
`␊
> 1 | [1,].concat(2)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1,].concat([2, 3])
Output
`␊
1 | [1, 2, 3,]␊
`
Error 1/1
`␊
> 1 | [1,].concat([2, 3])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1,].concat(2,)
Output
`␊
1 | [1, 2,]␊
`
Error 1/1
`␊
> 1 | [1,].concat(2,)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1,].concat([2, 3],)
Output
`␊
1 | [1, 2, 3,]␊
`
Error 1/1
`␊
> 1 | [1,].concat([2, 3],)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | (( (( (( [1,] )).concat ))( (([2, 3])) ,) ))
Output
`␊
1 | (( (( (( [1, 2, 3,] )) )) ))␊
`
Error 1/1
`␊
> 1 | (( (( (( [1,] )).concat ))( (([2, 3])) ,) ))␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | (( (( (( [1,] )).concat ))( (([2, 3])) , bar ) ))
Output
`␊
1 | (( (( (( [1, 2, 3,] )).concat ))( bar ) ))␊
`
Error 1/1
`␊
> 1 | (( (( (( [1,] )).concat ))( (([2, 3])) , bar ) ))␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat(2)
Output
`␊
1 | [...foo, 2]␊
`
Error 1/1
`␊
> 1 | foo.concat(2)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat([2, 3])
Output
`␊
1 | [...foo, 2, 3]␊
`
Error 1/1
`␊
> 1 | foo.concat([2, 3])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat(2,)
Output
`␊
1 | [...foo, 2]␊
`
Error 1/1
`␊
> 1 | foo.concat(2,)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat([2, 3],)
Output
`␊
1 | [...foo, 2, 3]␊
`
Error 1/1
`␊
> 1 | foo.concat([2, 3],)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | (( (( ((foo)).concat ))( (([2, 3])) ,) ))
Output
`␊
1 | (( (( [...((foo)), 2, 3] )) ))␊
`
Error 1/1
`␊
> 1 | (( (( ((foo)).concat ))( (([2, 3])) ,) ))␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | (( (( ((foo)).concat ))( (([2, 3])) , bar ) ))
Output
`␊
1 | (( (( [...((foo)), 2, 3].concat ))( bar ) ))␊
`
Error 1/1
`␊
> 1 | (( (( ((foo)).concat ))( (([2, 3])) , bar ) ))␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | bar()
2 | foo.concat(2)
Output
`␊
1 | bar()␊
2 | ;[...foo, 2]␊
`
Error 1/1
`␊
1 | bar()␊
> 2 | foo.concat(2)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | const foo = foo.concat(2)
Output
`␊
1 | const foo = [...foo, 2]␊
`
Error 1/1
`␊
> 1 | const foo = foo.concat(2)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | const foo = () => foo.concat(2)
Output
`␊
1 | const foo = () => [...foo, 2]␊
`
Error 1/1
`␊
> 1 | const foo = () => foo.concat(2)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | const five = 2 + 3;
2 | foo.concat(five);
Output
`␊
1 | const five = 2 + 3;␊
2 | [...foo, five];␊
`
Error 1/1
`␊
1 | const five = 2 + 3;␊
> 2 | foo.concat(five);␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | const array = [2 + 3];
2 | foo.concat(array);
Output
`␊
1 | const array = [2 + 3];␊
2 | [...foo, ...array];␊
`
Error 1/1
`␊
1 | const array = [2 + 3];␊
> 2 | foo.concat(array);␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat([bar])
Output
`␊
1 | [...foo, bar]␊
`
Error 1/1
`␊
> 1 | foo.concat([bar])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat(bar)
Error 1/1
`␊
> 1 | foo.concat(bar)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/3: First argument is an \`array\`.␊
1 | [...foo, ...bar]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/3: First argument is not an \`array\`.␊
1 | [...foo, bar]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 3/3: Test first argument with \`Array.isArray(…)\`.␊
1 | [...foo, ...(Array.isArray(bar) ? bar : [bar])]␊
`
1 | Array.from(set).concat([2, 3])
Output
`␊
1 | [...set, 2, 3]␊
`
Error 1/2
`␊
> 1 | Array.from(set).concat([2, 3])␊
| ^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`
Error 2/2
`␊
> 1 | Array.from(set).concat([2, 3])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat([2, 3]).concat(4)
Output
`␊
1 | [...foo, 2, 3, 4]␊
`
Error 1/2
`␊
> 1 | foo.concat([2, 3]).concat(4)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
Error 2/2
`␊
> 1 | foo.concat([2, 3]).concat(4)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | string.concat("bar")
Output
`␊
1 | [...string, "bar"]␊
`
Error 1/1
`␊
> 1 | string.concat("bar")␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat(2, 3)
Output
`␊
1 | [...foo, 2, 3]␊
`
Error 1/1
`␊
> 1 | foo.concat(2, 3)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat(2, bar)
Output
`␊
1 | [...foo, 2].concat(bar)␊
`
Error 1/1
`␊
> 1 | foo.concat(2, bar)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [...foo, 2].concat(bar)
Error 1/1
`␊
> 1 | [...foo, 2].concat(bar)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/3: First argument is an \`array\`.␊
1 | [...foo, 2, ...bar]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/3: First argument is not an \`array\`.␊
1 | [...foo, 2, bar]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 3/3: Test first argument with \`Array.isArray(…)\`.␊
1 | [...foo, 2, ...(Array.isArray(bar) ? bar : [bar])]␊
`
1 | let sortedScores = scores.concat().sort((a, b) => b[0] - a[0]);
Output
`␊
1 | let sortedScores = [...scores].sort((a, b) => b[0] - a[0]);␊
`
Error 1/1
`␊
> 1 | let sortedScores = scores.concat().sort((a, b) => b[0] - a[0]);␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.concat(bar, 2, 3)
Error 1/1
`␊
> 1 | foo.concat(bar, 2, 3)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/3: First argument is an \`array\`.␊
1 | [...foo, ...bar, 2, 3]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/3: First argument is not an \`array\`.␊
1 | [...foo, bar, 2, 3]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 3/3: Test first argument with \`Array.isArray(…)\`.␊
1 | [...foo, ...(Array.isArray(bar) ? bar : [bar]), 2, 3]␊
`
1 | foo.concat(bar, 2, 3, baz)
Error 1/1
`␊
> 1 | foo.concat(bar, 2, 3, baz)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/4: First argument is an \`array\`.␊
1 | [...foo, ...bar, 2, 3].concat(baz)␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/4: First argument is not an \`array\`.␊
1 | [...foo, bar, 2, 3].concat(baz)␊
␊
--------------------------------------------------------------------------------␊
Suggestion 3/4: Test first argument with \`Array.isArray(…)\`.␊
1 | [...foo, ...(Array.isArray(bar) ? bar : [bar]), 2, 3].concat(baz)␊
␊
--------------------------------------------------------------------------------␊
Suggestion 4/4: Spread all unknown arguments\`.␊
1 | [...foo, ...bar, 2, 3, ...baz]␊
`
1 | async function a() {return [].concat(await bar)}
Error 1/1
`␊
> 1 | async function a() {return [].concat(await bar)}␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: First argument is an \`array\`.␊
1 | async function a() {return [...(await bar)]}␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/2: First argument is not an \`array\`.␊
1 | async function a() {return [await bar]}␊
`
1 | async function a() {return [].concat(((await bar)))}
Error 1/1
`␊
> 1 | async function a() {return [].concat(((await bar)))}␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: First argument is an \`array\`.␊
1 | async function a() {return [...((await bar))]}␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/2: First argument is not an \`array\`.␊
1 | async function a() {return [((await bar))]}␊
`
1 | foo.concat((0, 1))
Output
`␊
1 | [...foo, (0, 1)]␊
`
Error 1/1
`␊
> 1 | foo.concat((0, 1))␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | async function a() {return (await bar).concat(1)}
Output
`␊
1 | async function a() {return [...(await bar), 1]}␊
`
Error 1/1
`␊
> 1 | async function a() {return (await bar).concat(1)}␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [].concat(...bar)
Error 1/1
`␊
> 1 | [].concat(...bar)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [].concat([,], [])
Output
`␊
1 | [,]␊
`
Error 1/1
`␊
> 1 | [].concat([,], [])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [,].concat([,], [,])
Output
`␊
1 | [, , ,]␊
`
Error 1/1
`␊
> 1 | [,].concat([,], [,])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [,].concat([,,], [,])
Output
`␊
1 | [, ,, ,]␊
`
Error 1/1
`␊
> 1 | [,].concat([,,], [,])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [,].concat([,], [,,])
Output
`␊
1 | [, , ,,]␊
`
Error 1/1
`␊
> 1 | [,].concat([,], [,,])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1].concat([2,], [3,])
Output
`␊
1 | [1, 2, 3,]␊
`
Error 1/1
`␊
> 1 | [1].concat([2,], [3,])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1].concat([2,,], [3,,])
Output
`␊
1 | [1, 2,, 3,,]␊
`
Error 1/1
`␊
> 1 | [1].concat([2,,], [3,,])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1,].concat([2,], [3,])
Output
`␊
1 | [1, 2, 3,]␊
`
Error 1/1
`␊
> 1 | [1,].concat([2,], [3,])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [1,].concat([2,,], [3,,])
Output
`␊
1 | [1, 2,, 3,,]␊
`
Error 1/1
`␊
> 1 | [1,].concat([2,,], [3,,])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | [].concat([], [])
Output
`␊
1 | []␊
`
Error 1/1
`␊
> 1 | [].concat([], [])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | const EMPTY_STRING = ""
2 | const EMPTY_STRING_IN_ARRAY = ""
3 | const EMPTY_STRING_IN_ARRAY_OF_ARRAY = ""
4 | const array = [].concat(
5 | undefined,
6 | null,
7 | EMPTY_STRING,
8 | false,
9 | 0,
10 | [EMPTY_STRING_IN_ARRAY],
11 | [[EMPTY_STRING_IN_ARRAY_OF_ARRAY]]
12 | )
Output
`␊
1 | const EMPTY_STRING = ""␊
2 | const EMPTY_STRING_IN_ARRAY = ""␊
3 | const EMPTY_STRING_IN_ARRAY_OF_ARRAY = ""␊
4 | const array = [undefined, null, EMPTY_STRING, false, 0, EMPTY_STRING_IN_ARRAY, [EMPTY_STRING_IN_ARRAY_OF_ARRAY]]␊
`
Error 1/1
`␊
1 | const EMPTY_STRING = ""␊
2 | const EMPTY_STRING_IN_ARRAY = ""␊
3 | const EMPTY_STRING_IN_ARRAY_OF_ARRAY = ""␊
> 4 | const array = [].concat(␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
5 | undefined,␊
6 | null,␊
7 | EMPTY_STRING,␊
8 | false,␊
9 | 0,␊
10 | [EMPTY_STRING_IN_ARRAY],␊
11 | [[EMPTY_STRING_IN_ARRAY_OF_ARRAY]]␊
12 | )␊
`
1 | [].concat((a.b.c), 2)
Error 1/1
`␊
> 1 | [].concat((a.b.c), 2)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/3: First argument is an \`array\`.␊
1 | [...(a.b.c), 2]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/3: First argument is not an \`array\`.␊
1 | [(a.b.c), 2]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 3/3: Test first argument with \`Array.isArray(…)\`.␊
1 | [...(Array.isArray((a.b.c)) ? (a.b.c) : [(a.b.c)]), 2]␊
`
1 | [].concat(a.b(), 2)
Error 1/1
`␊
> 1 | [].concat(a.b(), 2)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: First argument is an \`array\`.␊
1 | [...a.b(), 2]␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/2: First argument is not an \`array\`.␊
1 | [a.b(), 2]␊
`
1 | foo.concat(bar, 2, [3, 4], baz, 5, [6, 7])
Error 1/1
`␊
> 1 | foo.concat(bar, 2, [3, 4], baz, 5, [6, 7])␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/4: First argument is an \`array\`.␊
1 | [...foo, ...bar, 2, 3, 4].concat(baz, 5, [6, 7])␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/4: First argument is not an \`array\`.␊
1 | [...foo, bar, 2, 3, 4].concat(baz, 5, [6, 7])␊
␊
--------------------------------------------------------------------------------␊
Suggestion 3/4: Test first argument with \`Array.isArray(…)\`.␊
1 | [...foo, ...(Array.isArray(bar) ? bar : [bar]), 2, 3, 4].concat(baz, 5, [6, 7])␊
␊
--------------------------------------------------------------------------------␊
Suggestion 4/4: Spread all unknown arguments\`.␊
1 | [...foo, ...bar, 2, 3, 4, ...baz, 5, 6, 7]␊
`
1 | foo.concat(bar, 2, 3, ...baz)
Error 1/1
`␊
> 1 | foo.concat(bar, 2, 3, ...baz)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/3: First argument is an \`array\`.␊
1 | [...foo, ...bar, 2, 3].concat(...baz)␊
␊
--------------------------------------------------------------------------------␊
Suggestion 2/3: First argument is not an \`array\`.␊
1 | [...foo, bar, 2, 3].concat(...baz)␊
␊
--------------------------------------------------------------------------------␊
Suggestion 3/3: Test first argument with \`Array.isArray(…)\`.␊
1 | [...foo, ...(Array.isArray(bar) ? bar : [bar]), 2, 3].concat(...baz)␊
`
1 | notClass.concat(1)
Output
`␊
1 | [...notClass, 1]␊
`
Error 1/1
`␊
> 1 | notClass.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | _A.concat(1)
Output
`␊
1 | [..._A, 1]␊
`
Error 1/1
`␊
> 1 | _A.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | FOO.concat(1)
Output
`␊
1 | [...FOO, 1]␊
`
Error 1/1
`␊
> 1 | FOO.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | A.concat(1)
Output
`␊
1 | [...A, 1]␊
`
Error 1/1
`␊
> 1 | A.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | Foo.x.concat(1)
Output
`␊
1 | [...Foo.x, 1]␊
`
Error 1/1
`␊
> 1 | Foo.x.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | if (test) foo.concat(1)
Output
`␊
1 | if (test) [...foo, 1]␊
`
Error 1/1
`␊
> 1 | if (test) foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | if (test) {} else foo.concat(1)
Output
`␊
1 | if (test) {} else [...foo, 1]␊
`
Error 1/1
`␊
> 1 | if (test) {} else foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | if (test) {} else foo.concat(1)
Output
`␊
1 | if (test) {} else [...foo, 1]␊
`
Error 1/1
`␊
> 1 | if (test) {} else foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | for (;;) foo.concat(1)
Output
`␊
1 | for (;;) [...foo, 1]␊
`
Error 1/1
`␊
> 1 | for (;;) foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | for (a in b) foo.concat(1)
Output
`␊
1 | for (a in b) [...foo, 1]␊
`
Error 1/1
`␊
> 1 | for (a in b) foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | for (a in b) foo.concat(1)
Output
`␊
1 | for (a in b) [...foo, 1]␊
`
Error 1/1
`␊
> 1 | for (a in b) foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | for (const a of b) foo.concat(1)
Output
`␊
1 | for (const a of b) [...foo, 1]␊
`
Error 1/1
`␊
> 1 | for (const a of b) foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | while (test) foo.concat(1)
Output
`␊
1 | while (test) [...foo, 1]␊
`
Error 1/1
`␊
> 1 | while (test) foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | do foo.concat(1); while (test)
Output
`␊
1 | do [...foo, 1]; while (test)␊
`
Error 1/1
`␊
> 1 | do foo.concat(1); while (test)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | with (foo) foo.concat(1)
Output
`␊
1 | with (foo) [...foo, 1]␊
`
Error 1/1
`␊
> 1 | with (foo) foo.concat(1)␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | const baz = [2];
2 | call(foo, ...[bar].concat(baz));
Output
`␊
1 | const baz = [2];␊
2 | call(foo, ...[bar, ...baz]);␊
`
Error 1/1
`␊
1 | const baz = [2];␊
> 2 | call(foo, ...[bar].concat(baz));␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | foo.join(foo, bar).concat("...")
Output
`␊
1 | [...foo.join(foo, bar), "..."]␊
`
Error 1/1
`␊
> 1 | foo.join(foo, bar).concat("...")␊
| ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`
1 | array.slice()
Output
`␊
1 | [...array]␊
`
Error 1/1
`␊
> 1 | array.slice()␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | array.slice().slice()
Output
`␊
1 | [...array].slice()␊
`
Error 1/2
`␊
> 1 | array.slice().slice()␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
Error 2/2
`␊
> 1 | array.slice().slice()␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | array.slice(1).slice()
Output
`␊
1 | [...array.slice(1)]␊
`
Error 1/1
`␊
> 1 | array.slice(1).slice()␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | array.slice().slice(1)
Output
`␊
1 | [...array].slice(1)␊
`
Error 1/1
`␊
> 1 | array.slice().slice(1)␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | const copy = array.slice()
Output
`␊
1 | const copy = [...array]␊
`
Error 1/1
`␊
> 1 | const copy = array.slice()␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | (( (( (( array )).slice ))() ))
Output
`␊
1 | (( [...(( (( array )) ))] ))␊
`
Error 1/1
`␊
> 1 | (( (( (( array )).slice ))() ))␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | bar()
2 | foo.slice()
Output
`␊
1 | bar()␊
2 | ;[...foo]␊
`
Error 1/1
`␊
1 | bar()␊
> 2 | foo.slice()␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | "".slice()
Output
`␊
1 | [...""]␊
`
Error 1/1
`␊
> 1 | "".slice()␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | new Uint8Array([10, 20, 30, 40, 50]).slice()
Output
`␊
1 | [...new Uint8Array([10, 20, 30, 40, 50])]␊
`
Error 1/1
`␊
> 1 | new Uint8Array([10, 20, 30, 40, 50]).slice()␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | array.slice(0)
Output
`␊
1 | [...array]␊
`
Error 1/1
`␊
> 1 | array.slice(0)␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | array.slice(0b0)
Output
`␊
1 | [...array]␊
`
Error 1/1
`␊
> 1 | array.slice(0b0)␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | array.slice(0.00)
Output
`␊
1 | [...array]␊
`
Error 1/1
`␊
> 1 | array.slice(0.00)␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | array.slice(0.00, )
Output
`␊
1 | [...array]␊
`
Error 1/1
`␊
> 1 | array.slice(0.00, )␊
| ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`
1 | "string".split("")
Output
`␊
1 | [..."string"]␊
`
Error 1/1
`␊
> 1 | "string".split("")␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
`
1 | "string".split('')
Output
`␊
1 | [..."string"]␊
`
Error 1/1
`␊
> 1 | "string".split('')␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
`
1 | unknown.split("")
Error 1/1
`␊
> 1 | unknown.split("")␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/1: Use \`...\` operator.␊
1 | [...unknown]␊
`
1 | const characters = "string".split("")
Output
`␊
1 | const characters = [..."string"]␊
`
Error 1/1
`␊
> 1 | const characters = "string".split("")␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
`
1 | (( (( (( "string" )).split ))( (("")) ) ))
Output
`␊
1 | (( [...(( (( "string" )) ))] ))␊
`
Error 1/1
`␊
> 1 | (( (( (( "string" )).split ))( (("")) ) ))␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
`
1 | bar()
2 | foo.split("")
Error 1/1
`␊
1 | bar()␊
> 2 | foo.split("")␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/1: Use \`...\` operator.␊
1 | bar()␊
2 | ;[...foo]␊
`
1 | unknown.split("")
Error 1/1
`␊
> 1 | unknown.split("")␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/1: Use \`...\` operator.␊
1 | [...unknown]␊
`
1 | "🦄".split("")
Error 1/1
`␊
> 1 | "🦄".split("")␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/1: Use \`...\` operator.␊
1 | [..."🦄"]␊
`
1 | const {length} = "🦄".split("")
Error 1/1
`␊
> 1 | const {length} = "🦄".split("")␊
| ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
␊
--------------------------------------------------------------------------------␊
Suggestion 1/1: Use \`...\` operator.␊
1 | const {length} = [..."🦄"]␊
`