[英]vscode not picking up .eslintrc settings
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"}
怎么了 是否存在一些需要覆蓋的全局配置?
Saugat Acharya在評論中已經提到了問題的原因。
要解決此問題,只需將以下規則添加到eslint.rc
文件中,即可明確關閉該規則:
{
"rules": {
"no-useless-escape": "off"
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.