quick-lint-js

Find bugs in JavaScript programs.

E0708: unexpected '...'; expected expression

The spread ('...') operator must precede an expression:

const arr1 = [1, 2, 3];
const arr2 = [4, 5, 6];

const arr3 = [...arr1, ...];

To fix this error, insert a valid expression after the operator:

const arr1 = [1, 2, 3];
const arr2 = [4, 5, 6];

const arr3 = [...arr1, ...arr2];

Documentation for other errors