React JSX error : Unclosed regular expression

别说谁变了你拦得住时间么 提交于 2019-11-30 09:39:24
Abhay Shiro

I tried several options like creating a .eslintrc file or .jshintrc file.

But it turned out that in my Visual Studio Code IDE, there was third party extensions(eslint/jslint/tslint/beautify/jsformatter etc) that were causing a big mess in my JSX code.

I had to go to the extensions and disable all the extension which could hinder in the natural process of linting and code cleaning of React framework.

(These extensions are really great. But disabling them helped me in solving this issue of mine, no offense to anyone.)

If you are facing the same issue and the issue persists event after adding a .jshintrc with content:

{
    "esversion": 6
}

then consider disabling the third party extensions.

Hope my answer helped.

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.

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

It is a good replacement for jshint in reactJS work.

I solved this issue by disabling show syntax errors checkbox in visual studio 2015.

Tools -> options - > text editor -> javascript -> intelliSense -> general -> show syntax errors(disable)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!