https://github.com/strongloop/eslint-config-loopback
LoopBack's ESLint shareable configs.
https://github.com/strongloop/eslint-config-loopback
Last synced: 11 months ago
JSON representation
LoopBack's ESLint shareable configs.
- Host: GitHub
- URL: https://github.com/strongloop/eslint-config-loopback
- Owner: strongloop
- License: other
- Created: 2016-01-12T22:39:38.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T11:57:39.000Z (almost 7 years ago)
- Last Synced: 2025-02-11T18:04:53.238Z (12 months ago)
- Homepage: http://eslint.org/docs/developer-guide/shareable-configs
- Size: 48.8 KB
- Stars: 20
- Watchers: 24
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# eslint-config-loopback
LoopBack's ESLint shareable configs.
## Usage
Add `eslint` and `eslint-config-loopback` to `devDependencies`:
```
npm install -D eslint eslint-config-loopback
```
In your project root, create/modify `.eslintrc`:
```
{
"extends": "loopback"
}
```
Then in `package.json`, set your run script:
```
...
"scripts": {
"lint": "eslint ."
},
...
```
That's it. Try it out by running:
```
npm run lint
```
> It is recommended to set a `posttest` run script to auto lint after
> running tests:
>
> ```
> ...
> "scripts": {
> "lint": "eslint .",
> "test": "mocha",
> "posttest": "npm run lint"
> },
> ...
> ```
## Overriding rules
To override a particular rule, use the `rules` key:
```
{
"extends": "loopback",
"rules": {
"comma-dangle": "off"
}
}
```
While adopting ESLint in existing projects, there may be too many errors to fix
at once. In such cases, it may be desirable to modify the [`rule setting`](http://eslint.org/docs/user-guide/configuring.html#configuring-rules)
of individual rules:
- `"off"` - Turn the rule off
- `"warn"` - Turn the rule on as a warning (doesn't affect exit code)
- `"error"` - Turn the rule on as an error (exit code is 1 when triggered)