Bug: Generic breaks code highlights
Closed this issue ยท 7 comments
RodrigoTomeES commented
Hi,
Write a generic function break the code highlights, looks:
Grabacion.de.pantalla.2023-10-20.a.las.13.26.25.mov
The code:
export const isNumber = <T,>(value: T): value is NonNullable<T> =>
value !== '' &&
typeof value !== 'object' &&
typeof value !== 'boolean' &&
!Number.isNaN(Number(value));
SO:
Version: 2.9.0
Config (is in spanish, I can't change the language of RunJS):
btecu commented
RodrigoTomeES commented
Mmm I am also in 2.9.0
. I update the issue with my config.
lukehaas commented
@RodrigoTomeES turn off the react-preset
when this is on; it thinks you're writing JSX.
RodrigoTomeES commented
@lukehaas one question, as you said if I disable react-preset
it works well but why react preset should break generic in TS? I use it in my .tsx files in vscode
lukehaas commented
It works in VS Code due to the comma before the closing bracket <T,>
. Unfortunately, this is not supported in Codemirror.
lukehaas commented
Reopening as I will try and get this supported.
lukehaas commented
@RodrigoTomeES this is now resolved in the latest version of RunJS - version 2.10.0