quick-lint-js

Find bugs in JavaScript programs.

E0320: missing name for element in named tuple type

In TypeScript, a tuple type can have names for each element. It is a syntax error to write : but omit the name in a tuple type:

function bsearch(a): [: number, hi: number] {
  /* ... */
}

To fix this error, write the name for the tuple element:

function bsearch(a): [lo: number, hi: number] {
  /* ... */
}

Alternatively, delete the :, and delete the names of other tuple elements:

function bsearch(a): [number, number] {
  /* ... */
}

Introduced in quick-lint-js version 2.10.0.

Documentation for other errors