File tree Expand file tree Collapse file tree 1 file changed +22
-11
lines changed Expand file tree Collapse file tree 1 file changed +22
-11
lines changed Original file line number Diff line number Diff line change 3
3
## Installation
4
4
5
5
``` sh
6
- $ npm install --save-dev eslint
7
- $ npm install --save-dev eslint-plugin-github
6
+ $ npm install --save-dev eslint eslint-plugin-github
8
7
```
9
8
10
- Run initialization wizard.
9
+ ## Setup
11
10
12
- ``` sh
13
- $ node_modules/.bin/eslint-github-init
11
+ Add ` github ` to your list of plugins in your ESLint config.
12
+
13
+ JSON ESLint config example:
14
+ ``` json
15
+ {
16
+ "plugins" : [" github" ]
17
+ }
14
18
```
15
19
16
- Set up ` npm run lint ` script .
20
+ Extend the configs you wish to use .
17
21
22
+ JSON ESLint config example:
18
23
``` json
19
24
{
20
- "private" : true ,
21
- "scripts" : {
22
- "lint" : " github-lint"
23
- }
25
+ "extends" : ["extends" : [" plugin:github/recommended" ]
24
26
}
25
27
```
26
28
27
- The ` github-lint ` command will run various checkers and linters depending on your project configuration.
29
+ The available configs are:
30
+
31
+ - `app`
32
+ - Rules useful for github applications.
33
+ - `browser`
34
+ - Useful rules when shipping your app to the browser.
35
+ - `recommended`
36
+ - Recommended rules for every application.
37
+ - `typescript`
38
+ - Useful rules when writing TypeScript.
You can’t perform that action at this time.
0 commit comments