voidzero-dev / voidzero-dev/vite-plus
`vp migrate` silently drops custom lint rules when a `jsPlugin`'s namespace can't be derived
- Ngôn ngữ chính
- Rust
- Star
- 5.8k
- Fork
- 262
- Merge trung bình
- 23 giờ 18 phút
- Pull request đã merge (30 ngày)
- 139
Mô tả
### 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).
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu từ entry point `vp migrate`, nơi hợp nhất `.oxlintrc.json` vào `vite.config.ts`, sau đó theo dõi cách các namespace `jsPlugin` cục bộ được đối sánh. Tái hiện với commit Kumo được liên kết và kiểm tra `meta.name` của plugin `./lint/kumo.js`; hoàn tất khi các rule `kumo/*` của plugin này vẫn tồn tại sau migration và kết quả vẫn có thể quan sát được đối với các plugin bị loại bỏ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, typescript
- Lĩnh vực
- cli, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100