TS5087

error TS5087: A labeled tuple element is declared as rest with a ‘...‘ before the name, rather than before the type.

Broken Code ❌

1
2
3
type Operation = "+" | "-";

type CalcInput = [operation: Operation, numbers: ...number[]];

Fixed Code ✔️

We have to move the rest operator to the label name:

1
type CalcInput = [operation: Operation, ...numbers: number[]];