React JSX error : Unclosed regular expression

前端 未结 5 1842
别跟我提以往
别跟我提以往 2021-02-04 06:08

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

5条回答
  •  广开言路
    2021-02-04 07:04

    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.

提交回复
热议问题