Skip to content

Migrate from prettier to oxfmt#5986

Open
mstange wants to merge 1 commit intofirefox-devtools:mainfrom
mstange:oxfmt
Open

Migrate from prettier to oxfmt#5986
mstange wants to merge 1 commit intofirefox-devtools:mainfrom
mstange:oxfmt

Conversation

@mstange
Copy link
Copy Markdown
Contributor

@mstange mstange commented Apr 29, 2026

Numbers from my machine:
yarn prettier-fix before: 6.5 seconds
yarn fmt after: 1.3 seconds

yarn lint-fix is still slow (9 seconds), I think that's bottlenecked on eslint.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.34%. Comparing base (b868d0e) to head (4561eeb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5986   +/-   ##
=======================================
  Coverage   85.34%   85.34%           
=======================================
  Files         318      318           
  Lines       31922    31922           
  Branches     8834     8834           
=======================================
  Hits        27244    27244           
  Misses       4246     4246           
  Partials      432      432           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Numbers from my machine:
`yarn prettier-fix` before: 6.5 seconds
`yarn fmt` after: 1.3 seconds

`yarn lint-fix` is still slow (9 seconds), I think that's bottlenecked on eslint.
@mstange mstange marked this pull request as ready for review April 29, 2026 21:29
@mstange mstange requested review from canova and fatadel as code owners April 29, 2026 21:29
@cathaysia
Copy link
Copy Markdown

Hi there—have you tried biome.js? I've been using it in my projects, and I think it's actually pretty good.
https://biomejs.dev/

Copy link
Copy Markdown
Contributor

@fatadel fatadel left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this! I've added just one nit (comment update), otherwise lgtm 👍🏻

// profile. Copy one of the existing ones, make it a valid profile of the
// version that you need, modify it to your liking, and add a subtest to
// this test that loads and tests it.
// Also run `yarn prettier-json` to format the new input file.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Apparently, this line needs changing too.

Comment thread .oxfmtrc.json
"endOfLine": "lf",
"printWidth": 80,
"sortPackageJson": false,
"ignorePatterns": [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Btw, we added profiler-cli/dist to the prettierignore while adding the profiler cli. We should add it here too.

Comment thread eslint.config.mjs
// Prettier config must be placed here to disable formatting rules from the
// base configs above, while allowing our custom rules below to take
// precedence.
prettierConfig,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

eslint-config-prettier essentially disables a bunch of formatting rules that might clash with the prettier formatting. I wonder if we need something for oxfmt too, but I think it's fine if it didn't clash already after the migration.

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.

4 participants