Skip to content

build: React code has no rules-of-hooks or exhaustive-deps lint #718

Open

Description

@bpowers

No ESLint config loads eslint-plugin-react-hooks, so the React packages (src/app, src/diagram, src/simlin-serve/web, src/notebook-widget, website) get no rules-of-hooks or exhaustive-deps checking.
The reactConfig block in eslint.config.shared.js enables only eslint-plugin-react's recommended rules.

Why it matters

rules-of-hooks catches hooks called conditionally or out of order, which corrupts React's hook state at runtime.
exhaustive-deps catches missing dependencies in useEffect, useMemo, and useCallback, the usual source of stale-closure bugs.
The diagram editor is stateful and effect-heavy, which is where these bugs hide.

Fix

  1. Add eslint-plugin-react-hooks as a dev dependency wherever the shared config resolves its plugins.
  2. Register it in reactConfig, with react-hooks/rules-of-hooks as an error and react-hooks/exhaustive-deps as a warning or error.
  3. Fix what it reports.
    exhaustive-deps usually turns up a backlog on first use.
    Treat each finding as a real stale-closure bug or as an intentional omission that gets an inline disable with a reason; do not turn the rule off wholesale.

Pointers

  • eslint.config.shared.js (reactConfig)
  • src/*/eslint.config.js, src/simlin-serve/web/eslint.config.cjs, src/notebook-widget/eslint.config.cjs, website/eslint.config.js

Activity

  1. added
    frontend
    ci
    on Jun 8, 2026
  2. changed the title [-]build: React packages have no rules-of-hooks / exhaustive-deps linting[/-] [+]build: React code has no rules-of-hooks or exhaustive-deps lint[/+] on Oct 12, 2026
  3. added
    enhancement
    on Oct 12, 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

    cienhancementfrontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions