Sublime-Babel-VSCode icon indicating copy to clipboard operation
Sublime-Babel-VSCode copied to clipboard

Optional chaining breaks syntax highlighting

Open gautier-lefebvre opened this issue 6 years ago • 11 comments

Hello,

When I try to use optional chaining inside my JSX, the syntax highlighting of the following blocks is broken (line 69). broken

If I remove the optional chaining, everything is fine. notbroken

On Sublime Text, it works as expected.

EDIT: This also breaks simple JS syntax highlighting.

gautier-lefebvre avatar Dec 05 '17 08:12 gautier-lefebvre

Any updates?

jessekuoppala avatar Apr 10 '18 13:04 jessekuoppala

This seems to be linked to https://github.com/Microsoft/TypeScript-TmLanguage/issues/522. So we need to wait for the feature to hit stage 3 before Microsoft implements it in their parser.

gautier-lefebvre avatar Apr 10 '18 13:04 gautier-lefebvre

Are you using optional chaining with ESLint, Babel, babel-eslint and plugin-proposal-optional-chaining? I'm trying to use it in my code, but ESLint keeps throwing an error.

brneto avatar May 05 '18 19:05 brneto

Are you using optional chaining with ESLint, Babel, babel-eslint and plugin-proposal-optional-chaining? I'm trying to use it in my code, but ESLint keeps throwing an error.

I am having the same problem. @brneto did you get a sloution?

ovac avatar Nov 05 '18 21:11 ovac

@ovac I've decided to switch to Babel JavaScript, because there is a more active developer community.

brneto avatar Nov 05 '18 22:11 brneto

Now optional chaining moves to stage 3!!!

daix6 avatar Aug 01 '19 05:08 daix6

how can i use this? i am facing same issue with VS code TS ReactNative.

ImAbhishekTomar avatar Jan 24 '20 14:01 ImAbhishekTomar

I switched to https://github.com/michaelgmcd/vscode-language-babel also. Colors are a bit different but other than that it works perfectly.

🤷‍♂

gautier-lefebvre avatar Jan 24 '20 14:01 gautier-lefebvre

I switched to https://github.com/michaelgmcd/vscode-language-babel also. Colors are a bit different but other than that it works perfectly.

🤷‍♂

This solution worked perfectly in my VS Code.

victorwvieira avatar Jun 24 '20 09:06 victorwvieira

I switched to https://github.com/michaelgmcd/vscode-language-babel also. Colors are a bit different but other than that it works perfectly.

This solution works for me! Thanks

marcusflat avatar Jul 11 '20 13:07 marcusflat

I switched to https://github.com/michaelgmcd/vscode-language-babel also. Colors are a bit different but other than that it works perfectly.

🤷‍♂

Sweet, thanks!

moatorres avatar Oct 11 '21 03:10 moatorres