Skip to content

feat: enable react/react-compiler lint rule - #132

Draft
macalinao wants to merge 1 commit into
masterfrom
react-compiler-lint
Draft

feat: enable react/react-compiler lint rule#132
macalinao wants to merge 1 commit into
masterfrom
react-compiler-lint

Conversation

@macalinao

@macalinao macalinao commented Aug 5, 2026

Copy link
Copy Markdown
Owner

What

Enables oxlint's React Compiler diagnostics repo-wide:

"react/react-compiler": "error"

The rule lives under the already-enabled react plugin, so no plugins change was needed. It is not part of the correctness category, so it has to be turned on explicitly in the rules block of .oxlintrc.json.

Verified against the installed binary (oxlint 1.73.0) rather than assumed — node_modules/oxlint/configuration_schema.json defines react/react-compiler with 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 .tsx files, 418 lines total, all server components. There are no use client directives 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/docs and not silently skipped, a temporary component that reads ref.current during render was dropped into apps/docs/src and the repo lint did flag it:

apps/docs/src/__probe.tsx:5:16: error react(react-compiler): Refs: Cannot access refs during render

The probe file was removed afterwards. Rules of Hooks and setState-during-render violations were confirmed to fire the same way.

Verification

Command Result
bun run build pass (21/21 tasks)
bun run lint:fix pass, no files modified
bun run lint pass, clean
bun run test pass (30/30 tasks, 16 tests)

Notes

  • reportAllBailouts is 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.
  • Empty changeset added — this touches lint config only, and apps/docs is not published.

Summary by Sourcery

Enable React Compiler lint diagnostics via oxlint and document the tooling-only change.

Enhancements:

  • Enable the react/react-compiler oxlint rule to enforce React Compiler diagnostics during linting.

Chores:

  • Add a tooling-only changeset documenting the new React Compiler lint rule with no published package output changes.

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.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 13968f57-9a35-451f-8b83-77262085a50e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Enables oxlint's React Compiler diagnostics by turning on the react/react-compiler rule and documents this as a tooling-only change with an empty changeset.

Flow diagram for enabling react/react-compiler lint rule

flowchart LR
  Developer -->|runs bun run lint| Oxlint
  Oxlint -->|uses react plugin| ReactPlugin
  ReactPlugin -->|enables rule| ReactReactCompilerRule
  ReactReactCompilerRule -->|reports| ReactCompilerDiagnostics
  ReactCompilerDiagnostics -->|surface in| CI
Loading

File-Level Changes

Change Details Files
Enable oxlint React Compiler diagnostics rule in lint configuration.
  • Add react/react-compiler rule with level error to the rules section of .oxlintrc.json so React Compiler diagnostics run repo-wide.
  • Rely on already-configured react plugin so no plugin list changes are required.
  • Keep reportAllBailouts at its default to avoid additional non-error noise.
.oxlintrc.json
Document the lint-config-only nature of this change via an empty changeset.
  • Add an empty changeset file explaining that enabling React Compiler diagnostics only affects tooling and does not change any published package output.
.changeset/lucky-pandas-shake.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
coda-docs ef53b12 Aug 05 2026, 09:35 PM

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