vscode没有拿起.eslintrc设置

时间:2018-03-12 16:11:11

标签: javascript node.js visual-studio-code eslint

VSCode显示unnecessary escape character error - no-useless-escape设置。

但.eslintrc具有以下设置,但不包含no-useless-escape设置:

{
    "root": true,
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "script"
    },
    "env": {
        "node": true,
        "browser": false
    },
    "extends": "eslint:recommended",
    "rules": {
        "semi": ["error", "always"],
        "indent": ["error", 4, {
            "VariableDeclarator": 1,
            "SwitchCase": 1,
            "MemberExpression": 1,
            "ArrayExpression": "first"
        }],
        "no-mixed-requires": "off",
        "no-restricted-imports": "off",
        "no-undef":"off",
        "no-console":"off",
        "no-trailing-spaces": "error",
        "no-unused-vars": "warn",
        "no-empty": ["error", {"allowEmptyCatch": true}]
    }
}

我的工作区设置正确引用.eslintrc文件:

"eslint.options": {"configFile": ".eslintrc"}

这里有什么问题?是否需要覆盖一些全局配置?

1 个答案:

答案 0 :(得分:0)

Saugat Acharya已经在评论中提到了问题的原因 要解决此问题,只需将以下规则添加到eslint.rc文件中即可明确关闭该规则:

{
    "rules": {
        "no-useless-escape": "off" 
    }
}