Skip to content

feat(create): add OXC toolchain (oxlint + oxfmt)#439

Open
zek01svg wants to merge 1 commit intoTanStack:mainfrom
zek01svg:feat/oxc-toolchain
Open

feat(create): add OXC toolchain (oxlint + oxfmt)#439
zek01svg wants to merge 1 commit intoTanStack:mainfrom
zek01svg:feat/oxc-toolchain

Conversation

@zek01svg
Copy link
Copy Markdown

@zek01svg zek01svg commented Apr 27, 2026

Summary

  • Adds OXC as a third toolchain option alongside ESLint and Biome for both React and Solid frameworks
  • OXC is a Rust-powered toolchain from the oxc-project: oxlint (linter) + oxfmt (formatter)
  • oxlint is 10–100× faster than ESLint; oxfmt is 30× faster than Prettier and passes 100% of Prettier's JS/TS conformance tests

Changes

New files only — no existing code modified. Auto-discovered by scanAddOnDirectories (no TypeScript registration needed).

React packages/create/src/frameworks/react/toolchains/oxc/
Solid packages/create/src/frameworks/solid/toolchains/oxc/

Each contains:

  • info.json — type toolchain, exclusive: ["linter"], priority 3 (after ESLint=0, Biome=2)
  • package.jsonoxlint ^1.0.0, oxfmt ^0.46.0, with lint/format/check scripts
  • assets/.oxlintrc.json — minimal correctness rules; React variant adds react plugin
  • assets/.oxfmtrc.json — Prettier-compatible formatting config
  • small-logo.svg — OXC brand orange (#FF5A1F)

Test plan

pnpm install && pnpm build

# From a peer directory
node ../cli/packages/cli/dist/index.js create test-oxc --toolchain oxc

# In generated app, verify:
# - .oxlintrc.json and .oxfmtrc.json exist
# - package.json has oxlint + oxfmt devDeps and lint/format/check scripts
# - npm run lint / format / check all work

Notes

  • oxfmt is currently beta (v0.x) but passes 100% of Prettier's JS/TS tests as of the Feb 2026 beta release — flagging for maintainer awareness
  • The 2 pre-existing Windows path test failures (file-helper.test.ts, create-app.test.ts) exist on main and are unrelated to this PR; CI (Linux) passes cleanly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added OXC toolchain support for React and Solid projects with integrated linting (oxlint) and code formatting (oxfmt)
    • Includes lint, format, and check commands to enforce code quality and consistency standards

Adds OXC as a third toolchain option alongside ESLint and Biome for
both React and Solid frameworks. OXC is a Rust-powered toolchain from
the oxc-project that is 10-100x faster than ESLint and 30x faster than
Prettier.

- oxlint: fast linter (stable v1.x)
- oxfmt: Prettier-compatible formatter (beta v0.x, 100% JS/TS conformance)

Each framework gets:
- info.json with exclusive linter slot, priority 3 (after ESLint=0, Biome=2)
- package.json with lint/format/check scripts
- .oxlintrc.json config (React variant includes react plugin)
- .oxfmtrc.json config
- small-logo.svg
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

📝 Walkthrough

Walkthrough

Introduces OXC toolchain (oxlint + oxfmt) support for both React and Solid frameworks, including configuration files, toolchain metadata, and npm scripts for linting and formatting workflows.

Changes

Cohort / File(s) Summary
Changeset Declaration
.changeset/add-oxc-toolchain.md
Documents patch version update for @tanstack/create with OXC toolchain addition.
React OXC Toolchain
packages/create/src/frameworks/react/toolchains/oxc/assets/_dot_oxfmtrc.json, packages/create/src/frameworks/react/toolchains/oxc/assets/_dot_oxlintrc.json, packages/create/src/frameworks/react/toolchains/oxc/info.json, packages/create/src/frameworks/react/toolchains/oxc/package.json
Configures OXC toolchain for React with oxfmt/oxlint settings (single quotes, no semicolons, trailing commas), toolchain metadata, and npm scripts for lint, format, and check operations.
Solid OXC Toolchain
packages/create/src/frameworks/solid/toolchains/oxc/assets/_dot_oxfmtrc.json, packages/create/src/frameworks/solid/toolchains/oxc/assets/_dot_oxlintrc.json, packages/create/src/frameworks/solid/toolchains/oxc/info.json, packages/create/src/frameworks/solid/toolchains/oxc/package.json
Configures OXC toolchain for Solid with oxfmt/oxlint settings (single quotes, no semicolons, trailing commas), toolchain metadata, and npm scripts for lint, format, and check operations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~8 minutes

Poem

🐰 Hop, hop, a toolchain grows,
OXC linting flows and flows,
With oxfmt neat and oxlint keen,
React and Solid, squeaky clean! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding OXC (oxlint + oxfmt) as a new toolchain option for the create package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/create/src/frameworks/solid/toolchains/oxc/package.json (1)

2-6: Same script semantics concern as React OXC template.

format currently checks, while check writes/fixes. If not intentionally matching repo convention, consider flipping for clearer behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/create/src/frameworks/solid/toolchains/oxc/package.json` around
lines 2 - 6, The package.json scripts for the Solid OXC template have inverted
semantics: "format" currently runs a check ("oxfmt --check .") and "check" runs
write/fix ("oxfmt --write . && oxlint --fix ."); change them so "format"
performs the write/fix (use "oxfmt --write ." and also run any fixer like
"oxlint --fix .") and "check" performs readonly verification (use "oxfmt --check
." and "oxlint ." or similar), updating the "format" and "check" entries in
package.json scripts accordingly so their behavior matches the repo convention.
packages/create/src/frameworks/react/toolchains/oxc/package.json (1)

2-6: Align format/check scripts with Biome toolchain conventions.

The Oxc scripts use non-standard semantics where format only validates (oxfmt --check .) while check mutates files (oxfmt --write . && oxlint --fix .). This matches the ESLint toolchain but inverts the Biome convention. For consistency within the project, format should mutate and check should validate—matching how Biome works.

Proposed adjustment
   "scripts": {
     "lint": "oxlint .",
-    "format": "oxfmt --check .",
-    "check": "oxfmt --write . && oxlint --fix ."
+    "format": "oxfmt --write .",
+    "check": "oxfmt --check . && oxlint ."
   },

Note: The ESLint toolchain has the same pattern; if you adopt this change, consider applying it there as well for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/create/src/frameworks/react/toolchains/oxc/package.json` around
lines 2 - 6, The package.json scripts invert Biome conventions: change the
"format" script to perform mutating formatting/fixes and the "check" script to
only validate; specifically update the "format" script to run the mutating
commands (use oxfmt --write . && oxlint --fix .) and update the "check" script
to run the non-mutating validators (use oxfmt --check . && oxlint .) so the
"format" and "check" npm scripts in package.json follow the Biome-style
semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/create/src/frameworks/react/toolchains/oxc/package.json`:
- Around line 2-6: The package.json scripts invert Biome conventions: change the
"format" script to perform mutating formatting/fixes and the "check" script to
only validate; specifically update the "format" script to run the mutating
commands (use oxfmt --write . && oxlint --fix .) and update the "check" script
to run the non-mutating validators (use oxfmt --check . && oxlint .) so the
"format" and "check" npm scripts in package.json follow the Biome-style
semantics.

In `@packages/create/src/frameworks/solid/toolchains/oxc/package.json`:
- Around line 2-6: The package.json scripts for the Solid OXC template have
inverted semantics: "format" currently runs a check ("oxfmt --check .") and
"check" runs write/fix ("oxfmt --write . && oxlint --fix ."); change them so
"format" performs the write/fix (use "oxfmt --write ." and also run any fixer
like "oxlint --fix .") and "check" performs readonly verification (use "oxfmt
--check ." and "oxlint ." or similar), updating the "format" and "check" entries
in package.json scripts accordingly so their behavior matches the repo
convention.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dddc2bda-cc50-4720-9c1b-86861112aeeb

📥 Commits

Reviewing files that changed from the base of the PR and between b127073 and 7ba7795.

⛔ Files ignored due to path filters (2)
  • packages/create/src/frameworks/react/toolchains/oxc/small-logo.svg is excluded by !**/*.svg
  • packages/create/src/frameworks/solid/toolchains/oxc/small-logo.svg is excluded by !**/*.svg
📒 Files selected for processing (9)
  • .changeset/add-oxc-toolchain.md
  • packages/create/src/frameworks/react/toolchains/oxc/assets/_dot_oxfmtrc.json
  • packages/create/src/frameworks/react/toolchains/oxc/assets/_dot_oxlintrc.json
  • packages/create/src/frameworks/react/toolchains/oxc/info.json
  • packages/create/src/frameworks/react/toolchains/oxc/package.json
  • packages/create/src/frameworks/solid/toolchains/oxc/assets/_dot_oxfmtrc.json
  • packages/create/src/frameworks/solid/toolchains/oxc/assets/_dot_oxlintrc.json
  • packages/create/src/frameworks/solid/toolchains/oxc/info.json
  • packages/create/src/frameworks/solid/toolchains/oxc/package.json

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