feat(create): auto-migrate ESLint/Prettier to oxlint/oxfmt#1434
feat(create): auto-migrate ESLint/Prettier to oxlint/oxfmt#1434graphite-app[bot] merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0f8b49b. Configure here.
2362203 to
3883230
Compare
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
Merge activity
|
Vite+ is opinionated about oxlint + oxfmt, but `vp create` previously scaffolded templates (e.g. `create-vite --template react-ts`) and left their ESLint flat config and Prettier configs untouched — forcing users to run `vp migrate` as a second step. This wires the existing migration helpers into `vp create` so freshly scaffolded projects are already on the unified toolchain, with no confirmation prompt. - Relocate the ESLint/Prettier prompt/warn/confirm helpers from migration/bin.ts to migration/migrator.ts so create/bin.ts can reuse them without triggering bin.ts's top-level `main()` side effect. - In create/bin.ts, run `promptEslintMigration` and `promptPrettierMigration` after `runViteInstall` (so `@oxlint/migrate` can resolve the template's ESLint plugin imports) and before `runViteFmt`. Always non-interactive — unlike `vp migrate`, the scaffold has no prior user preferences to respect. - Gate on `installSummary.status === 'installed'` so VP_SKIP_INSTALL snap-test runs skip migration cleanly. - Update rfcs/code-generator.md: flip the "does NOT migrate ESLint/Prettier" bullets, update flow diagrams and example output, and document why create skips the confirmation prompt. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes `vp create` post-scaffold flow to conditionally install-before-rewrite and run non-interactive ESLint/Prettier migrations, which can affect dependency installation order and generated configs across package managers (notably Yarn). CI coverage is added, but the behavior change is user-facing and tied to tooling resolution. > > **Overview** > `vp create` now detects when a scaffolded template includes ESLint (flat config) and/or Prettier and **automatically migrates** them to oxlint/oxfmt *before* the usual Vite+ rewrite, so the generated `.oxlintrc.json`/`.oxfmtrc.json` get merged into `vite.config.ts` and scripts/deps are updated. > > To enable reuse without CLI side effects, the ESLint/Prettier prompt/warn/confirm helpers are moved from `migration/bin.ts` into `migration/migrator.ts` (and `setPackageManager` is exported), and `create/bin.ts` adds an install-first path (including forcing Yarn `node-modules` linker) gated on successful install. > > CI and snapshot coverage are expanded with a remote `create-vite react-ts` case and assertions that `eslint.config.js` is removed, no loose `.oxlintrc.json` remains, `vite.config.ts` has a `lint` section, and `package.json` drops `eslint` while using `vp lint`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0f8b49b. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
3883230 to
1c693c2
Compare

Vite+ is opinionated about oxlint + oxfmt, but
vp createpreviouslyscaffolded templates (e.g.
create-vite --template react-ts) and lefttheir ESLint flat config and Prettier configs untouched — forcing users
to run
vp migrateas a second step. This wires the existing migrationhelpers into
vp createso freshly scaffolded projects are already onthe unified toolchain, with no confirmation prompt.
migration/bin.ts to migration/migrator.ts so create/bin.ts can reuse
them without triggering bin.ts's top-level
main()side effect.promptEslintMigrationandpromptPrettierMigrationafterrunViteInstall(so@oxlint/migratecan resolve the template's ESLint plugin imports) and before
runViteFmt. Always non-interactive — unlikevp migrate, thescaffold has no prior user preferences to respect.
installSummary.status === 'installed'so VP_SKIP_INSTALLsnap-test runs skip migration cleanly.
ESLint/Prettier" bullets, update flow diagrams and example output,
and document why create skips the confirmation prompt.
Note
Medium Risk
Changes
vp createpost-scaffold flow to conditionally install-before-rewrite and run non-interactive ESLint/Prettier migrations, which can affect dependency installation order and generated configs across package managers (notably Yarn). CI coverage is added, but the behavior change is user-facing and tied to tooling resolution.Overview
vp createnow detects when a scaffolded template includes ESLint (flat config) and/or Prettier and automatically migrates them to oxlint/oxfmt before the usual Vite+ rewrite, so the generated.oxlintrc.json/.oxfmtrc.jsonget merged intovite.config.tsand scripts/deps are updated.To enable reuse without CLI side effects, the ESLint/Prettier prompt/warn/confirm helpers are moved from
migration/bin.tsintomigration/migrator.ts(andsetPackageManageris exported), andcreate/bin.tsadds an install-first path (including forcing Yarnnode-moduleslinker) gated on successful install.CI and snapshot coverage are expanded with a remote
create-vite react-tscase and assertions thateslint.config.jsis removed, no loose.oxlintrc.jsonremains,vite.config.tshas alintsection, andpackage.jsondropseslintwhile usingvp lint.Reviewed by Cursor Bugbot for commit 0f8b49b. Configure here.