Skip to content

fix: disable react-hooks-js/incompatible-library rule#951

Draft
skoshx wants to merge 2 commits into
mainfrom
cursor/triage-950-1e05
Draft

fix: disable react-hooks-js/incompatible-library rule#951
skoshx wants to merge 2 commits into
mainfrom
cursor/triage-950-1e05

Conversation

@skoshx

@skoshx skoshx commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Root Cause

The react-hooks-js/incompatible-library rule from React Compiler is overly aggressive and flags well-designed, battle-tested libraries like @tanstack/react-virtual, @tanstack/react-table, and similar TanStack libraries.

These libraries are specifically designed to work with React and don't present the compatibility issues the rule is trying to catch. The current remediation guidance can push users away from mature virtualization/data libraries toward fragile, handwritten implementations.

Changes

  • Removed react-hooks-js/incompatible-library from EXTERNAL_RULES in packages/oxlint-plugin-react-doctor/src/rules.ts
  • Added regression test in packages/react-doctor/tests/regressions/scan-resilience.test.ts to ensure the rule stays disabled
  • Added changeset documenting this fix

Scope Decision

This change completely disables the react-hooks-js/incompatible-library rule rather than allowlisting specific libraries because:

  1. The rule's heuristics for detecting "incompatible" libraries are too broad
  2. Well-designed React libraries (TanStack ecosystem, React Virtuoso, etc.) shouldn't trigger compiler compatibility warnings
  3. Library authors who designed their hooks to work with React shouldn't be flagged as incompatible

Testing

  • ✅ Regression test added and passing
  • ✅ All existing tests pass (1963 tests)
  • ✅ Lint passed
  • ✅ Typecheck passed
  • ✅ Format check passed

Expected Parity Results

Since this change only removes a rule (doesn't modify detection logic), the parity diff should show:

  • REMOVED diagnostics: All react-hooks-js/incompatible-library diagnostics that previously fired across the corpus
  • ADDED diagnostics: None
  • Other changes: None

This is the intended behavior - we're silencing an overly aggressive rule that was generating false positives on well-designed React libraries.

Closes #950

Open in Web Open in Cursor 

cursoragent and others added 2 commits June 24, 2026 02:35
The react-hooks-js/incompatible-library rule from React Compiler is overly
aggressive and flags well-designed, battle-tested libraries like
@tanstack/react-virtual, @tanstack/react-table, and similar TanStack libraries.

These libraries are specifically designed to work with React and don't present
the compatibility issues the rule is trying to catch. The current remediation
guidance can push users away from mature virtualization/data libraries toward
fragile, handwritten implementations.

This change removes react-hooks-js/incompatible-library from EXTERNAL_RULES,
preventing it from being enabled in the oxlint config.

Closes #950

Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@951
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@951
npm i https://pkg.pr.new/react-doctor@951

commit: 064a455

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-hooks-js/incompatible-library flags @tanstack/react-virtual useVirtualizer

2 participants