felipeochoa / rjsx-mode

A JSX major mode for Emacs
https://github.com/felipeochoa/rjsx-mode
MIT License
639 stars 32 forks source link

Type statement in Backticks destroys syntax highlighting and indentation #131

Closed m1cm1c closed 2 years ago

m1cm1c commented 2 years ago

If a type statement (e.g. as number) occurs in backticks, the syntax highlighting breaks from a point shortly after until the end of the buffer. Furthermore, indentation sometimes breaks. I have yet to figure out under what circumstances indentation breaks but here is a minimal example of how to get the syntax highlighting to break:

if(true) {
  const a = [1, 'a'];
  console.log(`${Math.max((a[0] as number), 5)}`);
} else {
  console.log('b');
}

It looks like this: image

felipeochoa commented 2 years ago

RJSX does not support types -- this is only for plain JSX