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.
eslint-plugin-foois automatically normalized tofoowhen loaded as ajsPlugin,but
oxlint-plugin-foo— the natural naming convention for oxlint-specific plugins — is not.This forces users to write
oxlint-plugin-foo/ruleinstead offoo/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-eslintpackage works around this by explicitly settingmeta.name = "eslint-js"rather than relying on package name normalization.Root cause
normalize_plugin_name(Rust:crates/oxc_linter/src/config/plugins.rs) andnormalizePluginName(JS:apps/oxlint/src-js/plugins/load.ts) only stripeslint-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_nameshould also be updated to rejectoxlint-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
ReservedExternalPluginNameerror, so no additional guard is needed.