Skip to content
Source
Sign inSign up
TanStack/query

chore(*): replace the 'eslint-plugin-react-hooks' JS plugin with Oxlint's native 'react' rules in the react package oxlint configs #12707

Mergedsukvvon(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/12707/headmerged by sukvvon(GitHub profile, opens in a new tab) View on GitHub

sukvvon(GitHub profile, opens in a new tab)commented

🎯 Changes

  • In the oxlint configs of react-query, react-query-devtools, react-query-persist-client, and react-query-next-experimental, remove the eslint-plugin-react-hooks JS plugin (react-hooks-js) and enable the same rules through Oxlint's native react plugin (react/rules-of-hooks, react/exhaustive-deps, and the React Compiler rules).
  • Update the @eslint-react/* "off" comment to point to the native react plugin.
  • Rename the two oxlint-disable-next-line directives in react-query from react-hooks-js/* to react/*.
  • Remove the now unused eslint-plugin-react-hooks from the four packages' devDependencies and the pnpm catalog.

Differences from eslint-plugin-react-hooks 7.1.1

  • config and gating have no native equivalent and are dropped; neither reported anything in these packages.
  • Reassigning a destructured prop or parameter captured by a closure is reported by ESLint's immutability but not by the native rule (https://github.com/oxc-project/oxc/issues/25910, closed as not planned).
  • The native React Compiler rules skip files whose only components are wrapped in memo() or forwardRef() (https://github.com/oxc-project/oxc/issues/29892).
  • exhaustive-deps reports at slightly different columns.

None of these change the results here: the four packages' src have no parameter reassignments and no memo()/forwardRef() usage, and the test:oxlint output is unchanged.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Chores
    • Updated React code-quality checks across packages to use Oxlint’s native React rules, covering hooks, dependencies, refs, state updates, purity, and memoization.
    • Removed the previous React Hooks lint dependency and updated related lint suppressions.
    • These changes affect development checks only; application behavior is unchanged.

Sign in to join this conversation.