Skip to content

react-hooks v7 new-rules audit (13 downgraded to warn in a3b1435) #53

Open

Description

@utof

Summary

Commit `a3b1435` adopted `eslint-plugin-react-hooks` v7 but downgraded 13 new experimental rules to `warn` to avoid a flood of refactor work in a chore-scope commit. This issue tracks auditing each rule against the codebase and promoting viable ones back to `error`.

The two classic rules stayed at `error` (`rules-of-hooks`, `exhaustive-deps`).

Rules to audit

From `eslint-plugin-react-hooks` v7 release notes:

  • `react-hooks/static-components`
  • `react-hooks/purity`
  • `react-hooks/immutability`
  • `react-hooks/set-state-in-effect`
  • `react-hooks/set-state-in-render`
  • `react-hooks/error-boundaries`
  • `react-hooks/unsupported-syntax`
  • `react-hooks/component-hook-factories`
  • `react-hooks/config`
  • `react-hooks/fbt`
  • `react-hooks/gating`
  • `react-hooks/globals`
  • `react-hooks/refs`

(Exact rule names to verify against v7 README at adoption time.)

Prioritization — per Opus reviewer

Semantically load-bearing: `error-boundaries`, `set-state-in-effect`, `set-state-in-render`, `purity`, `immutability`. These should be audited first — if they'd catch real bugs, promote them to `error`.

Approach

For each rule:

  1. Temporarily promote to `error` in `apps/desktop/eslint.config.js`.
  2. Run `bun run lint`.
  3. Count violations.
  4. Categorize: fixable in < 30 min → fix inline + leave at `error`; bigger → file sub-issue + revert to `warn` with "tracked in #NN" comment.

Rationale

Each of these rules encodes React-team learning about hooks misuse. Leaving them at `warn` permanently defeats the purpose of adopting v7. Tracked as follow-up to keep the strictening pass honest.

Related: #62 (strictening) task #62 in internal tracker.

Activity

  1. added
    type/feature
    type/chore
    on Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/choretype/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions