Skip to content

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

Description

@TheAlexLichter

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

cloudflare/kumo@2a463f7

Steps to reproduce

  1. Try migrating this app via vp migrate
  2. See the rules missing

System Info

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

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Target date

    None yet

    Start date

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions