feat(oxlint-config): convention rules, react-compiler default, plugin activation fix#12
Conversation
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).
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Two commits:
fix: enable plugins required by already-configured rules.
libraryRulesconfiguresimport/no-cycleand thepromise/*family, butlibrary()never set an oxlintpluginsarray and oxlint disables theimport/promiseplugins by default — both rule families were silently inert for consumers (verified against a real import cycle and an unreturned.then()). AddslibraryPluginsand merges caller-supplied plugins into the base set, since oxlint'spluginsconfig 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, andreact/react-compiler(requires oxlint >= 1.70; nursery — diagnostics may shift between oxlint minors). Enabling thereactplugin auto-activates its 18 other correctness rules at warn, which--deny-warningsconsumers 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-configdiffs confirming no unintended react/* rules leak.