我正在尝试通过VSCode为我的项目设置ESLint
我安装了它,这是我的.eslintrc
文件:
{
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"browser": true,
"mocha": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"flowtype",
"flowtype-errors",
"import",
"promise",
"react"
],
"rules": {
"no-unused-vars": 0,
"indent": ["error", "tab"]
}
}
但是当我看到这样的一行时:
export function increment() {
return {
type: INCREMENT_COUNTER
};
}
我收到这些错误:
[eslint] Expected indentation of 0 tabs but found 4 spaces. (indent)
[eslint] Expected indentation of 1 tab but found 4 spaces. (indent)
我认为我试图覆盖的价值与airbnb的配置之间存在一些冲突。我正在尝试将缩进设置为1个标签而不是仅仅2个空格
我将这个样板用于我的项目:
https://github.com/chentsulin/electron-react-boilerplate
有什么想法吗? 感谢