Closed
Description
TypeScript Version: 3.9.1-rc
Search Terms:
ts-expect-error comment expects more than one error multiple lines
Code
// @ts-expect-error
(({ a: true } as const).a === false); // <-- compiles (as expected via comment)
(({ a: true } as const).a === false); // <-- compiles, expected an error though
(({ a: true } as const).a === false); // error (as I would expect)
(({ a: true } as const).a === false); // error (as I would expect)
Expected behavior:
I only expect // @ts-expect-error
to ignore a single error at a time.
Actual behavior:
The // @ts-expect-error
comment expected two errors spanning across two separate lines. The comment seems to take empty lines into account as a separator? Quite odd, seeing as code should ignore whitespace.
Work-around:
Add an empty line between the expected error line and the one that follows.
Playground Link:
Related Issues:
Couldn't find any.