Closed pirasleandro closed 6 months ago
In JavaScript mode, when using any of the operators that contain a question mark (??, ??=, and .?), the editor displays them as a syntax error, even though I can run the code without any issues.
All seems fine as far as I can see:
Same when TypeScript is selected:
Cannot replicate what you're seeing so closing until more details are provided.
In JavaScript mode, when using any of the operators that contain a question mark (
??
,??=
, and.?
), the editor displays them as a syntax error, even though I can run the code without any issues. In Typescript mode, the operators are syntax-highlighted correctly.result:
{ ... }, "5"
link to fiddleWhether in JavaScript or Typescript mode, the formatter introduces additional spaces around each question mark, breaking all of the obove named operators. This is especially confusing when using Typescript, since it's not highlighted as syntax error. The same applies to
<
and>
, rendering generic type declarations in Typescript less readable.before:
after: