Here are some basic instructions for setting up eslint
for for a project that uses ES5
and ES6
.
The assumption is that you already have your own project, with its own package.json
file.
Inspect the package.json
file in this project, and copy all the devDependencies
it contains into your own package.json
file.
Then run npm install
to retrieve the required npm
packages.
This project includes a sample .eslintrc
file.
To keep things simple, it uses airbnb
rules as a base, and adds several rule modifications.
So you might like to check the "rules"
section of .eslintrc
to see if they match your requirements.
The package.json
file in this project contains a very simple "eslint"
script to run – it simply calls the eslint
binary, with a single argument, which is the filespec for the JS files to lint.
Add this to the "scripts"
section of your package.json
file, and modify this filespec to match the files you want to lint.
Now you can run eslint
against your files:
$ npm run eslint