### Configuring ESLint in your project
The first thing we need to do is configure ESLint in our project. Remember we are going to use the AirBnB style guide so we need no install the required package and make our ESLint configuration extend from the AirBnB ESLint configuration.
- Install ESLint locally to your project: `> npm install eslint --save-dev`.
- Install the [AirBnB ESLint configuration](https://www.npmjs.com/package/eslint-config-airbnb). Following package instructions we need to execute next sentences to install the right package versions and dependencies:
```bash
> export PKG=eslint-config-airbnb;
> npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
```
- Create a `.eslintrc` file in the root of our project. We must be sure to include the property `"extends": "airbnb"` as part of the configuration.
Next is a sample configuration file. Note we inherited configuration from AirBnB. In addition, we have added the eslint rules `valid-jsdoc` and `require-jsdoc` to forces us to write some JSDoc for functions, methods and classes.
```javascript
{
"extends": "airbnb",
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true
},
"rules": {
"valid-jsdoc": ["error", {
"requireReturn": true,
"requireReturnType": true,
"requireParamDescription": true,
"requireReturnDescription": true
}],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true
}
}]
}
}
```
Right now our project is configured with ESLint and the base set of rules from AirBnB, but it requires we execute ESLint manually or automatize in some way (in the build process).
### Installing Atom plugins
Lets go to configure Atom to automatically lint files and show us message while coding.
> Be sure you have completed successfully the previous sections.
- Install the Atom plugin [linter-eslint](https://github.com/AtomLinter/linter-eslint). You are finished :)
The plugin will detect automatically the `.eslintrc` file in your project and will start linting on the fly the source code showing all the errors and warning.