From 8492dbef92d673642893168631f7861a5c808ab5 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Wed, 6 Aug 2025 15:37:23 +0200 Subject: [PATCH] docs(eslint-plugin-react-hooks): document React Compiler rule --- packages/eslint-plugin-react-hooks/README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin-react-hooks/README.md b/packages/eslint-plugin-react-hooks/README.md index 10020afd610..e7b8bf015a2 100644 --- a/packages/eslint-plugin-react-hooks/README.md +++ b/packages/eslint-plugin-react-hooks/README.md @@ -1,8 +1,9 @@ # `eslint-plugin-react-hooks` -This ESLint plugin enforces the [Rules of Hooks](https://react.dev/reference/rules/rules-of-hooks). +This ESLint plugin: -It is a part of the [Hooks API](https://react.dev/reference/react/hooks) for React. +- reports violations of the [Rules of Hooks](https://react.dev/reference/rules/rules-of-hooks) +- reports React code problematic for the React compiler ## Installation @@ -33,6 +34,21 @@ export default [ ]; ``` +Optionally, enable the React compiler rule: + +```js +import * as reactHooks from 'eslint-plugin-react-hooks'; + +export default [ + reactHooks.configs.recommended, + { + rules: { + 'react-hooks/react-compiler': 'error', + }, + }, +]; +``` + #### 5.2.0 For users of 5.2.0 (the first version with flat config support), add the `recommended-latest` config.