Skip to content

feat(oxlint-config): convention rules, react-compiler default, plugin activation fix#12

Merged
jan-kubica merged 2 commits into
mainfrom
feat/convention-rules
Jul 4, 2026
Merged

feat(oxlint-config): convention rules, react-compiler default, plugin activation fix#12
jan-kubica merged 2 commits into
mainfrom
feat/convention-rules

Conversation

@jan-kubica

Copy link
Copy Markdown
Contributor

Two commits:

fix: enable plugins required by already-configured rules. libraryRules configures import/no-cycle and the promise/* family, but library() never set an oxlint plugins array and oxlint disables the import/promise plugins by default — both rule families were silently inert for consumers (verified against a real import cycle and an unreturned .then()). Adds libraryPlugins and merges caller-supplied plugins into the base set, since oxlint's plugins config replaces rather than appends.

feat: convention rules + react-compiler. Adds to the shared defaults at error: prefer-arrow-callback (core rules are unprefixed in oxlint), oxc/no-accumulating-spread, oxc/no-map-spread, oxc/branches-sharing-code, unicorn/no-array-fill-with-reference-type, import/newline-after-import, and react/react-compiler (requires oxlint >= 1.70; nursery — diagnostics may shift between oxlint minors). Enabling the react plugin auto-activates its 18 other correctness rules at warn, which --deny-warnings consumers would experience as surprise failures — those are explicitly set off so the change is scoped to react-compiler. No bulk-suppression mechanism exists in oxlint yet (tracking: oxc-project/oxc#10549); the README documents scoped-override burn-down as the adoption path for consumers with existing findings. Version 0.4.0; oxlint floor >= 1.70.0.

Verified: build, typecheck, tests, lint (--deny-warnings --type-aware), publint, pack dry-run, plus behavioral probes of every added rule against the oxlint binary and --print-config diffs confirming no unintended react/* rules leak.

libraryRules configures import/no-cycle and every promise/* rule, but
oxlint disables the import and promise plugins unless explicitly listed
in a plugins array. Since library() never set plugins, both rule groups
were silently inert. Add a libraryPlugins export covering oxlint's
existing default plugins plus import and promise, and wire it into
library()'s output.
Add six rules to the shared default set, each covering a convention that
was previously enforced (if at all) only by ad hoc local config in
consumers:
- oxc/no-accumulating-spread, oxc/no-map-spread: flag O(n^2) accumulation
  and per-iteration reallocation from spreading in loops/`.map()`.
- oxc/branches-sharing-code: flags if/else branches with duplicated bodies.
- prefer-arrow-callback: callbacks should stay lexically scoped.
- unicorn/no-array-fill-with-reference-type: catches `.fill(obj)` sharing
  one reference across every array slot.
- import/newline-after-import: keep a blank line after the import block.

Also enable `react/react-compiler` (oxlint >= 1.70) as an error in the
default set, since consumers already run `--deny-warnings`. Enabling the
`react` plugin turns on its whole correctness rule category by default,
not just react-compiler, so every other `react/*` rule is explicitly
turned back off to keep this change scoped to the one rule being added.

oxlint has no bulk-suppression/baseline mechanism as of 1.72.0
(oxc-project/oxc#10549 is open, unimplemented); consumers adopting
react-compiler against an existing findings backlog should scope
temporary `overrides` per legacy path and fix forward.

Dropped unicorn/prefer-number-coercion from consideration: its
`parseInt(x, 10)` -> `Number(x)` rewrite is not semantics-preserving
(lenient prefix parsing, empty-string and hex handling all differ), and
codebases parsing external input rely on parseInt's semantics.

Bumps the oxlint devDependency/peerDependency floor to >=1.70.0 for the
rules that require it, and the package to 0.4.0 (minor: new rules, no
breaking config shape change).
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jan-kubica, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f9be4557-f4d9-4fc2-8e5c-1353ab4a7b92

📥 Commits

Reviewing files that changed from the base of the PR and between 674e30c and ba08bd9.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • README.md
  • package.json
  • packages/oxlint-config/fixtures/no-raw-colors.fixture.tsx
  • packages/oxlint-config/package.json
  • packages/oxlint-config/src/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/convention-rules

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.

@jan-kubica jan-kubica merged commit 31edd30 into main Jul 4, 2026
5 checks passed
@jan-kubica jan-kubica deleted the feat/convention-rules branch July 4, 2026 08:27
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant