the tswhy logo: a question mark in a box

tswhy‽

A community effort to enrich TypeScript diagnostics.

TS1013

A rest parameter or binding pattern may not have a trailing comma.

If a function uses destructuring to consume the last argument in a function or has a rest argument, the argument may not have a trailing comma.

function test(...args: any[]) {}

Fix: Remove trailing comma

To fix the error, remove the trailing comma:

function test(...args: any[]) {}