voidzero-dev / voidzero-dev/vite-plus

`vp migrate` silently drops custom lint rules when a `jsPlugin`'s namespace can't be derived

Aperta
#2,231 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
migration pending triage
Lingua principale
Rust
Stelle
5.8k
Fork
261
Merge medio
1g 34m
PR unite (30g)
135

Descrizione

### 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).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start at the `vp migrate` entry point that merges `.oxlintrc.json` into `vite.config.ts`, then trace how local `jsPlugin` namespaces are matched. Reproduce with the linked Kumo commit and inspect the `./lint/kumo.js` plugin's `meta.name`; done when its `kumo/*` rules survive migration and the result remains observable for dropped plugins.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, typescript
Ambito
cli, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.