我无法弄清楚如何配置我的.eslintrc文件以正确“接受”JSX。换句话说,当在Atom中输入JSX时,它就吓倒了。使用JSX配置eslint
我加了"parser": "babel-eslint"
,因为这似乎是听到别人一直在做调整自己的棉短绒一部分......但后来我在Atom中得到这个错误:
错误:无法找到模块“巴别塔“从 '/Users/josetello/.atom/packages/linter-eslint/node_modules'
-eslint我有全球和--save-dev
安装巴贝尔,eslint。没有运气。不知道为什么它抱怨原子包...
有没有更好的方式来配置JSX的.eslintrc?
我.eslintrc文件:
{
"settings": {
"ecmascript": 6
},
"ecmaFeatures": {
"blockBindings": true,
"jsx": true
},
"parser": "babel-eslint",
"env": {
"browser": true,
"jquery": true,
"node": true,
"mocha": true,
"es6": true
},
"rules": {
"prefer-arrow-callback": 1,
"semi": 1,
"strict": 0,
"indent": [2, 2],
"quotes": [1, "single"],
"no-multi-spaces": [1, {
"exceptions": {
"VariableDeclarator": true,
"FunctionExpression": true
}
}],
"key-spacing": [0, {"align": "value"}],
"no-underscore-dangle": 0
},
{
"plugins": [
"react"
]
}
}
您正在使用哪种eslint版本? – dannyjolie
使用版本2.4.0 – Jose