Hello, this is an EcmaScript Linting tool, popularly known as ESlint, used to spot out errors in your javascript code.
A lot of people complained that they have been finding it dificult to set up ESlint with visual studio code editor so i felt i should share it. This linting project is coupled with prettier, a formatting tool for javascript. All is just to ensure script integrity and cleaner codes.
Usage:
-
Clone it into your machine or download it from here.
-
Cd into eslint
-
Open vscode by typing "code ." without double quotes
-
Create two files in the eslint directory by typing "touch code.js" and "touch .eslintrc" without double quotes.
-
To install everything needed by config.js i mean the dependencies, run the code below:
"npx install-peerdeps --dev eslint-config-wesbos" without double quotes.
-
Copy the code below and put it in .eslint file
{ "extends":["wesbos"] }
-
For a test, just write javascript code anyhow inside test.js....
-
Inside code.js(note that you can use any name of your choice with .js extension)
-
Lastly, in Vscode Editor, Go to Files -> Preference -> settings -> Click Extension dropdown and select ESlint and check the box
-
Lastly, run the code below to see eslint in action npm run lint:fix
RESULT The code is formatted and error of commision or omission is spit out in the cmd Thank you