From a8ad744e76e9a6e51faffc8c3d5c1279464f3c82 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 21 Jan 2025 12:59:08 +0700 Subject: [PATCH] Add `react/no-object-type-as-default-prop` rule https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.32.0/docs/rules/no-object-type-as-default-prop.md --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 79b89de..05c3351 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,12 @@ export default [ unnamedComponents: 'arrow-function', }, ], - 'react/hook-use-state': 'error', + 'react/hook-use-state': [ + 'error', + { + allowDestructuredState: true, + }, + ], 'react/iframe-missing-sandbox': 'error', 'react/no-access-state-in-setstate': 'error', 'react/no-array-index-key': 'error', @@ -51,6 +56,7 @@ export default [ 'react/no-invalid-html-attribute': 'error', 'react/no-is-mounted': 'error', 'react/no-namespace': 'error', + 'react/no-object-type-as-default-prop': 'error', 'react/no-redundant-should-component-update': 'error', 'react/no-render-return-value': 'error', 'react/no-typos': 'error',