Atom eslint和jsx / react设置

时间:2018-07-16 12:16:44

标签: javascript atom-editor jsx eslint linter

我无法将eslint atom软件包与jsx一起使用。我的eslint包在主目录中引用了一个全局.eslintrc。在eslint文档之后,我将.eslintrc文件设置如下:

{
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "extends": [
  "eslint:recommended",
  "plugin:react/recommended"
  ],
  "rules": {
    "semi": 2,
    "strict": 0
  }
}

我的package.json依赖项:

"devDependencies": {
"babel-core": "^6.2.1",
"babel-eslint": "^8.2.6",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.10.0",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
},
"dependencies": {
  "babel-preset-stage-1": "^6.1.18",
  "lodash": "^3.10.1",
  "react": "16.3.2",
  "react-dom": "16.3.2",
  "react-redux": "5.0.7",
  "redux": "4.0.0",
  "youtube-api-search": "0.0.5"
}

我已经安装了babel解析器和eslint-plugin-react,但是仍然无法读取jsx。在此,我非常感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

您说无法阅读jsx是什么意思?如果我说对了,我认为Atom没有显示任何错误? 如果是这样,非常高兴向我们显示已安装的Atom软件包列表。 我想您错过了一些软件包,例如language-javascript-jsx