From 6a32557adead0595ee4f9f9f1ebe4221ca8151ac Mon Sep 17 00:00:00 2001 From: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 27 May 2026 11:03:49 +0200 Subject: [PATCH 1/3] chore(eslint): enable @eslint-react/exhaustive-deps rule - Simplify OidcProvider effect to depend on auth object directly - Add clearActiveItem to useActiveItemEffects deps (removes TODO) - Suppress useUrlParams deps warning with justification Co-Authored-By: Claude Opus 4.6 (1M context) --- client/src/app/components/OidcProvider.tsx | 2 +- .../hooks/table-controls/active-item/useActiveItemEffects.ts | 2 +- client/src/app/hooks/useUrlParams.ts | 2 +- eslint.config.mjs | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/app/components/OidcProvider.tsx b/client/src/app/components/OidcProvider.tsx index ccf779055..5e926ed0c 100644 --- a/client/src/app/components/OidcProvider.tsx +++ b/client/src/app/components/OidcProvider.tsx @@ -58,7 +58,7 @@ const AuthEnabledOidcProvider: React.FC = ({ url_state: window.location.pathname + window.location.search, }); } - }, [auth.isAuthenticated, auth.isLoading, auth.error, auth.signinRedirect]); + }, [auth]); if (auth.isAuthenticated) { return }>{children}; diff --git a/client/src/app/hooks/table-controls/active-item/useActiveItemEffects.ts b/client/src/app/hooks/table-controls/active-item/useActiveItemEffects.ts index fc58d3364..de5e47ba6 100644 --- a/client/src/app/hooks/table-controls/active-item/useActiveItemEffects.ts +++ b/client/src/app/hooks/table-controls/active-item/useActiveItemEffects.ts @@ -37,5 +37,5 @@ export const useActiveItemEffects = ({ if (!isLoading && activeItemId && !activeItem) { clearActiveItem(); } - }, [isLoading, activeItemId, activeItem]); // TODO fix the exhaustive-deps lint warning here without affecting behavior + }, [isLoading, activeItemId, activeItem, clearActiveItem]); }; diff --git a/client/src/app/hooks/useUrlParams.ts b/client/src/app/hooks/useUrlParams.ts index 91cf894f6..2f1bdd816 100644 --- a/client/src/app/hooks/useUrlParams.ts +++ b/client/src/app/hooks/useUrlParams.ts @@ -111,8 +111,8 @@ export const useUrlParams = < } React.useEffect(() => { + // eslint-disable-next-line @eslint-react/exhaustive-deps -- setParams and defaultValue are stable per-mount; including them causes render loops if (allParamsEmpty) setParams(defaultValue); - // Leaving this rule enabled results in a cascade of unnecessary useCallbacks: }, [allParamsEmpty]); return [params, setParams]; diff --git a/eslint.config.mjs b/eslint.config.mjs index 37cf5f34d..5f16e81b4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -43,7 +43,6 @@ export default defineConfig([ "@eslint-react/no-unnecessary-use-prefix": "off", "@typescript-eslint/no-unused-vars": "off", "@eslint-react/static-components": "off", - "@eslint-react/exhaustive-deps": "off", "@eslint-react/no-nested-component-definitions": "off", "@tanstack/query/prefer-query-options": "off", "@tanstack/query/exhaustive-deps": "off", From 05cfe596846a29f8e8f952bd28d1a0649ee394bb Mon Sep 17 00:00:00 2001 From: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 27 May 2026 13:51:43 +0200 Subject: [PATCH 2/3] fix: move eslint-disable comment to correct line for exhaustive-deps The suppress comment needs to be on the useEffect call, not inside the callback. Co-Authored-By: Claude Opus 4.6 (1M context) --- client/src/app/hooks/useUrlParams.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/hooks/useUrlParams.ts b/client/src/app/hooks/useUrlParams.ts index 2f1bdd816..ebf58ce7d 100644 --- a/client/src/app/hooks/useUrlParams.ts +++ b/client/src/app/hooks/useUrlParams.ts @@ -110,8 +110,8 @@ export const useUrlParams = < params = allParamsEmpty ? defaultValue : deserialize(serializedParams); } + // eslint-disable-next-line @eslint-react/exhaustive-deps -- setParams and defaultValue are stable per-mount; including them causes render loops React.useEffect(() => { - // eslint-disable-next-line @eslint-react/exhaustive-deps -- setParams and defaultValue are stable per-mount; including them causes render loops if (allParamsEmpty) setParams(defaultValue); }, [allParamsEmpty]); From b7792b08832936ba8cd454bdf465429d83b48ec5 Mon Sep 17 00:00:00 2001 From: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 27 May 2026 14:10:23 +0200 Subject: [PATCH 3/3] fix: use block-level eslint-disable for exhaustive-deps suppression eslint-disable-next-line doesn't cover the dependency array line; use block-level disable/enable instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- client/src/app/hooks/useUrlParams.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/app/hooks/useUrlParams.ts b/client/src/app/hooks/useUrlParams.ts index ebf58ce7d..92531ce9b 100644 --- a/client/src/app/hooks/useUrlParams.ts +++ b/client/src/app/hooks/useUrlParams.ts @@ -110,10 +110,11 @@ export const useUrlParams = < params = allParamsEmpty ? defaultValue : deserialize(serializedParams); } - // eslint-disable-next-line @eslint-react/exhaustive-deps -- setParams and defaultValue are stable per-mount; including them causes render loops + /* eslint-disable @eslint-react/exhaustive-deps -- setParams and defaultValue are stable per-mount; including them causes render loops */ React.useEffect(() => { if (allParamsEmpty) setParams(defaultValue); }, [allParamsEmpty]); + /* eslint-enable @eslint-react/exhaustive-deps */ return [params, setParams]; };