Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ name = "migration_eslint_legacy_already_vite_plus"
vp = "global"
skip-platforms = [{ os = "linux", libc = "musl" }]
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "should show legacy config warning and already using Vite+", continue-on-failure = true },
{ argv = ["vp", "migrate", "--full", "--no-interactive"], comment = "full migration of an existing Vite+ project should warn about the legacy ESLint config and skip ESLint migration", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "check eslint and its lint script are kept", continue-on-failure = true },
{ argv = ["vpt", "stat-file", ".eslintrc", "--assert", "file"], comment = "check legacy config is kept", continue-on-failure = true },
]
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
# migration_eslint_legacy_already_vite_plus

## `vp migrate --no-interactive`
## `vp migrate --full --no-interactive`

should show legacy config warning and already using Vite+
full migration of an existing Vite+ project should warn about the legacy ESLint config and skip ESLint migration

```
VITE+ - The Unified Toolchain for the Web

▲ Legacy ESLint configuration detected (.eslintrc). Automatic migration to Oxlint requires ESLint v9+ with flat config format (eslint.config.*). Please upgrade to ESLint v9 first: https://eslint.org/docs/latest/use/migrate-to-9.0.0
◇ Updated . to Vite+ <version>
• Node <version> pnpm <version>
• Dependencies:
vite-plus latest → <version>
vite → <version>
• 2 config updates applied
• Package manager settings configured
• Skipped editor, hooks, and lint setup. Run `vp migrate --full` to apply them.
```

## `vpt print-file package.json`

check eslint and its lint script are kept

```
{
"name": "migration-eslint-legacy-already-vite-plus",
"scripts": {
"lint": "eslint .",
"prepare": "vp config"
},
"devDependencies": {
"eslint": "^8.23.1",
"vite-plus": "catalog:"
}
}
```

## `vpt stat-file .eslintrc --assert file`

check legacy config is kept

```
.eslintrc: file
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "migration_eslint_rerun"
vp = "global"
skip-platforms = [{ os = "linux", libc = "musl" }]
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "should detect vite-plus + eslint and auto-migrate eslint", continue-on-failure = true },
{ argv = ["vp", "migrate", "--full", "--no-interactive"], comment = "should detect vite-plus + eslint and auto-migrate eslint", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "check eslint removed from devDependencies and scripts rewritten", continue-on-failure = true },
{ argv = ["vpt", "stat-file", "eslint.config.mjs", "--assert-not", "file"], comment = "check eslint config is removed", continue-on-failure = true },
{ argv = ["vpt", "print-file", "vite.config.ts"], comment = "check oxlint config merged into vite.config.ts", continue-on-failure = true },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# migration_eslint_rerun

## `vp migrate --no-interactive`
## `vp migrate --full --no-interactive`

should detect vite-plus + eslint and auto-migrate eslint

Expand All @@ -12,8 +12,9 @@ VITE+ - The Unified Toolchain for the Web
• Dependencies:
vite-plus latest → <version>
vite → <version>
• 4 config updates applied
• ESLint rules migrated to Oxlint
• Package manager settings configured
• Skipped editor, hooks, and lint setup. Run `vp migrate --full` to apply them.
```

## `vpt print-file package.json`
Expand All @@ -24,10 +25,10 @@ check eslint removed from devDependencies and scripts rewritten
{
"name": "migration-eslint-rerun",
"scripts": {
"lint": "eslint ."
"lint": "vp lint .",
"prepare": "vp config"
},
"devDependencies": {
"eslint": "^9.0.0",
"vite-plus": "catalog:"
}
}
Expand All @@ -37,20 +38,47 @@ check eslint removed from devDependencies and scripts rewritten

check eslint config is removed

**Exit code:** 1

```
eslint.config.mjs: file
stat-file assertion failed
eslint.config.mjs: missing
```

## `vpt print-file vite.config.ts`

check oxlint config merged into vite.config.ts

**Exit code:** 1

```
vite.config.ts: not found
missing file
import { defineConfig } from 'vite-plus';

export default defineConfig({
staged: {
"*": "vp check --fix"
},
lint: {
"plugins": [
"oxc",
"typescript",
"unicorn"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true
},
"rules": {
"no-unused-vars": "error",
"vite-plus/prefer-vite-plus-imports": "error"
},
"options": {
"typeAware": true,
"typeCheck": true
},
"jsPlugins": [
{
"name": "vite-plus",
"specifier": "vite-plus/oxlint-plugin"
}
]
},
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "migration_eslint_rerun_dual_config"
vp = "global"
skip-platforms = [{ os = "linux", libc = "musl" }]
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "should detect vite-plus + eslint and auto-migrate eslint", continue-on-failure = true },
{ argv = ["vp", "migrate", "--full", "--no-interactive"], comment = "should detect vite-plus + eslint and auto-migrate eslint", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "check eslint removed and scripts rewritten", continue-on-failure = true },
{ argv = ["vpt", "stat-file", "eslint.config.mjs", "--assert-not", "file"], comment = "check flat config is removed", continue-on-failure = true },
{ argv = ["vpt", "stat-file", ".eslintrc", "--assert-not", "file"], comment = "check legacy config is also removed", continue-on-failure = true },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# migration_eslint_rerun_dual_config

## `vp migrate --no-interactive`
## `vp migrate --full --no-interactive`

should detect vite-plus + eslint and auto-migrate eslint

Expand All @@ -12,8 +12,9 @@ VITE+ - The Unified Toolchain for the Web
• Dependencies:
vite-plus latest → <version>
vite → <version>
• 5 config updates applied
• ESLint rules migrated to Oxlint
• Package manager settings configured
• Skipped editor, hooks, and lint setup. Run `vp migrate --full` to apply them.
```

## `vpt print-file package.json`
Expand All @@ -24,10 +25,10 @@ check eslint removed and scripts rewritten
{
"name": "migration-eslint-rerun-dual-config",
"scripts": {
"lint": "eslint ."
"lint": "vp lint .",
"prepare": "vp config"
},
"devDependencies": {
"eslint": "^9.0.0",
"vite-plus": "catalog:"
}
}
Expand All @@ -37,31 +38,55 @@ check eslint removed and scripts rewritten

check flat config is removed

**Exit code:** 1

```
eslint.config.mjs: file
stat-file assertion failed
eslint.config.mjs: missing
```

## `vpt stat-file .eslintrc --assert-not file`

check legacy config is also removed

**Exit code:** 1

```
.eslintrc: file
stat-file assertion failed
.eslintrc: missing
```

## `vpt print-file vite.config.ts`

check oxlint config merged into vite.config.ts

**Exit code:** 1

```
vite.config.ts: not found
missing file
import { defineConfig } from 'vite-plus';

export default defineConfig({
staged: {
"*": "vp check --fix"
},
lint: {
"plugins": [
"oxc",
"typescript",
"unicorn"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true
},
"rules": {
"no-unused-vars": "error",
"vite-plus/prefer-vite-plus-imports": "error"
},
"options": {
"typeAware": true,
"typeCheck": true
},
"jsPlugins": [
{
"name": "vite-plus",
"specifier": "vite-plus/oxlint-plugin"
}
]
},
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "migration_eslint_rerun_mjs"
vp = "global"
skip-platforms = [{ os = "linux", libc = "musl" }]
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "should detect vite-plus + eslint and auto-migrate eslint", continue-on-failure = true },
{ argv = ["vp", "migrate", "--full", "--no-interactive"], comment = "should detect vite-plus + eslint and auto-migrate eslint", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "check eslint removed from devDependencies and scripts rewritten", continue-on-failure = true },
{ argv = ["vpt", "stat-file", "eslint.config.mjs", "--assert-not", "file"], comment = "check eslint config is removed", continue-on-failure = true },
{ argv = ["vpt", "print-file", "vite.config.mjs"], comment = "check oxlint config merged into existing vite.config.mjs (not creating vite.config.ts)", continue-on-failure = true },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# migration_eslint_rerun_mjs

## `vp migrate --no-interactive`
## `vp migrate --full --no-interactive`

should detect vite-plus + eslint and auto-migrate eslint

Expand All @@ -12,8 +12,9 @@ VITE+ - The Unified Toolchain for the Web
• Dependencies:
vite-plus latest → <version>
vite → <version>
• 3 config updates applied
• ESLint rules migrated to Oxlint
• Package manager settings configured
• Skipped editor, hooks, and lint setup. Run `vp migrate --full` to apply them.
```

## `vpt print-file package.json`
Expand All @@ -24,10 +25,10 @@ check eslint removed from devDependencies and scripts rewritten
{
"name": "migration-eslint-rerun-mjs",
"scripts": {
"lint": "eslint ."
"lint": "vp lint .",
"prepare": "vp config"
},
"devDependencies": {
"eslint": "^9.0.0",
"vite-plus": "catalog:"
}
}
Expand All @@ -37,11 +38,8 @@ check eslint removed from devDependencies and scripts rewritten

check eslint config is removed

**Exit code:** 1

```
eslint.config.mjs: file
stat-file assertion failed
eslint.config.mjs: missing
```

## `vpt print-file vite.config.mjs`
Expand All @@ -51,5 +49,36 @@ check oxlint config merged into existing vite.config.mjs (not creating vite.conf
```
import { defineConfig } from 'vite-plus';

export default defineConfig({});
export default defineConfig({
staged: {
"*": "vp check --fix"
},
lint: {
"plugins": [
"oxc",
"typescript",
"unicorn"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true
},
"rules": {
"no-unused-vars": "error",
"vite-plus/prefer-vite-plus-imports": "error"
},
"options": {
"typeAware": true,
"typeCheck": true
},
"jsPlugins": [
{
"name": "vite-plus",
"specifier": "vite-plus/oxlint-plugin"
}
]
},
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "migration_prettier_rerun"
vp = "global"
skip-platforms = [{ os = "linux", libc = "musl" }]
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "should detect vite-plus + prettier and auto-migrate prettier", continue-on-failure = true },
{ argv = ["vp", "migrate", "--full", "--no-interactive"], comment = "should detect vite-plus + prettier and auto-migrate prettier", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "check prettier removed from devDependencies and scripts rewritten", continue-on-failure = true },
{ argv = ["vpt", "stat-file", ".prettierrc.json", "--assert-not", "file"], comment = "check prettier config is removed", continue-on-failure = true },
{ argv = ["vpt", "print-file", "vite.config.ts"], comment = "check oxfmt config merged into vite.config.ts", continue-on-failure = true },
Expand Down
Loading
Loading