- Error
- Reported by the lexer and parser
TS1200
Line terminator not permitted before arrow.
An arrow function has a line break between its parameters and `=>`. Keep `=>` on the same line as the closing parenthesis.
What it means
JavaScript doesn't allow a line break before =>. The parameter list and the arrow must be on the same line; the body can start on the next line.
Example
const double = (n: number)
=> n * 2;
export {};
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(2,3): error TS1200: Line terminator not permitted before arrow.
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
- Move
=>up:const double = (n: number) =>followed by the body on the next line.