I providing two of my code sample that throws this error.
My eslintrc file is
{
"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!
CodePudding user response:
Just put "node": true
in the env
section
{
"env": {
"node": true,
"browser": true,
"commonjs": true,
"es2021": true
},
...
}