fix: disable prettier experimental-cli cache to prevent CI/local mismatch#83222
fix: disable prettier experimental-cli cache to prevent CI/local mismatch#83222
Conversation
|
npm has a |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc30a9a9ae
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…atch The experimental CLI's built-in cache causes prettier to skip files that need reformatting, leading to CI failures that cannot be reproduced locally. Adding --no-cache to the npm script ensures every file is checked fresh on every run. Co-authored-by: Cursor <cursoragent@cursor.com>
bc30a9a to
52f80ee
Compare
roryabraham
left a comment
There was a problem hiding this comment.
Here's my preferred solution: #83231
Explanation of Change
The
prettier --experimental-cliflag enables a built-in cache by default (unlike the standard CLI which requires--cacheexplicitly). This causes a class of CI failures where:node_modules/.cache/prettier/npm run prettierruns, cached files are skipped even if they need reformattingChange:
package.json: Add--no-cacheto theprettiernpm script so every file is checked fresh on every runThis ensures the same command runs both locally and in CI, eliminating the mismatch. The
--experimental-cliflag is kept for its performance benefits.This was the root cause of multiple recent CI failures (e.g. on PRs #83196, #83205) where the Prettier check failed on files that weren't even part of the PR, and developers could not reproduce the failure locally.
Fixed Issues
Prettier keeps failing on main while the script gives no diff https://github.com/Expensify/App/actions/runs/22314815726
Tests
npm run prettierlocally--no-cacheflag visible in the outputgit diffand verify no unexpected formatting changesOffline tests
N/A - CI-only change
QA Steps
[No QA] - CI infrastructure change only
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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