[英]Incorrectly tigger eslint (no-undef) in nodejs globals
I providing two of my code sample that throws this error.我提供了两个引发此错误的代码示例。
My eslintrc file is我的 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"
}
}
Thank you for your time!感谢您的时间!
Just put "node": true
in the env
section只需将
"node": true
放在env
部分
{
"env": {
"node": true,
"browser": true,
"commonjs": true,
"es2021": true
},
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.