open-index/open-npm huggingface dataset:
npm package: @prodigy/eslint-config-prodigy
Description: ESLint Base Configuration for Prodigy Projects
Latest version: 0.0.7

# Prodigy Shared ESLint

This repo contains [ESLint](http://eslint.org) configuration for use against all of Prodigy's JavaScript projects. Our rules are based on the [AirBnB ESLint Configuration](https://github.com/airbnb/javascript) for both ES5 and ES6+. Changes to these rules can be proposed via a issues or a pull request.

If you haven't read the [AirBnB Styleguide](https://github.com/airbnb/javascript) it's worth a read, because some of their guidelines cannot yet be enforced by linters ([filenames, for instance](https://github.com/airbnb/javascript#naming--filename-matches-export)).

# Usage

Install the linter:
```
npm install --save-dev eslint eslint-plugin-import eslint-config-airbnb-base@9.0.0
npm install --save-dev @prodigy/eslint-config-prodigy
```

Then add the configuration to your package.json.

### For an ES6+ project:
```
"eslintConfig": {
    "extends": "@prodigy/eslint-config-prodigy"
}
```

### For an ES5 project:
```
"eslintConfig": {
    "extends": "@prodigy/eslint-config-prodigy/es5"
}
```

### For Tests:

With tests, you can include an `eslintrc.json` file in your tests folder and it will change the rules for use in tests:

```
{
    "extends": "@prodigy/eslint-config-prodigy/tests"
}
```

This will override settings from the ESLint config at the lower levels.

## NPM Script

If you want, you can also add an npm command for linting to your package.json:

```
"scripts": {
  "lint": "eslint --ignore-path .gitignore ."
}
```

Or, for just files that have changed since the dev branch:
```
"scripts": {
  "lint": "git diff --name-only dev | grep "\.js\$" | xargs eslint"
}
```

# Automatic Fixing

Many of the errors detected by ESLint can be automatically fixed. Whether or not you should do this on a project-wide basis should be discussed ahead of time with your team. Doing this carelessly can lead to a messy git history.

That said, you can have ESLint fix errors on a per-file basis or configure your editor with a command that can automatically lint. It is always a good idea to fix linting problems with code in a separate commit or PR before you make changes.

To fix changes in a file:
```
./node_modules/.bin/eslint --fix file.js
```

To fix changes in a folder (recursive):
```
./node_modules/.bin/eslint --fix .
```

# Editor Configuration

Most of the value of the linter will come from editor integration. The following plugins may be of value:

* Atom: [Linter](https://atom.io/packages/linter)
* Emacs: [FlyCheck](https://github.com/flycheck/flycheck)
* Sublime Text: [SublimeLinter](http://www.sublimelinter.com/en/latest/)
* Vim: [Syntastic](https://github.com/scrooloose/syntastic)

Note, that to get ESLint working with your editor, you may need to install it globally (with -g).