How to config ESLint for React on Atom Editor

后端 未结 5 736
自闭症患者
自闭症患者 2020-12-12 20:52

In Atom Editor I installed the following plugins

  1. linter
  2. linter-eslint

It seems they don\'t recognize the JSX syntaxis.

I have

5条回答
  •  -上瘾入骨i
    2020-12-12 21:07

    Updated answer for 2016: just install the react package in Atom and add a .eslintrc file in your project root (or in your home dir) containing the following:

    {
      "parserOptions": {
        "ecmaFeatures": {
          "jsx": true
        }
      },
      "env": {
        "es6": true
      }
    }
    

    And re-open any files containing JSX and it should work.

提交回复
热议问题