Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions packages/eslint-plugin-react-hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,24 @@ yarn add eslint-plugin-react-hooks --dev

### Flat Config (eslint.config.js|ts)

For [ESLint 9.0.0 and above](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/), add the `recommended` config.
#### 5.2.0

For users of 5.2.0 (the first version with flat config support), add the `recommended-latest` config.

```js
import * as reactHooks from 'eslint-plugin-react-hooks';

export default [
// ...
reactHooks.configs['recommended'],
reactHooks.configs['recommended-latest'],
];
```

### Legacy Config (.eslintrc)

If you are still using ESLint below 9.0.0, you can use `recommended-legacy` for accessing the recommended config.
#### >= 5.2.0

If you are still using ESLint below 9.0.0, you can use `recommended-legacy` for accessing a legacy version of the recommended config.

```js
{
Expand All @@ -44,6 +48,19 @@ If you are still using ESLint below 9.0.0, you can use `recommended-legacy` for
}
```

#### < 5.2.0

If you're using a version earlier than 5.2.0, the legacy config was simply `recommended`.

```js
{
"extends": [
// ...
"plugin:react-hooks/recommended"
]
}
```

### Custom Configuration

If you want more fine-grained configuration, you can instead add a snippet like this to your ESLint configuration file:
Expand Down
Loading