| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 # eslint-config-eyeo | 1 # eslint-config-eyeo |
| 2 | 2 |
| 3 An [ESLint](http://eslint.org) configuration that checks for compliance with the | 3 An [ESLint](http://eslint.org) configuration that checks for compliance with the |
| 4 [Adblock Plus coding style guide](https://adblockplus.org/coding-style#javascrip t). | 4 [Adblock Plus coding style guide](https://adblockplus.org/coding-style#javascrip t) |
|
Sebastian Noack
2017/02/10 18:04:31
This seems a little inconsistent with the decision
kzar
2017/02/10 19:10:44
Done.
| |
| 5 which is used for all eyeo projects. | |
| 5 | 6 |
| 6 ## Installation | 7 ## Installation |
| 7 | 8 |
| 8 npm install -g eslint eslint-config-eyeo | 9 npm install -g eslint eslint-config-eyeo |
| 9 | 10 |
| 10 (As root, or using sudo.) | 11 This command requires administrator privileges so you might need to use `sudo`. |
| 11 | 12 |
| 12 ## Usage | 13 ## Usage |
| 13 | 14 |
| 14 To lint a JavaScript file using ESLint you simply run the `eslint` command with | 15 To lint a JavaScript file using ESLint you run the `eslint` command with the |
| 15 the file as an argument. For example: | 16 file as an argument. For example: |
| 16 | 17 |
| 17 eslint some-file.js | 18 eslint some-file.js |
| 18 | 19 |
| 19 (For advanced usage see `eslint --help`.) | 20 For advanced usage see `eslint --help`. |
| 20 | 21 |
| 21 Note: If you need to lint files inside projects which do not already have an | 22 In order to use eslint-config-eyeo your project's ESLint configuration |
|
Sebastian Noack
2017/02/10 18:04:31
This is not only relevant when linting projects th
kzar
2017/02/10 19:10:44
Done.
| |
| 22 ESLint configuration which extends `eslint-config-eyeo` you can create a | 23 should extend from it. A minimal example looks like this: |
| 23 personal configuration in `~/.eslintrc.json` like so: | |
| 24 | 24 |
| 25 { | 25 { |
| 26 "extends": "eslint-config-eyeo" | 26 "extends": "eslint-config-eyeo", |
| 27 "root": true | |
| 27 } | 28 } |
| 29 | |
| 30 For projects without an ESLint configuration you can create your own | |
| 31 personal configuration in `~/.eslintrc.json`, but take care to remove | |
| 32 the `"root": true` section from the above example. | |
| LEFT | RIGHT |