Skip to content

chore: @eslint-react/purity (2 warnings) #1471

@steilerDev

Description

@steilerDev

Parent tracking issue: #1455

Summary

Resolve the 2 `@eslint-react/purity` warnings. The rule flags side effects (mutations, I/O, randomness, current-time reads) inside render functions, which break React's pure-render guarantee.

Fix pattern

Move the side effect out of render — into an event handler, a `useEffect`, or a `useMemo` with controlled deps. Common offenders:

  • `Math.random()` or `crypto.randomUUID()` at render top — wrap in `useState(() => crypto.randomUUID())` so it's stable across renders.
  • `new Date()` at render top — likewise, or get the time in an effect if it's meant to update.
  • Mutating an external variable or imported singleton during render.

Scope

Production code. Only 2 instances, find via `npm run lint` output.

Acceptance Criteria

  • `npm run lint` reports 0 `@eslint-react/purity` warnings
  • Output behavior preserved (e.g., stable IDs across renders if they were stable before)

Risk

Very low. Tiny scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt cleanup work (lint, refactors, etc.)

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions