From 8abc202c7fc73fdfcd9443b00d09d06da4b5cbb1 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Wed, 27 May 2020 02:08:41 +0200 Subject: [PATCH] [eslint-plugin-react-hooks] Prefer recommended eslint configuration (#18951) * [eslint-plugin-react-hooks] Prefer recommended eslint configuration * Update README.md Co-authored-by: Dan Abramov --- packages/eslint-plugin-react-hooks/README.md | 25 +++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin-react-hooks/README.md b/packages/eslint-plugin-react-hooks/README.md index 480891c72a..d31b6e3b76 100644 --- a/packages/eslint-plugin-react-hooks/README.md +++ b/packages/eslint-plugin-react-hooks/README.md @@ -18,7 +18,20 @@ npm install eslint-plugin-react-hooks --save-dev yarn add eslint-plugin-react-hooks --dev ``` -Then add it to your ESLint configuration: +Then extend the recommended eslint config: + +```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: ```js { @@ -34,16 +47,6 @@ Then add it to your ESLint configuration: } ``` -Or use the recommended config: - -```js -{ - "extends": [ - // ... - "plugin:react-hooks/recommended" - ] -} -``` ## Valid and Invalid Examples