[No QA] Make prettier ~5.24x faster#82351
Conversation
- Add @prettier/plugin-oxc to .prettierrc.js (before sort-imports plugin) - Remove redundant --plugin @prettier/plugin-oxc CLI flags from package.json scripts - Remove redundant --plugin @prettier/plugin-oxc from .claude/settings.json - Plugin order is critical: OXC must be first to avoid formatting diff - Maintains 5x speed improvement with cleaner configuration Co-authored-by: Cursor <cursoragent@cursor.com>
OXC doesn't insert blank lines after import statements, so test expectations need to match the new output format. Co-authored-by: Cursor <cursoragent@cursor.com>
| expect(itContent).toStrictEqual( | ||
| `${GENERATED_FILE_PREFIX}${dedent(` | ||
| import type en from './en'; | ||
|
|
There was a problem hiding this comment.
The translations script is the only place we use prettier programmatically, so I assume that's why there's a diff here but nowhere else. I don't think it should be a big deal so I'm just making the changes to the tests rather than trying to figure out why it was acting differently with the Node.js API
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
chuckdries
left a comment
There was a problem hiding this comment.
Wow, npm run prettier only takes 6s on my machine. Sick!
|
🚧 @roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.19-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.19-5 🚀
|
Explanation of Change
Drop-in replacement to make Prettier ~5.24x faster. The dependency added is a dev dependency and only separated from prettier itself to due to package size limitations:
Update: ~2.5s on subsequent runs. So ~15x faster actually...
Fixed Issues
$ n/a - just noticed from the prettier blog: https://prettier.io/blog/2025/06/23/3.6.0
Tests
None.
Offline tests
n/a
QA Steps
None.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop