Skip to content

chore: Replace prettier with oxfmt#5880

Draft
antonis wants to merge 2 commits intoantonis/oxlintfrom
antonis/oxfmt
Draft

chore: Replace prettier with oxfmt#5880
antonis wants to merge 2 commits intoantonis/oxlintfrom
antonis/oxfmt

Conversation

@antonis
Copy link
Contributor

@antonis antonis commented Mar 25, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Replace prettier with oxfmt (the Oxc formatter) across the entire repository. This recovers the import sorting capability lost in the ESLint → oxlint migration (#5867) and continues aligning with the Oxc toolchain.

What changed

  • Added .oxfmtrc.json with the same formatting options as .prettierrc.json + built-in import sorting
  • Replaced prettier with oxfmt in all package.json devDependencies and lint/fix scripts
  • Removed .prettierrc.json and .prettierignore
  • Auto-formatted all SDK files (198 files, mostly import reordering)

Formatting changes

The auto-format diff is almost entirely import reordering — grouping type imports before value imports, separating external from internal, and adding blank lines between groups. A few minor formatting normalizations (arrow function parens consistent with arrowParens: "avoid") are also included.

Performance

Metric prettier oxfmt Speedup
Format check (285 files) ~3s ~70ms ~40x

Import sorting config

"sortImports": {
  "groups": [
    "type-import",
    ["value-builtin", "value-external"],
    ["type-internal", "value-internal"],
    ["type-parent", "type-sibling", "type-index"],
    ["value-parent", "value-sibling", "value-index"],
    "unknown"
  ]
}

Status

oxfmt is in beta (v0.42.0) but has 1.7M weekly npm downloads. It passes 100% of prettier's JS/TS conformance tests. sentry-javascript already migrated (#19200). Also adopted by Vue.js, Turborepo, and Hugging Face.

💡 Motivation and Context

  • Recovers simple-import-sort functionality lost in oxlint migration (chore: Migrate from ESLint to oxlint #5867)
  • sentry-javascript already migrated to oxfmt (#19200)
  • ~40x faster formatting
  • Completes the Oxc toolchain adoption (oxlint for linting, oxfmt for formatting)

Closes #5878

💚 How did you test it?

  • yarn lint passes (all 4 lerna projects + native linters)
  • yarn build passes
  • All 1172 SDK tests pass (103 suites)
  • All 186 tools tests pass (9 suites)
  • oxfmt --check reports zero formatting issues

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

  • Monitor oxfmt for stable release (currently beta)
  • Consider adding oxfmt VS Code extension once available

antonis and others added 2 commits March 25, 2026 08:41
Replace prettier with oxfmt (the Oxc formatter) across the entire
repository. oxfmt has 100% prettier compatibility for JS/TS and adds
built-in import sorting, recovering the simple-import-sort functionality
lost in the ESLint → oxlint migration.

- Add .oxfmtrc.json with same settings as .prettierrc.json + import sorting
- Replace prettier with oxfmt in all package.json devDependencies
- Update lint/fix scripts in packages/core and samples
- Remove .prettierrc.json and .prettierignore
- Update VS Code extensions recommendation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Auto-formatted all SDK source, test, script, and plugin files with
oxfmt. Changes are primarily import reordering (grouping type imports,
separating external from internal) and minor formatting normalization
(arrow function parens consistent with arrowParens: "avoid").

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • chore: Replace prettier with oxfmt by antonis in #5880
  • chore: Migrate from ESLint to oxlint by antonis in #5867
  • chore(deps): bump activesupport from 7.0.8.6 to 7.2.3.1 in /samples/react-native-macos by dependabot in #5870
  • chore(deps): bump activesupport from 6.1.7.10 to 7.2.3.1 in /samples/react-native by dependabot in #5869
  • chore(deps): bump yauzl to ^3.2.1 by antonis in #5855
  • chore(deps): bump appium from 2.4.1 to 3.2.2 by antonis in #5856
  • fix(ios): Guard replay postInit behind runtime session replay check by antonis in #5858
  • Add better needs_web check to CI by alwx in #5863
  • chore(deps): bump fast-xml-parser to ^5.5.7 by antonis in #5854
  • CI: detect-changes workflow to only check the affected components on the CI side by alwx in #5843
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.24.1 to 2.25.0 by dependabot in #5861
  • chore(deps): bump getsentry/craft from 2.24.1 to 2.25.0 by dependabot in #5862
  • chore(deps): bump github/codeql-action from 4.32.6 to 4.34.1 by dependabot in #5860
  • chore(deps): update JavaScript SDK to v10.45.0 by github-actions in #5848
  • chore(deps): bump flatted from 3.4.1 to 3.4.2 by dependabot in #5853
  • chore(deps): update Cocoa SDK to v9.8.0 by github-actions in #5847
  • fix(tracing): Guard getNewScreenTimeToDisplay behind enableTimeToInitialDisplay by antonis in #5849
  • chore(deps): bump json from 2.16.0 to 2.17.1.2 in /performance-tests by dependabot in #5844
  • chore(docs): Add changelog entry for duplicated breadcrumbs fix by antonis in #5851
  • fix(tracing): Unsubscribe spanEnd listeners after they fire to prevent accumulation by antonis in #5840
  • fix(android): Properly remove duplicated breadcrumbs by vovkasm in #5841
  • fix(tracing): Skip native frames and stall tracking for unsampled spans by antonis in #5842

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against b9994b1

@antonis antonis linked an issue Mar 25, 2026 that may be closed by this pull request
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.

chore: Evaluate oxfmt as a prettier replacement

1 participant