voidzero-dev / voidzero-dev/vite-plus

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

Open
#2,231 0 comments 0 reactions 0 assignees View on GitHub
migration pending triage
Dominant language
Rust
Stars
5.8k
Forks
261
Avg merge
1d 34m
Merged PRs (30d)
135

Description

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

Contributor guide

Open the contributing guide

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.