Skip to content

linter(js-plugin): strip oxlint-plugin- prefix from JS plugin names #22131

Description

@sushichan044

eslint-plugin-foo is automatically normalized to foo when loaded as a jsPlugin,
but oxlint-plugin-foo — the natural naming convention for oxlint-specific plugins — is not.
This forces users to write oxlint-plugin-foo/rule instead of foo/rule.

Current behavior

{
  "jsPlugins": ["eslint-plugin-foo", "oxlint-plugin-bar"],
  "rules": {
    "foo/some-rule": "error",              // ✅ eslint-plugin- is stripped
    "bar/some-rule": "error",              // ❌ oxlint-plugin- is NOT stripped
    "oxlint-plugin-bar/some-rule": "error" // ✅ only this works
  }
}

Note: the official oxlint-plugin-eslint package works around this by explicitly setting
meta.name = "eslint-js" rather than relying on package name normalization.

Root cause

normalize_plugin_name (Rust: crates/oxc_linter/src/config/plugins.rs) and
normalizePluginName (JS: apps/oxlint/src-js/plugins/load.ts) only strip
eslint-plugin- variants. Both implementations must be kept in sync (noted in comments).

Proposed fix

Apply the same stripping logic to oxlint-plugin- in both implementations.
is_normal_plugin_name should also be updated to reject oxlint-plugin-* as an alias,
consistent with the existing rejection of eslint-plugin-*.

This change is beneficial as long as the normalized name does not conflict with a builtin
plugin name. Such conflicts are already caught by the existing ReservedExternalPluginName
error, so no additional guard is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions