From 72c7b2b9ce1ed26e99604f3db67c027420283b34 Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 14 Feb 2022 13:33:52 +0000 Subject: [PATCH] adding eslint-plugin-react-hooks plugin and fixing 1 error --- .eslintrc.js | 2 +- package.json | 2 +- packages/r3f/src/components/EditorHelper.tsx | 3 +-- yarn.lock | 11 ++++++++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 89273c0..a719800 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,7 @@ module.exports = { root: true, plugins: ['unused-imports', 'eslint-plugin-tsdoc'], - extends: [], + extends: ['plugin:react-hooks/recommended'], rules: { 'unused-imports/no-unused-imports': 'warn', 'tsdoc/syntax': 'warn', diff --git a/package.json b/package.json index 9e2dbdb..0cb120d 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "eslint": "^7.32.0", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-react": "^7.25.1", - "eslint-plugin-react-hooks": "^4.2.0", + "eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-tsdoc": "^0.2.14", "eslint-plugin-unused-imports": "^1.1.4", "husky": "^6.0.0", diff --git a/packages/r3f/src/components/EditorHelper.tsx b/packages/r3f/src/components/EditorHelper.tsx index 3ef91e4..1221f0b 100644 --- a/packages/r3f/src/components/EditorHelper.tsx +++ b/packages/r3f/src/components/EditorHelper.tsx @@ -11,9 +11,8 @@ const EditorHelper = ({ component: Component, ...props }: EditorHelperProps) => { + const helpersRoot = useEditorStore((state) => state.helpersRoot) if (process.env.NODE_ENV === 'development') { - const helpersRoot = useEditorStore((state) => state.helpersRoot) - return <>{createPortal(, helpersRoot)} } else { return null diff --git a/yarn.lock b/yarn.lock index 14ae987..0a758de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11116,6 +11116,15 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-react-hooks@npm:^4.3.0": + version: 4.3.0 + resolution: "eslint-plugin-react-hooks@npm:4.3.0" + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + checksum: 55d65863c0aeebbb470c494fe7fdf014b661c5aef21d1ab0c4f19b291d28b2a905de78eb6133891e4677abb7bc37c8b4a252aef007de1559ae28ad70e57d494a + languageName: node + linkType: hard + "eslint-plugin-react@npm:^7.21.5": version: 7.24.0 resolution: "eslint-plugin-react@npm:7.24.0" @@ -22880,7 +22889,7 @@ fsevents@^1.2.7: eslint: ^7.32.0 eslint-plugin-jsx-a11y: ^6.4.1 eslint-plugin-react: ^7.25.1 - eslint-plugin-react-hooks: ^4.2.0 + eslint-plugin-react-hooks: ^4.3.0 eslint-plugin-tsdoc: ^0.2.14 eslint-plugin-unused-imports: ^1.1.4 husky: ^6.0.0