ESLint - “期望缩进0个标签,但找到4个空格。”当试图覆盖airbnb配置时

时间:2016-12-30 15:06:11

标签: javascript reactjs ecmascript-6 visual-studio-code eslint

我正在尝试通过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

有什么想法吗? 感谢

0 个答案:

没有答案