In my .js
files, when I use an elvis operator const something = data?.info?.set
, the entire file turns red after the line used.
How can I make VSCode recognize elvis operators and maintain syntax proper highlighting?
Note: I use metro-react-native-babel-preset
and eslint, which by default allows for optionals in pure .js files (not typescript)
I have installed https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next and also followed the instructions to enable it. However, my code is still pure red color starting the line after I use the ?
operator.