feat: enable react/react-compiler lint rule - #132
Conversation
Turn on oxlint's React Compiler diagnostics (Rules of Hooks, ref access during render, setState during render) as an error. The rule is not in the correctness category by default, so it has to be enabled explicitly; it lives under the already-enabled react plugin. The docs app currently reports zero violations.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnables oxlint's React Compiler diagnostics by turning on the Flow diagram for enabling react/react-compiler lint ruleflowchart LR
Developer -->|runs bun run lint| Oxlint
Oxlint -->|uses react plugin| ReactPlugin
ReactPlugin -->|enables rule| ReactReactCompilerRule
ReactReactCompilerRule -->|reports| ReactCompilerDiagnostics
ReactCompilerDiagnostics -->|surface in| CI
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
coda-docs | ef53b12 | Aug 05 2026, 09:35 PM |
What
Enables oxlint's React Compiler diagnostics repo-wide:
The rule lives under the already-enabled
reactplugin, so nopluginschange was needed. It is not part of thecorrectnesscategory, so it has to be turned on explicitly in therulesblock of.oxlintrc.json.Verified against the installed binary (oxlint 1.73.0) rather than assumed —
node_modules/oxlint/configuration_schema.jsondefinesreact/react-compilerwith an optional{ reportAllBailouts?: boolean }config, and oxlint rejects unknown rule names at config-parse time, so the config loading cleanly is itself proof the rule is registered.Violations found
Zero. The only React in this repo is
apps/docs/(Next.js 15 + Fumadocs) — 7.tsxfiles, 418 lines total, all server components. There are nouse clientdirectives and no hook calls at all, so there is nothing for the compiler rules to flag. No source files were changed.To make sure the rule was actually running over
apps/docsand not silently skipped, a temporary component that readsref.currentduring render was dropped intoapps/docs/srcand the repo lint did flag it:The probe file was removed afterwards. Rules of Hooks and setState-during-render violations were confirmed to fire the same way.
Verification
bun run buildbun run lint:fixbun run lintbun run testNotes
reportAllBailoutsis left at its default (false). Bailouts are places the compiler declined to optimize, not rule violations; turning it on would be a separate, noisier decision.apps/docsis not published.Summary by Sourcery
Enable React Compiler lint diagnostics via oxlint and document the tooling-only change.
Enhancements:
react/react-compileroxlint rule to enforce React Compiler diagnostics during linting.Chores: