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"}
这里有什么问题?是否需要覆盖一些全局配置?
答案 0 :(得分:0)
Saugat Acharya已经在评论中提到了问题的原因
要解决此问题,只需将以下规则添加到eslint.rc
文件中即可明确关闭该规则:
{
"rules": {
"no-useless-escape": "off"
}
}