voidzero-dev / voidzero-dev/vite-plus

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

Offen
#2,231 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
migration pending triage
Vorherrschende Sprache
Rust
Sterne
5.8k
Forks
261
Ø Merge
1 T. 34 Min.
Gemergte PRs (30 T.)
135

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
cli, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.