Skip to content

chore(frontend): clear the two eslint errors in the auth feature (#878) - #885

Merged
alex-dembele merged 1 commit into
masterfrom
878-auth-lint
Oct 2, 2026
Merged

alex-dembele merged 1 commit into
masterfrom
878-auth-lint

Conversation

@alex-dembele

Copy link
Copy Markdown
Member

Closes #878

  • MFAEnrollmentBanner.tsx: copyFor was exported but imported nowhere, which tripped react-refresh/only-export-components. It's now module-private. Nothing needed a new module, so criterion 4 has nothing to move.
  • MFAPostAhaPrompt.tsx: the prompt was opened by setOpen(true) inside an effect (react-hooks/set-state-in-effect). The decision is now taken while rendering, once per transition into eligibility (React's "adjust state while rendering" pattern). Only the side effect, writing the cooldown to localStorage, stays in an effect. No rule is disabled.

Verification

  • npx eslint src/features/auth → 0 problems (master: 2 errors). npx tsc -b --noEmit → OK. Prettier → OK. npm run build → built in 6.13s.
  • npx vitest run → 107 files, 993 tests passed, on two consecutive runs. A first run under heavy machine load showed 22 transient failures in unrelated files; it didn't reproduce, and master gives the same 993/993.
  • Existing tests unchanged and passing: mfaPostAhaPrompt.test.tsx (8 cases), mfaEnrollmentBanner*.test.tsx, exitTimerTokens.test.ts.
  • Live (headless Chromium, temporary Vite harness rendering the real MFAPostAhaPrompt with a pre-filled React Query cache; the harness was deleted before the commit):
1 not eligible                      → open false, cooldown null
2 Aha reached                       → open true,  cooldown written
3 Escape                            → open false
4 eligible again within cooldown    → open false
5 eligible again after the cooldown → open true
console errors: none

Honest remainders

  • The live pass used a harness, not the full app with a tenant that reached the Aha moment, because the Playwright MCP browser was busy with another session.

Signed-off-by: alex-dembele <alexandredembele16@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(frontend): two eslint errors in the auth feature (MFAEnrollmentBanner, MFAPostAhaPrompt)

1 participant