Node.js : Setup Minimal ESLint Config in 1 Minute

NodeJS Jul 3, 2023

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 !

CODEMONDAY - Web App | Mobile App | Digital & IT Solution and Software Development Company
Realize your idea and ship it online. web application, website, mobile, Digital & IT Solution, desktop applications, e-commerce. Want your business to shine in the digital world? We are here to help.

Tags

TeamCMD

We are CODEMONDAY team and provide a variety of content about Business , technology, and Programming. Let's enjoy it with us.