@samitouri / QOS-React / commits / 443b7ff2a8

docs(eslint-plugin-react-hooks): clarify config details for prior versions (#32498)

This change adds more details about prior versions of the plugin's config, to help people as they migrate from legacy to flat configs across multiple versions of this plugin. At some point in the 6.0 or 7.0 cycle, it would probably make sense to re-consolidate this into a single version. Closes #32494

michael faith committed Mar 3, 2025 at 19:57 UTC 443b7ff2a8437f7736491ae7136c21d75d5a2019
1 file changed +20 -3
packages/eslint-plugin-react-hooks/README.md
+20 -3
@@ -20,20 +20,24 @@ yarn add eslint-plugin-react-hooks --dev
20
21 ### Flat Config (eslint.config.js|ts)
22
23 -For [ESLint 9.0.0 and above](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/), add the `recommended` config.
23 +#### 5.2.0
24 +
25 +For users of 5.2.0 (the first version with flat config support), add the `recommended-latest` config.
26
27 ```js
28 import * as reactHooks from 'eslint-plugin-react-hooks';
29
30 export default [
31 // ...
30 - reactHooks.configs['recommended'],
32 + reactHooks.configs['recommended-latest'],
33 ];
34 ```
35
36 ### Legacy Config (.eslintrc)
37
36 -If you are still using ESLint below 9.0.0, you can use `recommended-legacy` for accessing the recommended config.
38 +#### >= 5.2.0
39 +
40 +If you are still using ESLint below 9.0.0, you can use `recommended-legacy` for accessing a legacy version of the recommended config.
41
42 ```js
43 {
@@ -44,6 +48,19 @@ If you are still using ESLint below 9.0.0, you can use `recommended-legacy` for
48 }
49 ```
50
51 +#### < 5.2.0
52 +
53 +If you're using a version earlier than 5.2.0, the legacy config was simply `recommended`.
54 +
55 +```js
56 +{
57 + "extends": [
58 + // ...
59 + "plugin:react-hooks/recommended"
60 + ]
61 +}
62 +```
63 +
64 ### Custom Configuration
65
66 If you want more fine-grained configuration, you can instead add a snippet like this to your ESLint configuration file: