Skip to content

Latest commit

 

History

History
2406 lines (1730 loc) · 46.8 KB

prefer-spread.mjs.md

File metadata and controls

2406 lines (1730 loc) · 46.8 KB

Snapshot report for test/prefer-spread.mjs

The actual snapshot is saved in prefer-spread.mjs.snap.

Generated by AVA.

Invalid #1

  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(…)\`.␊
`

Invalid #2

  1 | Array.from(set).map(() => {});

Output

`␊
  1 | [...set].map(() => {});␊
`

Error 1/1

`␊
> 1 | Array.from(set).map(() => {});␊
    | ^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #3

  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(…)\`.␊
`

Invalid #4

  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(…)\`.␊
`

Invalid #5

  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(…)\`.␊
`

Invalid #6

  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(…)\`.␊
`

Invalid #7

  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(…)\`.␊
`

Invalid #8

  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(…)\`.␊
`

Invalid #9

  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(…)\`.␊
`

Invalid #10

  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(…)\`.␊
`

Invalid #11

  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(…)\`.␊
`

Invalid #12

  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(…)\`.␊
`

Invalid #13

  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(…)\`.␊
`

Invalid #14

  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(…)\`.␊
`

Invalid #15

  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(…)\`.␊
`

Invalid #16

  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(…)\`.␊
`

Invalid #17

  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 | }␊
`

Invalid #18

  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(…)\`.␊
`

Invalid #19

  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(…)\`.␊
`

Invalid #20

  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 | }␊
`

Invalid #21

  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 | }␊
`

Invalid #22

  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(…)\`.␊
`

Invalid #23

  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 | }␊
`

Invalid #24

  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(…)\`.␊
`

Invalid #25

  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(…)\`.␊
`

Invalid #26

  1 | (Array).from(foo)

Output

`␊
  1 | [...foo]␊
`

Error 1/1

`␊
> 1 | (Array).from(foo)␊
    | ^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #27

  1 | (Array.from)(foo)

Output

`␊
  1 | [...foo]␊
`

Error 1/1

`␊
> 1 | (Array.from)(foo)␊
    | ^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #28

  1 | ((Array).from)(foo)

Output

`␊
  1 | [...foo]␊
`

Error 1/1

`␊
> 1 | ((Array).from)(foo)␊
    | ^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #29

  1 | (Array).from((0, foo))

Output

`␊
  1 | [...(0, foo)]␊
`

Error 1/1

`␊
> 1 | (Array).from((0, foo))␊
    | ^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #30

  1 | (Array.from)((0, foo))

Output

`␊
  1 | [...(0, foo)]␊
`

Error 1/1

`␊
> 1 | (Array.from)((0, foo))␊
    | ^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #31

  1 | ((Array).from)((0, foo))

Output

`␊
  1 | [...(0, foo)]␊
`

Error 1/1

`␊
> 1 | ((Array).from)((0, foo))␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #32

  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(…)\`.␊
`

Invalid #33

  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(…)\`.␊
`

Invalid #34

  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(…)\`.␊
`

Invalid #35

  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(…)\`.␊
`

Invalid #36

  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(…)\`.␊
`

Invalid #37

  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(…)\`.␊
`

Invalid #38

  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(…)\`.␊
`

Invalid #39

  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(…)\`.␊
`

Invalid #40

  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(…)\`.␊
`

Invalid #41

  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(…)\`.␊
`

Invalid #42

  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(…)\`.␊
`

Invalid #43

  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(…)\`.␊
`

Invalid #44

  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(…)\`.␊
`

Invalid #45

  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(…)\`.␊
`

Invalid #46

  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(…)\`.␊
`

Invalid #47

  1 | Array.from([1])

Output

`␊
  1 | [1]␊
`

Error 1/1

`␊
> 1 | Array.from([1])␊
    | ^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #48

  1 | Array.from([...a, ...b])

Output

`␊
  1 | [...a, ...b]␊
`

Error 1/1

`␊
> 1 | Array.from([...a, ...b])␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer the spread operator over \`Array.from(…)\`.␊
`

Invalid #49

  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(…)\`.␊
`

Invalid #50

  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(…)\`.␊
`

Invalid #1

  1 | [1].concat(2)

Output

`␊
  1 | [1, 2]␊
`

Error 1/1

`␊
> 1 | [1].concat(2)␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #2

  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(…)\`.␊
`

Invalid #3

  1 | [1].concat(2,)

Output

`␊
  1 | [1, 2]␊
`

Error 1/1

`␊
> 1 | [1].concat(2,)␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #4

  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(…)\`.␊
`

Invalid #5

  1 | [1,].concat(2)

Output

`␊
  1 | [1, 2,]␊
`

Error 1/1

`␊
> 1 | [1,].concat(2)␊
    |      ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #6

  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(…)\`.␊
`

Invalid #7

  1 | [1,].concat(2,)

Output

`␊
  1 | [1, 2,]␊
`

Error 1/1

`␊
> 1 | [1,].concat(2,)␊
    |      ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #8

  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(…)\`.␊
`

Invalid #9

  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(…)\`.␊
`

Invalid #10

  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(…)\`.␊
`

Invalid #11

  1 | foo.concat(2)

Output

`␊
  1 | [...foo, 2]␊
`

Error 1/1

`␊
> 1 | foo.concat(2)␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #12

  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(…)\`.␊
`

Invalid #13

  1 | foo.concat(2,)

Output

`␊
  1 | [...foo, 2]␊
`

Error 1/1

`␊
> 1 | foo.concat(2,)␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #14

  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(…)\`.␊
`

Invalid #15

  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(…)\`.␊
`

Invalid #16

  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(…)\`.␊
`

Invalid #17

  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(…)\`.␊
`

Invalid #18

  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(…)\`.␊
`

Invalid #19

  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(…)\`.␊
`

Invalid #20

  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(…)\`.␊
`

Invalid #21

  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(…)\`.␊
`

Invalid #22

  1 | foo.concat([bar])

Output

`␊
  1 | [...foo, bar]␊
`

Error 1/1

`␊
> 1 | foo.concat([bar])␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #23

  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])]␊
`

Invalid #24

  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(…)\`.␊
`

Invalid #25

  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(…)\`.␊
`

Invalid #26

  1 | string.concat("bar")

Output

`␊
  1 | [...string, "bar"]␊
`

Error 1/1

`␊
> 1 | string.concat("bar")␊
    |        ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #27

  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(…)\`.␊
`

Invalid #28

  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(…)\`.␊
`

Invalid #29

  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])]␊
`

Invalid #30

  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(…)\`.␊
`

Invalid #31

  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]␊
`

Invalid #32

  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]␊
`

Invalid #33

  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]}␊
`

Invalid #34

  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))]}␊
`

Invalid #35

  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(…)\`.␊
`

Invalid #36

  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(…)\`.␊
`

Invalid #37

  1 | [].concat(...bar)

Error 1/1

`␊
> 1 | [].concat(...bar)␊
    |    ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #38

  1 | [].concat([,], [])

Output

`␊
  1 | [,]␊
`

Error 1/1

`␊
> 1 | [].concat([,], [])␊
    |    ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #39

  1 | [,].concat([,], [,])

Output

`␊
  1 | [, , ,]␊
`

Error 1/1

`␊
> 1 | [,].concat([,], [,])␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #40

  1 | [,].concat([,,], [,])

Output

`␊
  1 | [, ,, ,]␊
`

Error 1/1

`␊
> 1 | [,].concat([,,], [,])␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #41

  1 | [,].concat([,], [,,])

Output

`␊
  1 | [, , ,,]␊
`

Error 1/1

`␊
> 1 | [,].concat([,], [,,])␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #42

  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(…)\`.␊
`

Invalid #43

  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(…)\`.␊
`

Invalid #44

  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(…)\`.␊
`

Invalid #45

  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(…)\`.␊
`

Invalid #46

  1 | [].concat([], [])

Output

`␊
  1 | []␊
`

Error 1/1

`␊
> 1 | [].concat([], [])␊
    |    ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #47

   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 | )␊
`

Invalid #48

  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]␊
`

Invalid #49

  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]␊
`

Invalid #50

  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]␊
`

Invalid #51

  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)␊
`

Invalid #52

  1 | notClass.concat(1)

Output

`␊
  1 | [...notClass, 1]␊
`

Error 1/1

`␊
> 1 | notClass.concat(1)␊
    |          ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #53

  1 | _A.concat(1)

Output

`␊
  1 | [..._A, 1]␊
`

Error 1/1

`␊
> 1 | _A.concat(1)␊
    |    ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #54

  1 | FOO.concat(1)

Output

`␊
  1 | [...FOO, 1]␊
`

Error 1/1

`␊
> 1 | FOO.concat(1)␊
    |     ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #55

  1 | A.concat(1)

Output

`␊
  1 | [...A, 1]␊
`

Error 1/1

`␊
> 1 | A.concat(1)␊
    |   ^^^^^^ Prefer the spread operator over \`Array#concat(…)\`.␊
`

Invalid #56

  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(…)\`.␊
`

Invalid #57

  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(…)\`.␊
`

Invalid #58

  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(…)\`.␊
`

Invalid #59

  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(…)\`.␊
`

Invalid #60

  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(…)\`.␊
`

Invalid #61

  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(…)\`.␊
`

Invalid #62

  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(…)\`.␊
`

Invalid #63

  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(…)\`.␊
`

Invalid #64

  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(…)\`.␊
`

Invalid #65

  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(…)\`.␊
`

Invalid #66

  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(…)\`.␊
`

Invalid #67

  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(…)\`.␊
`

Invalid #68

  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(…)\`.␊
`

Invalid #1

  1 | array.slice()

Output

`␊
  1 | [...array]␊
`

Error 1/1

`␊
> 1 | array.slice()␊
    |       ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`

Invalid #2

  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()\`.␊
`

Invalid #3

  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()\`.␊
`

Invalid #4

  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()\`.␊
`

Invalid #5

  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()\`.␊
`

Invalid #6

  1 | (( (( (( array )).slice ))() ))

Output

`␊
  1 | (( [...(( (( array )) ))] ))␊
`

Error 1/1

`␊
> 1 | (( (( (( array )).slice ))() ))␊
    |                   ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`

Invalid #7

  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()\`.␊
`

Invalid #8

  1 | "".slice()

Output

`␊
  1 | [...""]␊
`

Error 1/1

`␊
> 1 | "".slice()␊
    |    ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`

Invalid #9

  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()\`.␊
`

Invalid #10

  1 | array.slice(0)

Output

`␊
  1 | [...array]␊
`

Error 1/1

`␊
> 1 | array.slice(0)␊
    |       ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`

Invalid #11

  1 | array.slice(0b0)

Output

`␊
  1 | [...array]␊
`

Error 1/1

`␊
> 1 | array.slice(0b0)␊
    |       ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`

Invalid #12

  1 | array.slice(0.00)

Output

`␊
  1 | [...array]␊
`

Error 1/1

`␊
> 1 | array.slice(0.00)␊
    |       ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`

Invalid #13

  1 | array.slice(0.00, )

Output

`␊
  1 | [...array]␊
`

Error 1/1

`␊
> 1 | array.slice(0.00, )␊
    |       ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊
`

Invalid #1

  1 | "string".split("")

Output

`␊
  1 | [..."string"]␊
`

Error 1/1

`␊
> 1 | "string".split("")␊
    |          ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
`

Invalid #2

  1 | "string".split('')

Output

`␊
  1 | [..."string"]␊
`

Error 1/1

`␊
> 1 | "string".split('')␊
    |          ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
`

Invalid #3

  1 | unknown.split("")

Error 1/1

`␊
> 1 | unknown.split("")␊
    |         ^^^^^ Prefer the spread operator over \`String#split('')\`.␊

--------------------------------------------------------------------------------␊
Suggestion 1/1: Use \`...\` operator.␊
  1 | [...unknown]␊
`

Invalid #4

  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('')\`.␊
`

Invalid #5

  1 | (( (( (( "string" )).split ))( (("")) ) ))

Output

`␊
  1 | (( [...(( (( "string" )) ))] ))␊
`

Error 1/1

`␊
> 1 | (( (( (( "string" )).split ))( (("")) ) ))␊
    |                      ^^^^^ Prefer the spread operator over \`String#split('')\`.␊
`

Invalid #6

  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]␊
`

Invalid #7

  1 | unknown.split("")

Error 1/1

`␊
> 1 | unknown.split("")␊
    |         ^^^^^ Prefer the spread operator over \`String#split('')\`.␊

--------------------------------------------------------------------------------␊
Suggestion 1/1: Use \`...\` operator.␊
  1 | [...unknown]␊
`

Invalid #8

  1 | "🦄".split("")

Error 1/1

`␊
> 1 | "🦄".split("")␊
    |      ^^^^^ Prefer the spread operator over \`String#split('')\`.␊

--------------------------------------------------------------------------------␊
Suggestion 1/1: Use \`...\` operator.␊
  1 | [..."🦄"]␊
`

Invalid #9

  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} = [..."🦄"]␊
`