From a23d441dd3a4f8107256490493479c2b3dd04cd2 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 2 Sep 2023 19:48:23 +0200 Subject: [PATCH] Enable react-hooks/exhaustive-deps linting rule --- .eslintrc | 3 +-- src/servers/helpers/withSelectedServer.tsx | 2 +- src/servers/helpers/withoutSelectedServer.tsx | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.eslintrc b/.eslintrc index 8371c72d..ff27eecb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -8,7 +8,6 @@ }, "ignorePatterns": ["src/service*.ts"], "rules": { - "react-hooks/rules-of-hooks": "off", - "react-hooks/exhaustive-deps": "off" + "react-hooks/rules-of-hooks": "off" } } diff --git a/src/servers/helpers/withSelectedServer.tsx b/src/servers/helpers/withSelectedServer.tsx index 58057af2..61804290 100644 --- a/src/servers/helpers/withSelectedServer.tsx +++ b/src/servers/helpers/withSelectedServer.tsx @@ -18,7 +18,7 @@ export function withSelectedServer(WrappedComponent: FC { params.serverId && selectServer(params.serverId); - }, [params.serverId]); + }, [params.serverId, selectServer]); if (!selectedServer) { return ( diff --git a/src/servers/helpers/withoutSelectedServer.tsx b/src/servers/helpers/withoutSelectedServer.tsx index 53f5b4c7..1c12adb7 100644 --- a/src/servers/helpers/withoutSelectedServer.tsx +++ b/src/servers/helpers/withoutSelectedServer.tsx @@ -10,7 +10,7 @@ export function withoutSelectedServer(WrappedComponent: FC { resetSelectedServer(); - }, []); + }, [resetSelectedServer]); return ; };