With that out of the way, make a folder and change directory:
mkdir eslint-tut and
To select a guide, simply follow the instructions. My main goal is to have a standard guide.
🥦 Choose to check syntax, find problems and enforce code style.
🥦 CommonJS (require/exports).
🥦 None of these
🥦 Since I am not using typescript, i choose no.
🥦 I am running a node app, choose node.
🥦 I used a popular style guide.
🥦I chose standard over Airbnb and Google. Choose the one that suits your app best.
🥦 Yes, i'd love to install with npm
🥦 When installation is complete you should have .eslintrc.js
🥦 Eslint config settings and rules
How to use eslint in your project in two different ways.
1) Using a script
2) Using vscode commands
This should fix all inconsistencies in your code.
🥦 To fix errors automaically using vscode: ctrl + shift + p , type in eslint and select Eslint fix all auto-fixable problems
I hope this post is helpful and will aid in writing better code for your next project. Thanks for reading.