React JSX error : Unclosed regular expression

Viewed 23875

Recently I was facing an issue coding React app on Visual Studio code. Because of this issue, whenever I wrote JSX inside the render function of the React Component and saved it, it would go messed up (I mean indentation would get messy). See the pic: enter image description here

This error was also showing error like: 1. Unclosed regular expression

How to solve this?

5 Answers

If you are using jshint plugin, remove it and install ESLint plugin.

It is a good replacement for jshint in reactJS work.

the extension that did it for me was...

jshint

dbaeumer.jshint
Dirk Baeumer

as @abhay-shiro says, disabling a few extensions will usually resolve the issue.

I had the same problem, but it was "beautify" extension which was causing the error, I uninstalled it and installed prettier. It fixed the problem.

Related