Skip to content

chore: migrate root formatter setup to oxfmt#6786

Open
Sheraff wants to merge 4 commits intomainfrom
opencode/neon-nebula
Open

chore: migrate root formatter setup to oxfmt#6786
Sheraff wants to merge 4 commits intomainfrom
opencode/neon-nebula

Conversation

@Sheraff
Copy link
Contributor

@Sheraff Sheraff commented Feb 28, 2026

Summary

  • switch the root formatting workflow from Prettier to Oxfmt (pnpm format now runs oxfmt) and add .oxfmtrc.json with equivalent style settings
  • migrate scripts/generate-labeler-config.ts to format YAML with Oxfmt and read options from the root .oxfmtrc.json to avoid duplicated formatter settings
  • remove the old root prettier.config.js and update lockfile/dependencies to use the latest oxfmt release while leaving @tanstack/router-generator on Prettier

Validation

  • pnpm run labeler-generate
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-generator:test:eslint --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-generator:test:types --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-generator:test:unit --outputStyle=stream --skipRemoteCache

Summary by CodeRabbit

  • Chores
    • Replaced Prettier with oxfmt as the code formatter for the project.
    • Added oxfmt configuration file (.oxfmtrc.json) specifying formatting preferences including print width, quote style, and trailing commas.
    • Updated formatting scripts to use oxfmt instead of Prettier.
    • Reformatted code files across examples and packages according to oxfmt standards.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

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
📝 Walkthrough

Walkthrough

Formatter migration from Prettier to oxfmt with corresponding configuration file updates and widespread formatting adjustments across example files and source code comments throughout the repository.

Changes

Cohort / File(s) Summary
Formatter Configuration Migration
.oxfmtrc.json, prettier.config.js, package.json
Added new oxfmt configuration file with formatting rules (print width 80, no semicolons, single quotes, trailing commas); removed Prettier config; updated format script and devDependencies to use oxfmt instead of Prettier.
Script Formatter Updates
scripts/generate-labeler-config.ts
Replaced Prettier formatting pipeline with oxfmt, including reading oxfmt config, updating error messages, and removing Prettier-specific resolution logic while preserving YAML generation.
React Example activeOptions Reformatting
examples/react/kitchen-sink/src/main.tsx, examples/react/kitchen-sink-react-query/src/main.tsx, examples/react/kitchen-sink-react-query-file-based/src/routes/__root.tsx, examples/react/kitchen-sink-file-based/src/routes/__root.tsx, examples/react/with-trpc/src/routes/__root.tsx, examples/react/with-trpc-react-query/src/routes/__root.tsx
Reformatted activeOptions prop on Link components from multi-line object literals to compact single-line format without altering logic or comments.
Solid Example activeOptions Reformatting
examples/solid/kitchen-sink/src/main.tsx, examples/solid/kitchen-sink-solid-query/src/main.tsx, examples/solid/kitchen-sink-solid-query-file-based/src/routes/__root.tsx, examples/solid/kitchen-sink-file-based/src/routes/__root.tsx, examples/solid/with-trpc/src/routes/__root.tsx
Reformatted activeOptions prop on Link components from multi-line object literals to single-line format without behavioral changes.
Comment Whitespace Cleanup
e2e/react-router/view-transitions/src/main.tsx, e2e/solid-router/view-transitions/src/main.tsx, examples/react/view-transitions/src/main.tsx, examples/solid/view-transitions/src/main.tsx, packages/react-router/tests/route.test.tsx, packages/solid-router/tests/route.test.tsx, packages/vue-router/tests/route.test.tsx
Removed trailing spaces from block comment openings and comment lines throughout test and example files.
JSDoc Formatting Adjustments
packages/react-router/src/fileRoute.ts, packages/solid-router/src/fileRoute.ts, packages/router-core/src/route.ts
Minor JSDoc comment reformatting in deprecation notices and comment block openings without affecting type signatures or behavior.
Router Core Type Changes
packages/router-core/src/new-process-route-tree.ts
Added explicit parentheses wrapping around union branches after intersection in RouteLike type definition, altering TypeScript type grouping semantics.
Router Core Test Refactoring
packages/router-core/tests/utils.test.ts
Inlined multi-line test block callbacks in it.fails wrappers for two test cases without changing assertions or functionality.
Devtools Styling Optimization
packages/router-devtools-core/src/useStyles.tsx
Refactored multi-line CSS conditional blocks for mainCloseBtnPosition to inline ternary expressions without changing runtime behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • schiller-manuel
  • nlynzaad

Poem

🐰 Whiskers twitch with formatter glee,
Oxfmt now the tool to be!
Spaces trimmed and lines condensed so neat,
Prettier's gone—the swap complete!
Hop along, the code's well-dressed and sweet!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: migrate root formatter setup to oxfmt' directly and clearly summarizes the main change: switching the project's root formatter from Prettier to Oxfmt, which is reflected across all modifications including package.json, .oxfmtrc.json additions, prettier.config.js removal, and script updates.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch opencode/neon-nebula

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

@nx-cloud
Copy link

nx-cloud bot commented Feb 28, 2026

View your CI Pipeline Execution ↗ for commit 6facc4e

Command Status Duration Result
nx run tanstack-router-e2e-bundle-size:build --... ✅ Succeeded 1m 29s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-28 08:49:39 UTC

@github-actions
Copy link

github-actions bot commented Feb 28, 2026

Bundle Size Benchmarks

  • Commit: de66f0e0a0d6
  • Measured at: 2026-02-28T08:48:38.654Z
  • Baseline source: history:442ada1f6432
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 86.58 KiB 0 B (0.00%) 272.45 KiB 75.22 KiB ▁▂▂▂▂▂▂▂▇▇█
react-router.full 89.61 KiB 0 B (0.00%) 282.78 KiB 77.90 KiB ▂▁▁▁▂▂▂▂▇▇█
solid-router.minimal 35.88 KiB 0 B (0.00%) 107.56 KiB 32.26 KiB ▁▂▂▂▅▅▅▅▇▇█
solid-router.full 40.21 KiB 0 B (0.00%) 120.61 KiB 36.13 KiB ▁▃▃▃▅▅▅▅▇▇█
vue-router.minimal 51.75 KiB 0 B (0.00%) 147.54 KiB 46.50 KiB ▁▂▂▂▅▅▅▅▇▇█
vue-router.full 56.55 KiB 0 B (0.00%) 163.12 KiB 50.86 KiB ▁▂▂▂▅▅▅▅▇▇█
react-start.minimal 99.11 KiB 0 B (0.00%) 311.58 KiB 85.68 KiB ▁▂▂▂▂▂▂▂▆▆█
react-start.full 102.49 KiB 0 B (0.00%) 321.36 KiB 88.62 KiB ▁▂▂▂▂▂▂▂▆▆█
solid-start.minimal 48.19 KiB 0 B (0.00%) 145.13 KiB 42.67 KiB ▁▃▃▃▅▅▅▅▇▇█
solid-start.full 53.67 KiB 0 B (0.00%) 161.05 KiB 47.33 KiB ▁▂▂▂▅▅▅▅▇▇█

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 28, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@6786

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@6786

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@6786

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@6786

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@6786

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@6786

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@6786

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@6786

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@6786

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@6786

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@6786

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@6786

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@6786

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@6786

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@6786

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@6786

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@6786

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@6786

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@6786

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@6786

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@6786

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@6786

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@6786

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@6786

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@6786

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@6786

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@6786

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@6786

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@6786

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@6786

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@6786

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@6786

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@6786

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@6786

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@6786

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@6786

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@6786

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@6786

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@6786

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@6786

commit: f11c6b9

Copy link
Contributor

@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 (1)
scripts/generate-labeler-config.ts (1)

16-22: Improve invalid-config diagnostics for .oxfmtrc.json.

JSON.parse failures currently bubble up without file-specific context. Wrapping parse errors here will make CI/debug output clearer.

Proposed patch
-  const rawConfig = fs.readFileSync(oxfmtConfigPath, 'utf-8')
-  const parsedConfig = JSON.parse(rawConfig) as {
-    $schema?: string
-  } & FormatOptions
+  const rawConfig = fs.readFileSync(oxfmtConfigPath, 'utf-8')
+  let parsedConfig: { $schema?: string } & FormatOptions
+  try {
+    parsedConfig = JSON.parse(rawConfig) as { $schema?: string } & FormatOptions
+  } catch (error) {
+    const message = error instanceof Error ? error.message : String(error)
+    throw new Error(
+      `Invalid JSON in \`${oxfmtConfigPath}\`: ${message}`,
+    )
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate-labeler-config.ts` around lines 16 - 22, The JSON.parse call
in generate-labeler-config.ts can throw without file context; wrap the parse in
a try/catch around the JSON.parse(rawConfig) (the parsedConfig assignment) and
on error throw a new, descriptive Error that includes the oxfmtConfigPath and
the original error message (e.g., `Failed to parse ${oxfmtConfigPath}:
${err.message}`) so callers of the function get file-specific diagnostics while
preserving the rest of the logic that destructures $schema and returns
formatOptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@scripts/generate-labeler-config.ts`:
- Around line 16-22: The JSON.parse call in generate-labeler-config.ts can throw
without file context; wrap the parse in a try/catch around the
JSON.parse(rawConfig) (the parsedConfig assignment) and on error throw a new,
descriptive Error that includes the oxfmtConfigPath and the original error
message (e.g., `Failed to parse ${oxfmtConfigPath}: ${err.message}`) so callers
of the function get file-specific diagnostics while preserving the rest of the
logic that destructures $schema and returns formatOptions.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de66f0e and 30c69e7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • .oxfmtrc.json
  • e2e/react-router/view-transitions/src/main.tsx
  • e2e/react-start/basic-auth/prisma/migrations/migration_lock.toml
  • e2e/react-start/basic-cloudflare/worker-configuration.d.ts
  • e2e/solid-router/view-transitions/src/main.tsx
  • e2e/solid-start/basic-auth/prisma/migrations/migration_lock.toml
  • e2e/solid-start/basic-cloudflare/worker-configuration.d.ts
  • e2e/vue-start/basic-auth/prisma/migrations/migration_lock.toml
  • e2e/vue-start/basic-cloudflare/worker-configuration.d.ts
  • examples/react/kitchen-sink-file-based/src/routes/__root.tsx
  • examples/react/kitchen-sink-react-query-file-based/src/routes/__root.tsx
  • examples/react/kitchen-sink-react-query/src/main.tsx
  • examples/react/kitchen-sink/src/main.tsx
  • examples/react/start-basic-auth/prisma/migrations/migration_lock.toml
  • examples/react/start-basic-cloudflare/worker-configuration.d.ts
  • examples/react/start-workos/prettier.config.js
  • examples/react/start-workos/src/components/footer.tsx
  • examples/react/start-workos/src/components/sign-in-button.tsx
  • examples/react/start-workos/src/router.tsx
  • examples/react/start-workos/src/routes/__root.tsx
  • examples/react/start-workos/src/routes/_authenticated.tsx
  • examples/react/start-workos/src/routes/_authenticated/account.tsx
  • examples/react/start-workos/src/routes/api/auth/callback.tsx
  • examples/react/start-workos/src/routes/client.tsx
  • examples/react/start-workos/src/routes/index.tsx
  • examples/react/start-workos/src/routes/logout.tsx
  • examples/react/start-workos/src/start.ts
  • examples/react/start-workos/src/vite-env.d.ts
  • examples/react/start-workos/vite.config.ts
  • examples/react/view-transitions/src/main.tsx
  • examples/react/with-trpc-react-query/src/routes/__root.tsx
  • examples/react/with-trpc/src/routes/__root.tsx
  • examples/solid/kitchen-sink-file-based/src/routes/__root.tsx
  • examples/solid/kitchen-sink-solid-query-file-based/src/routes/__root.tsx
  • examples/solid/kitchen-sink-solid-query/src/main.tsx
  • examples/solid/kitchen-sink/src/main.tsx
  • examples/solid/start-basic-auth/prisma/migrations/migration_lock.toml
  • examples/solid/start-basic-cloudflare/worker-configuration.d.ts
  • examples/solid/start-basic-netlify/netlify.toml
  • examples/solid/view-transitions/src/main.tsx
  • examples/solid/with-trpc/src/routes/__root.tsx
  • package.json
  • packages/react-router/src/fileRoute.ts
  • packages/react-router/tests/route.test.tsx
  • packages/router-core/src/new-process-route-tree.ts
  • packages/router-core/src/route.ts
  • packages/router-core/tests/utils.test.ts
  • packages/router-devtools-core/src/useStyles.tsx
  • packages/solid-router/src/fileRoute.ts
  • packages/solid-router/tests/route.test.tsx
  • packages/vue-router/tests/route.test.tsx
  • prettier.config.js
  • scripts/generate-labeler-config.ts
💤 Files with no reviewable changes (1)
  • prettier.config.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant