voidzero-dev / voidzero-dev/vite-plus
`vp migrate` silently drops custom lint rules when a `jsPlugin`'s namespace can't be derived
- 主要言語
- Rust
- スター
- 5.8k
- フォーク
- 262
- 平均マージ
- 23時間 41分
- マージ済み PR(30日)
- 138
説明
### Describe the bug
When `vp migrate` merges `.oxlintrc.json` into `vite.config.ts`, it drops all rules whose namespace it can't match to a plugin.
For a local jsPlugin like `./lint/kumo.js`, the plugin's real namespace (`kumo`, from its `meta.name`) is never derived from the path, so every `kumo/*` rule is removed from the merged config.
This happens silently for rules while dropped plugins produce a warning.
#### Solution approach
We could resolve the real namespace (import the plugin and read meta.name) which is exactly what oxlint does at lint time.
### Reproduction
https://github.com/cloudflare/kumo/commit/2a463f7f260f5a3c4523099600fe65b4764acff4
### Steps to reproduce
1. Try migrating this app via `vp migrate`
2. See the rules missing
### System Info
```shell
Source .node-version
Source Path /Users/alichter/Programming/kumo/.node-version
Project Root /Users/alichter/Programming/kumo
Tool Paths:
node /Users/alichter/.vite-plus/js_runtime/node/24.12.0/bin/node
npm /Users/alichter/.vite-plus/js_runtime/node/24.12.0/bin/npm
npx /Users/alichter/.vite-plus/js_runtime/node/24.12.0/bin/npx
Package Manager:
Name pnpm
Version 10.22.0
Source packageManager
Source Path /Users/alichter/Programming/kumo/package.json
Project Root /Users/alichter/Programming/kumo
Bin Path /Users/alichter/.vite-plus/package_manager/pnpm/10.22.0/pnpm/bin/pnpm
```
### Used Package Manager
pnpm
### Logs
```shell
```
### Validations
- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Check that there isn't [already an issue](https://github.com/voidzero-dev/vite-plus/issues) for the same bug.
- [x] Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).
コントリビューションガイド
調査の方向性
`.oxlintrc.json` を `vite.config.ts` にマージするエントリポイント `vp migrate` から始め、ローカルの `jsPlugin` namespace がどのように照合されるかを追跡します。リンクされた Kumo の commit で再現し、`./lint/kumo.js` プラグインの `meta.name` を調べます。その `kumo/*` ルールが migration 後も残り、削除されたプラグインについても結果を引き続き観測できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- cli, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100