DEV Community

Cover image for Quick set-up for ESLint
Temitope Ayodele
Temitope Ayodele

Posted on

Quick set-up for ESLint

ESLint helps to format code and analyze it to make suggestions for improvement.
This is a quick guide to set it up on your VScode.

Step 1:
Install eslint globally

npm install -g eslint
Enter fullscreen mode Exit fullscreen mode

Step 2:
Initialize an ESLint configuration by running

eslint --init
Enter fullscreen mode Exit fullscreen mode

Step 3:
You will be prompted with a few different questions about your project to create the best configuration. Then you will also be asked to install extra packages; choose yes.
After that finishes, you should have a brand new .eslintrc file in your project

Top comments (1)

Collapse
 
yoursunny profile image
Junxiao Shi

It's better to setup ESLint in devDependencies rather than a global command. This allows executing ESLint in continuous integration systems.
The challenging part is customizing .eslintrc though. Default rules are very loose.