• Error
  • Reported by the lexer and parser

TS1138

Parameter declaration expected.

A parameter list has an empty slot, as in `f(a, , b)`. Remove the extra comma or name the parameter.

What it means

Each comma in a parameter list must separate two parameter declarations. This is reported where a parameter should start but doesn't.

Example

index.ts
export function f(a: number, , b: number) {}
ts-r-check -p tsconfig.json --pretty false ts-r output
index.ts(1,30): error TS1138: Parameter declaration expected.

Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.

How to fix

  • Delete the extra comma, or add the missing parameter name.