Node.js : Setup Minimal ESLint Config in 1 Minute
You can simple init the file by
$ eslint --init
and go through the interactive prompt
Minor Fix
Even when you choose Node
in the interactive.
It shows few problem like Node’s default module
, process
is not defined.
So here is the fixes:
{
"env": {
"node": true, // <---- THIS LINE
"es2021": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {}
}
Hope this help.
Cheers !