From c78359658d9052087209b2f177e84b956972b28c Mon Sep 17 00:00:00 2001 From: Abdulraoof Date: Sat, 8 Mar 2025 00:08:37 +0300 Subject: [PATCH 1/2] Remove unneeded deps from remote fetch method --- src/lib/views/Day.tsx | 3 ++- src/lib/views/Month.tsx | 3 ++- src/lib/views/Week.tsx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/views/Day.tsx b/src/lib/views/Day.tsx index e84d70b2..6e6ad399 100644 --- a/src/lib/views/Day.tsx +++ b/src/lib/views/Day.tsx @@ -94,7 +94,8 @@ const Day = () => { } finally { triggerLoading(false); } - }, [triggerLoading, START_TIME, END_TIME, getRemoteEvents, handleState]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [getRemoteEvents]); useEffect(() => { if (getRemoteEvents instanceof Function) { diff --git a/src/lib/views/Month.tsx b/src/lib/views/Month.tsx index ecdd82ea..4c6454f9 100644 --- a/src/lib/views/Month.tsx +++ b/src/lib/views/Month.tsx @@ -63,7 +63,8 @@ const Month = () => { } finally { triggerLoading(false); } - }, [triggerLoading, eachWeekStart, daysList.length, getRemoteEvents, handleState]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [daysList.length, getRemoteEvents]); useEffect(() => { if (getRemoteEvents instanceof Function) { diff --git a/src/lib/views/Week.tsx b/src/lib/views/Week.tsx index 3ac36fb6..62aac917 100644 --- a/src/lib/views/Week.tsx +++ b/src/lib/views/Week.tsx @@ -69,7 +69,8 @@ const Week = () => { } finally { triggerLoading(false); } - }, [triggerLoading, getRemoteEvents, weekStart, weekEnd, handleState]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [getRemoteEvents]); useEffect(() => { if (getRemoteEvents instanceof Function) { From 64158c0c40379ecef01553e8bebf1050ff270bec Mon Sep 17 00:00:00 2001 From: Abdulraoof Date: Sat, 8 Mar 2025 00:16:01 +0300 Subject: [PATCH 2/2] eslint react-hooks import --- eslint.config.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 88ee9b94..7d67287f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,7 +2,7 @@ import react from "eslint-plugin-react"; import tseslint, { configs as tseslintConfigs } from "typescript-eslint"; import globals from "globals"; import js from "@eslint/js"; -import reactHooks from "eslint-plugin-react-hooks"; +import * as reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; import pluginImport from "eslint-plugin-import"; import pluginJsxA11y from "eslint-plugin-jsx-a11y"; diff --git a/package.json b/package.json index 8b7258b3..e37058a3 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-promise": "^7.2.1", "eslint-plugin-react": "^7.37.4", - "eslint-plugin-react-hooks": "^5.1.0", + "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-refresh": "^0.4.19", "globals": "^16.0.0", "husky": "^9.1.7",