- Error
- Reported by the lexer and parser
TS1135
Argument expression expected.
An argument list has an empty slot, as in `f(1, , 2)`. Fill it in or remove the extra comma.
What it means
Each comma in a call's argument list must separate two expressions. Unlike array literals, argument lists can't have holes.
Example
export function f(a: number, b: number) { return a + b; }
f(1, , 2);
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(2,6): error TS1135: Argument expression 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
- Remove the extra comma, or pass a value (use
undefinedto skip an optional parameter).