From 4ce2f94e838632d625113ca57859c7181173842a Mon Sep 17 00:00:00 2001
From: Magnus Andreas Igesund Nerland
Date: Tue, 17 Nov 2026 20:06:16 +0100
Subject: [PATCH 1/2] fix(auth): separate refs in AuthForm for the
react-hooks/refs rule (#76)
---
.../src/features/auth/components/AuthForm.tsx | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/frontend/src/features/auth/components/AuthForm.tsx b/frontend/src/features/auth/components/AuthForm.tsx
index 0958fc3..be48b9c 100644
--- a/frontend/src/features/auth/components/AuthForm.tsx
+++ b/frontend/src/features/auth/components/AuthForm.tsx
@@ -37,17 +37,18 @@ export function AuthForm({ mode, onSubmit }: AuthFormProps) {
const [formError, setFormError] = useState('');
const [working, setWorking] = useState(false);
const id = useId();
- const inputs = {
- username: useRef(null),
- password: useRef(null),
- };
+ // Two plain refs, passed straight to `ref`. Keeping them in an object and reading
+ // `inputs.password` while rendering breaks the react-hooks/refs rule (React Compiler).
+ const usernameInput = useRef(null);
+ const passwordInput = useRef(null);
const isRegister = mode === 'register';
/** Shows the messages and moves focus to the first field that has one. */
function showFieldErrors(errors: FieldErrors) {
setFieldErrors(errors);
const first = FIELDS.find((field) => errors[field]);
- if (first) inputs[first].current?.focus();
+ if (first === 'username') usernameInput.current?.focus();
+ else if (first === 'password') passwordInput.current?.focus();
}
async function handleSubmit(event: FormEvent) {
@@ -102,7 +103,7 @@ export function AuthForm({ mode, onSubmit }: AuthFormProps) {
)}
)}
Date: Tue, 17 Nov 2026 20:06:33 +0100
Subject: [PATCH 2/2] chore(lint): ignore generated test and coverage folders
(#76)
---
frontend/.prettierignore | 5 +++++
frontend/eslint.config.js | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/frontend/.prettierignore b/frontend/.prettierignore
index 91a3983..2368dab 100644
--- a/frontend/.prettierignore
+++ b/frontend/.prettierignore
@@ -1,3 +1,8 @@
dist
node_modules
package-lock.json
+# Generated by tests and coverage, the same folders as in .gitignore
+coverage
+test-results
+playwright-report
+blob-report
diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js
index 8d061c7..d71ae67 100644
--- a/frontend/eslint.config.js
+++ b/frontend/eslint.config.js
@@ -7,7 +7,8 @@ import { defineConfig, globalIgnores } from 'eslint/config';
import prettier from 'eslint-config-prettier';
export default defineConfig([
- globalIgnores(['dist']),
+ // Built and generated files, the same folders as in .gitignore.
+ globalIgnores(['dist', 'coverage', 'test-results', 'playwright-report', 'blob-report']),
{
files: ['**/*.{ts,tsx}'],
extends: [