[英]Incorrectly tigger eslint (no-undef) in nodejs globals
我提供了兩個引發此錯誤的代碼示例。
我的 eslintrc 文件是
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": ["google"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"linebreak-style": "off",
"quotes": ["error", "double"],
"indent": "off",
"max-len": "off",
"object-curly-spacing": "off",
"curly": "off",
"comma-dangle": "off",
"camelcase": "off",
"new-cap": "off",
"no-undef": "error",
"eqeqeq": "error"
}
}
感謝您的時間!
只需將"node": true
放在env
部分
{
"env": {
"node": true,
"browser": true,
"commonjs": true,
"es2021": true
},
...
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.