diff --git a/web/packages/accounts/components/Verify2FACodeForm.tsx b/web/packages/accounts/components/Verify2FACodeForm.tsx index d83dba61cb..b52ab6a3cb 100644 --- a/web/packages/accounts/components/Verify2FACodeForm.tsx +++ b/web/packages/accounts/components/Verify2FACodeForm.tsx @@ -71,7 +71,7 @@ export const Verify2FACodeForm: React.FC = ({ useEffect(() => { if (values.otp.length == 6 && !isSubmitting) void submitForm(); - }, [values, isSubmitting]); + }, [values, isSubmitting, submitForm]); return (
diff --git a/web/packages/accounts/eslint.config.mjs b/web/packages/accounts/eslint.config.mjs index d721f5eb56..c2a6fbb566 100644 --- a/web/packages/accounts/eslint.config.mjs +++ b/web/packages/accounts/eslint.config.mjs @@ -4,10 +4,7 @@ export default [ ...config, { rules: { - /* TODO: - * "This rule requires the `strictNullChecks` compiler option to be - * turned on to function correctly" - */ + /* TODO: */ "@typescript-eslint/no-unnecessary-condition": "off", "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-explicit-any": "off", @@ -15,8 +12,6 @@ export default [ "@typescript-eslint/no-unsafe-member-access": "off", "@typescript-eslint/no-unsafe-argument": "off", "@typescript-eslint/no-unsafe-call": "off", - /** TODO: Disabled as we migrate, try to prune these again */ - "react-hooks/exhaustive-deps": "off", }, }, ]; diff --git a/web/packages/accounts/pages/change-email.tsx b/web/packages/accounts/pages/change-email.tsx index cbf6618f9e..cc965f02b7 100644 --- a/web/packages/accounts/pages/change-email.tsx +++ b/web/packages/accounts/pages/change-email.tsx @@ -27,7 +27,7 @@ const Page: React.FC = () => { if (!user?.token) { void router.push("/"); } - }, []); + }, [router]); return ( diff --git a/web/packages/accounts/pages/change-password.tsx b/web/packages/accounts/pages/change-password.tsx index d8cc197faa..e19d6aff7a 100644 --- a/web/packages/accounts/pages/change-password.tsx +++ b/web/packages/accounts/pages/change-password.tsx @@ -50,7 +50,7 @@ const Page: React.FC = () => { } else { setToken(user.token); } - }, []); + }, [router]); const onSubmit: SetPasswordFormProps["callback"] = async ( passphrase, diff --git a/web/packages/accounts/pages/credentials.tsx b/web/packages/accounts/pages/credentials.tsx index 76c2b50829..db8cd75a7a 100644 --- a/web/packages/accounts/pages/credentials.tsx +++ b/web/packages/accounts/pages/credentials.tsx @@ -199,9 +199,10 @@ const Page: React.FC = () => { } }; void main(); + // TODO: validateSession is a dependency, but add that only after we've + // wrapped items from the callback (like logout) in useCallback too. + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - // TODO: ^ validateSession is a dependency, but add that only after we've - // wrapped items from the callback (like logout) in useCallback too. const getKeyAttributes: VerifyMasterPasswordFormProps["getKeyAttributes"] = async (kek: string) => { diff --git a/web/packages/accounts/pages/generate.tsx b/web/packages/accounts/pages/generate.tsx index 5794a98171..8010e7e378 100644 --- a/web/packages/accounts/pages/generate.tsx +++ b/web/packages/accounts/pages/generate.tsx @@ -65,7 +65,7 @@ const Page: React.FC = () => { setToken(user.token); setLoading(false); } - }, []); + }, [router]); const onSubmit: SetPasswordFormProps["callback"] = async ( passphrase, diff --git a/web/packages/accounts/pages/login.tsx b/web/packages/accounts/pages/login.tsx index 5e26b9cd2a..a4927b61c9 100644 --- a/web/packages/accounts/pages/login.tsx +++ b/web/packages/accounts/pages/login.tsx @@ -20,7 +20,7 @@ const Page: React.FC = () => { void router.push(PAGES.VERIFY); } setLoading(false); - }, []); + }, [router]); const onSignUp = () => void router.push(PAGES.SIGNUP); diff --git a/web/packages/accounts/pages/passkeys/finish.tsx b/web/packages/accounts/pages/passkeys/finish.tsx index 1ef91aaad8..258d062b94 100644 --- a/web/packages/accounts/pages/passkeys/finish.tsx +++ b/web/packages/accounts/pages/passkeys/finish.tsx @@ -33,7 +33,7 @@ const Page: React.FC = () => { void saveCredentialsAndNavigateTo(passkeySessionID, response).then( (slug: string) => router.push(slug), ); - }, []); + }, [router]); return ; }; diff --git a/web/packages/accounts/pages/recover.tsx b/web/packages/accounts/pages/recover.tsx index 29c92dcb02..7c69ea44a6 100644 --- a/web/packages/accounts/pages/recover.tsx +++ b/web/packages/accounts/pages/recover.tsx @@ -59,7 +59,7 @@ const Page: React.FC = () => { } else { setKeyAttributes(keyAttributes); } - }, []); + }, [router]); const recover: SingleInputFormProps["callback"] = async ( recoveryKey: string, diff --git a/web/packages/accounts/pages/signup.tsx b/web/packages/accounts/pages/signup.tsx index 89033339b5..4920053c24 100644 --- a/web/packages/accounts/pages/signup.tsx +++ b/web/packages/accounts/pages/signup.tsx @@ -20,7 +20,7 @@ const Page: React.FC = () => { void router.push(PAGES.VERIFY); } setLoading(false); - }, []); + }, [router]); const onLogin = () => void router.push(PAGES.LOGIN); diff --git a/web/packages/accounts/pages/two-factor/recover.tsx b/web/packages/accounts/pages/two-factor/recover.tsx index 6c6925a84d..274042ecdd 100644 --- a/web/packages/accounts/pages/two-factor/recover.tsx +++ b/web/packages/accounts/pages/two-factor/recover.tsx @@ -92,6 +92,8 @@ const Page: React.FC = ({ twoFactorType }) => { } }; void main(); + // TODO: + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const recover: SingleInputFormProps["callback"] = async ( diff --git a/web/packages/accounts/pages/two-factor/verify.tsx b/web/packages/accounts/pages/two-factor/verify.tsx index e1e13af0c0..8434969600 100644 --- a/web/packages/accounts/pages/two-factor/verify.tsx +++ b/web/packages/accounts/pages/two-factor/verify.tsx @@ -40,7 +40,7 @@ const Page: React.FC = () => { } else { setSessionID(user.twoFactorSessionID); } - }, []); + }, [router]); const handleSubmit = async (otp: string) => { try { diff --git a/web/packages/accounts/pages/verify.tsx b/web/packages/accounts/pages/verify.tsx index 3c1f0047ba..12eef1ac20 100644 --- a/web/packages/accounts/pages/verify.tsx +++ b/web/packages/accounts/pages/verify.tsx @@ -74,7 +74,7 @@ const Page: React.FC = () => { } }; void main(); - }, []); + }, [router]); const onSubmit: SingleInputFormProps["callback"] = async ( ott,