Skip to content

feat(oxlint-config): add react-compiler config - #217

Merged
dangreen merged 1 commit into
feat/oxlint-vitestfrom
feat/oxlint-react-compiler
Nov 25, 2026
Merged

dangreen merged 1 commit into
feat/oxlint-vitestfrom
feat/oxlint-react-compiler

Conversation

@dangreen

Copy link
Copy Markdown
Member

Stacked on #216.

A new react-compiler config, for code that React Compiler compiles. It comes after react in extends.

  • The compiler's rules: the 13 rules of eslint-plugin-react-hooks 7.1.1's recommended-latest, which oxlint ships in its react plugin, at the severities set there. They report what the compiler cannot compile or would compile wrong: refs, purity, immutability, set-state-in-effect and the rest. incompatible-library and unsupported-syntax warn.
  • Effect dependencies: react/exhaustive-effect-dependencies takes the place of react/exhaustive-deps. It is the compiler's own check and knows what the compiler keeps stable, so a function the compiler memoizes is no false alarm. oxlint also skips the compiler's rules in a function whose exhaustive-deps is disabled, so those disables go with the old rule.
  • trigen/no-manual-memo: reports useMemo, useCallback and memo imported from react, named, aliased, or as React.x on a namespace or default import. Type imports and other sources pass.
    • The autofix unwraps useCallback(fn) to fn, useMemo(() => expr) to expr and memo(C) to C, and moves a hook's type argument onto its variable.
    • It drops an imported name once every use of it is unwrapped.
    • A block-bodied factory and a memo with a comparison are left to a person.

On plant1t-web: no manual memo left. Adopting the config drops 3 exhaustive-deps disables and brings 6 findings to settle by hand: 2 set-state-in-effect that those disables hid, and 4 dependencies the compiler's check calls extra.

🤖 Generated with Claude Code

@dangreen
dangreen added this pull request to stack #222 November 25, 2026 17:13
@dangreen
dangreen merged commit 897430d into main Nov 25, 2026
6 checks passed
@dangreen
dangreen deleted the feat/oxlint-react-compiler branch November 25, 2026 17:22
@github-actions github-actions Bot mentioned this pull request Nov 25, 2026
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.

1 participant