Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gracepark committed Nov 18, 2024
1 parent 88a304a commit 47c24b5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ npm install --save-dev eslint eslint-plugin-github

## Setup

### Legacy Configuration (`.eslintrc`)

Add `github` to your list of plugins in your ESLint config.

JSON ESLint config example:
Expand All @@ -28,6 +30,31 @@ JSON ESLint config example:
}
```

### Flat Configurations (`eslint-config.js`)

Import the `eslint-plugin-github`, and extend any of the configurations using `getFlatConfigs()` as needed like so:

```js
import github from 'eslint-plugin-github'

export default [
github.getFlatConfigs().browser,
github.getFlatConfigs().recommended,
github.getFlatConfigs().react,
...github.getFlatConfigs().typescript,
{
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
ignores: ['eslint.config.mjs'],
rules: {
'github/array-foreach': 'error',
'github/async-preventdefault': 'warn',
'github/no-then': 'error',
'github/no-blur': 'error',
},
},
]
```

The available configs are:

- `internal`
Expand Down

0 comments on commit 47c24b5

Please sign in to comment.