Skip to content

Commit 47c24b5

Browse files
committed
update readme
1 parent 88a304a commit 47c24b5

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ npm install --save-dev eslint eslint-plugin-github
88

99
## Setup
1010

11+
### Legacy Configuration (`.eslintrc`)
12+
1113
Add `github` to your list of plugins in your ESLint config.
1214

1315
JSON ESLint config example:
@@ -28,6 +30,31 @@ JSON ESLint config example:
2830
}
2931
```
3032

33+
### Flat Configurations (`eslint-config.js`)
34+
35+
Import the `eslint-plugin-github`, and extend any of the configurations using `getFlatConfigs()` as needed like so:
36+
37+
```js
38+
import github from 'eslint-plugin-github'
39+
40+
export default [
41+
github.getFlatConfigs().browser,
42+
github.getFlatConfigs().recommended,
43+
github.getFlatConfigs().react,
44+
...github.getFlatConfigs().typescript,
45+
{
46+
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
47+
ignores: ['eslint.config.mjs'],
48+
rules: {
49+
'github/array-foreach': 'error',
50+
'github/async-preventdefault': 'warn',
51+
'github/no-then': 'error',
52+
'github/no-blur': 'error',
53+
},
54+
},
55+
]
56+
```
57+
3158
The available configs are:
3259

3360
- `internal`

0 commit comments

Comments
 (0)