voidzero-dev / voidzero-dev/vite-plus
`vp migrate` silently drops custom lint rules when a `jsPlugin`'s namespace can't be derived
- Lenguaje dominante
- Rust
- Estrellas
- 5.8k
- Forks
- 262
- Merge medio
- 23 h 41 min
- PR fusionados (30 d)
- 138
Descripción
### 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).
Guía de contribución
Línea de trabajo
Comienza en el punto de entrada `vp migrate`, que fusiona `.oxlintrc.json` en `vite.config.ts`, y luego rastrea cómo se comparan los espacios de nombres locales de `jsPlugin`. Reproduce el problema con el commit de Kumo enlazado e inspecciona `meta.name` del plugin `./lint/kumo.js`; el trabajo estará terminado cuando sus reglas `kumo/*` sobrevivan a la migración y el resultado siga siendo observable para los plugins descartados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, typescript
- Área
- cli, tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 55/100