Skip to content

feat(create): auto-migrate ESLint/Prettier to oxlint/oxfmt#1434

Merged
graphite-app[bot] merged 1 commit intomainfrom
migrate-eslint-to-oxlint-on-create
Apr 23, 2026
Merged

feat(create): auto-migrate ESLint/Prettier to oxlint/oxfmt#1434
graphite-app[bot] merged 1 commit intomainfrom
migrate-eslint-to-oxlint-on-create

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 21, 2026

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.

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.

Reviewed by Cursor Bugbot for commit 0f8b49b. Configure here.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 1c693c2
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69e96e0fa37f210008d8ab65

@fengmk2 fengmk2 self-assigned this Apr 21, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 21, 2026


How to use the Graphite Merge Queue

Add 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.

Comment thread rfcs/code-generator.md Outdated
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 22, 2026

@cursor review

@fengmk2 fengmk2 changed the title feat(cli/create): auto-migrate ESLint/Prettier to oxlint/oxfmt feat(create): auto-migrate ESLint/Prettier to oxlint/oxfmt Apr 22, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ 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.

@fengmk2 fengmk2 force-pushed the migrate-eslint-to-oxlint-on-create branch 2 times, most recently from 2362203 to 3883230 Compare April 22, 2026 15:06
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 22, 2026

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@fengmk2 fengmk2 marked this pull request as ready for review April 22, 2026 15:08
@fengmk2 fengmk2 requested review from branchseer and cpojer April 22, 2026 15:08
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Apr 23, 2026

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 -->
@graphite-app graphite-app Bot force-pushed the migrate-eslint-to-oxlint-on-create branch from 3883230 to 1c693c2 Compare April 23, 2026 00:55
@graphite-app graphite-app Bot merged commit 1c693c2 into main Apr 23, 2026
56 checks passed
@graphite-app graphite-app Bot deleted the migrate-eslint-to-oxlint-on-create branch April 23, 2026 01:02
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.

3 participants