feat(migrate): Prettier → Oxfmt migration via vp fmt --migrate=prettier#742
Merged
feat(migrate): Prettier → Oxfmt migration via vp fmt --migrate=prettier#742
Conversation
✅ Deploy Preview for viteplus-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ba4a067 to
9297fc5
Compare
5a4c483 to
6237268
Compare
98e8aa0 to
fc66d6d
Compare
4b5b347 to
56dfed9
Compare
5e41e14 to
71501d6
Compare
76ebad7 to
a3b339c
Compare
a3b339c to
d474603
Compare
69220fb to
189d2b3
Compare
d474603 to
71674aa
Compare
53095a1 to
62bbc40
Compare
fengmk2
commented
Mar 9, 2026
c05b183 to
0faa764
Compare
cpojer
approved these changes
Mar 10, 2026
Member
Author
Merge activity
|
f52f37b to
9446c03
Compare
Add Prettier → Oxfmt migration support to `vp migrate`, following the same architecture as the existing ESLint → Oxlint migration: Rust shell script rewriter → NAPI binding → TypeScript orchestration. - Rust rewriter rewrites `prettier` → `vp fmt`, strips Prettier-only flags (--write, --cache, --single-quote, --config, --plugin, etc.), and converts --list-different/-l → --check - Detects all Prettier config files (.prettierrc*, prettier.config.*, package.json#prettier) and .prettierignore - Removes prettier + prettier-plugin-* dependencies - Rewrites scripts in package.json and lint-staged configs - Supports both fresh migration and re-migration (already-vite-plus) - Includes snap test fixtures for basic, rerun, lint-staged, and eslint+prettier combo scenarios
…gration
When Prettier config lives in package.json ("prettier" key) rather than a
standalone file, extract it to a temporary .prettierrc.json so that
`vp fmt --migrate=prettier` can read and convert it to .oxfmtrc.json.
Previously the settings were lost because the migration step was skipped
but deletePrettierConfigFiles still removed pkg.prettier.
…prettier rewrite - Remove --ignore-path from PRETTIER_ONLY_VALUE_FLAGS since vp fmt supports this flag - Add --experimental-cli to PRETTIER_ONLY_BOOLEAN_FLAGS so it gets stripped (fixes vitepress E2E failure)
…rewrite module prettier.rs and eslint.rs had ~85-90% identical code for shell AST walking, command renaming, and flag stripping. Extract all shared logic into a new script_rewrite.rs with a ScriptRewriteConfig struct capturing tool-specific differences (command name, subcommand, flag lists, flag conversions).
…rewrite `prettier -c .` now correctly rewrites to `vp fmt --check .` and `prettier -w .` to `vp fmt .`.
9446c03 to
74a2f23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add Prettier → Oxfmt migration support to
vp migrate, following thesame architecture as the existing ESLint → Oxlint migration: Rust shell
script rewriter → NAPI binding → TypeScript orchestration.
prettier→vp fmt, strips Prettier-onlyflags (--write, --cache, --single-quote, --config, --plugin, etc.),
and converts --list-different/-l → --check
package.json#prettier) and .prettierignore
eslint+prettier combo scenarios