Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

`vp migrate` copies string `extends` paths from `.oxlintrc.json` into `lint`, which `vp lint` rejects

未關閉
#3,089 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@fengmk2 已經在處理了。

開始於 2026年10月17日。

  • #3097 來自 @fengmk2 —— 未關閉

評估

難度
3/5
預估耗時
1-2 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rust, typescript

研究方向

Start from the reproduction repo (cr101/vp-migrate-extends-repro) and run the migrate step to see how .oxlintrc.json is folded into the lint block of vite.config.ts. The string extends entries are copied unchanged, so the migrator needs to resolve each path relative to the original file, or keep the file and skip the lint block. Done when vp lint and tsc -p . both pass on the migrated repro, or the migrator warns and leaves the config for manual migration.

由索引模型根據 Issue 內容生成。

描述

Describe the bug

.oxlintrc.json can extend other config files by path, as the Oxlint docs describe:

{ "extends": ["./shared/oxlint-config.json"] }

vp migrate deletes .oxlintrc.json and copies the path string unchanged into the lint block of vite.config.ts:

lint: {
  extends: ["./shared/oxlint-config.json"],
  // ...
}

Vite+ then rejects that config:

  • vp lint fails with "extends[0] must be a config object (strings/paths are not supported)."
  • tsc fails with TS2559: Type 'string' has no properties in common with type 'OxlintConfig'.

The migration reports success, but linting is broken afterwards, and the original .oxlintrc.json has been deleted.

Expected: either the migrator resolves each extends path and inlines or imports the config as an object, or it keeps .oxlintrc.json, leaves the lint block out and warns that the config needs to be migrated by hand.

Reproduction

https://github.com/cr101/vp-migrate-extends-repro

Steps to reproduce
npm install
npm run lint            # oxlint applies no-debugger from the extended config
npx -y [email protected] vp migrate --no-interactive --no-agent --no-editor --no-hooks
npx vp lint             # fails
npx tsc -p .            # fails
System Info
$ vp env current
Node.js:
  Version    26.12.0
  Source     system PATH
  Bin Path   C:\Program Files\nodejs\node.exe
  Installed  true
  Mode       system_first

Package Manager:
  Name       npm
  Version    11.20.0
  Source     system PATH
  Bin Paths
    npm      C:\Program Files\nodejs\npm.cmd
    npx      C:\Program Files\nodejs\npx.cmd
  Installed  true
  Mode       system_first

$ vp --version   # global CLI, in the repro before migration
vp v1.2.0

Local vite-plus:
  vite-plus  Not found

Tools:
  vite             Not found
  rolldown         Not found
  vitest           Not found
  oxfmt            Not found
  oxlint           Not found
  oxlint-tsgolint  Not found
  tsdown           Not found

Environment:
  Package manager  npm v11.8.0
  Node.js          v24.22.0

$ npx vp --version   # local CLI, in the repro after migration
vp v1.2.0

Local vite-plus:
  vite-plus  v1.2.0

Tools:
  vite             v8.3.4
  rolldown         v1.2.13
  vitest           v5.0.4
  oxfmt            v0.73.0
  oxlint           v1.88.0
  oxlint-tsgolint  v7.0.2004
  tsdown           v0.23.1

Windows x64. The migration and checks ran on system Node 26.12.0, with npm 11.8.0 selected by `packageManager`.
Used Package Manager

npm

Logs
$ npx vp migrate --no-interactive --no-agent --no-editor --no-hooks
◇ Migrated . to Vite+ 1.2.0
• Node 26.12.0  npm 11.8.0
✓ Dependencies installed in 16s
• 1 config update applied, 1 file had imports rewritten

$ npx vp lint
Failed to parse oxlint configuration file.

  x Failed to load config: ...\vp-extends-repro\vite.config.ts
  |
  | Error: `extends[0]` must be a config object (strings/paths are not supported).

$ npx tsc -p .
vite.config.ts(6,15): error TS2559: Type 'string' has no properties in common with type 'OxlintConfig'.
Validations
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue for the same bug. Related but different: #2430 and #2483 (dynamic oxlint.config.ts/oxfmt.config.ts), and #2037 (migrate follow-ups; no extends item).
  • Confirm this is a Vite+ issue and not an upstream issue. Oxlint supports path extends in .oxlintrc.json; the invalid config is produced by vp migrate.
  • The provided reproduction is a minimal reproducible example.
主要語言
Rust
星號
6k
分支
274
平均合併
1 天 12 小時
30 天內合併 PR
205

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

voidzero-dev/vite-plus 的其他 Issue

查看 voidzero-dev/vite-plus 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。