Skip to content

ui: fix the 24 files flagged by react-hooks 7's compiler-era rules, then restore them to error #9588

Description

@JSONbored

Follow-up from #8608's eslint 10 migration.

eslint-plugin-react-hooks 5 → 7 (forced by the eslint 10 security chain) introduced four React-Compiler-era rules that flag 24 pre-existing files in apps/loopover-ui:

  • react-hooks/set-state-in-effect (24 errors — the bulk)
  • react-hooks/purity (1)
  • react-hooks/refs (1)
  • react-hooks/static-components (1)

apps/loopover-miner-ui is already clean (it adopted v7 earlier).

These are demoted to warn in apps/loopover-ui/eslint.config.ts with a comment citing #8608 — fixing setState-in-effect patterns is real UI refactoring with behaviour risk, not something to smuggle into a dependency bump. Every rule that existed in v5 stays at error.

The work

Fix the flagged patterns file-by-file (mostly converting synchronous setState inside effects to derived state, event handlers, or useSyncExternalStore where appropriate), then delete the four "warn" overrides so the rules return to error via the recommended preset.

The warning output of npm run ui:lint is the live worklist.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions