diff --git a/crates/oxc_linter/src/config/config_builder.rs b/crates/oxc_linter/src/config/config_builder.rs index 3ff30708f7449..7df64a301ba31 100644 --- a/crates/oxc_linter/src/config/config_builder.rs +++ b/crates/oxc_linter/src/config/config_builder.rs @@ -783,6 +783,7 @@ mod test { assert_eq!(*severity, AllowWarnDeny::Deny); } } + // turn on a rule that isn't configured yet and set it to "warn" // note that this is an eslint rule, a plugin that's already turned on. #[test] diff --git a/crates/oxc_linter/src/config/external_plugins.rs b/crates/oxc_linter/src/config/external_plugins.rs index fc750eea29956..fe3c98b095733 100644 --- a/crates/oxc_linter/src/config/external_plugins.rs +++ b/crates/oxc_linter/src/config/external_plugins.rs @@ -130,7 +130,7 @@ impl JsonSchema for ExternalPluginEntry { natively in Rust within oxlint and cannot be used for JS plugins:\n\ - react (includes react-hooks)\n\ - unicorn\n\ - - typescript\n\ + - typescript (includes @typescript-eslint)\n\ - oxc\n\ - import (includes import-x)\n\ - jsdoc\n\ @@ -141,7 +141,6 @@ impl JsonSchema for ExternalPluginEntry { - react-perf\n\ - promise\n\ - node\n\ - - regex\n\ - vue\n\ - eslint\n\n\ If you need to use the JavaScript version of any of these plugins, \ diff --git a/crates/oxc_linter/src/config/overrides.rs b/crates/oxc_linter/src/config/overrides.rs index b935a71c6f5ea..e769ce1ee7534 100644 --- a/crates/oxc_linter/src/config/overrides.rs +++ b/crates/oxc_linter/src/config/overrides.rs @@ -96,10 +96,13 @@ pub struct OxlintOverride { #[serde(default)] pub plugins: Option, - /// JS plugins for this override. + /// JS plugins for this override, allows usage of ESLint plugins with Oxlint. + /// + /// Read more about JS plugins in + /// [the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html). /// /// Note: JS plugins are experimental and not subject to semver. - /// They are not supported in language server at present. + /// They are not supported in the language server (and thus editor integrations) at present. #[serde(rename = "jsPlugins", default, skip_serializing_if = "Option::is_none")] #[schemars(schema_with = "external_plugins_schema")] pub external_plugins: Option>, diff --git a/crates/oxc_linter/src/config/oxlintrc.rs b/crates/oxc_linter/src/config/oxlintrc.rs index 87b118f42b92e..d9e461f44ee7e 100644 --- a/crates/oxc_linter/src/config/oxlintrc.rs +++ b/crates/oxc_linter/src/config/oxlintrc.rs @@ -78,10 +78,13 @@ pub struct Oxlintrc { /// NOTE: Setting the `plugins` field will overwrite the base set of plugins. /// The `plugins` array should reflect all of the plugins you want to use. pub plugins: Option, - /// JS plugins. + /// JS plugins, allows usage of ESLint plugins with Oxlint. + /// + /// Read more about JS plugins in + /// [the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html). /// /// Note: JS plugins are experimental and not subject to semver. - /// They are not supported in language server at present. + /// They are not supported in the language server (and thus editor integrations) at present. #[serde(rename = "jsPlugins", default, skip_serializing_if = "Option::is_none")] #[schemars(schema_with = "external_plugins_schema")] pub external_plugins: Option>, diff --git a/crates/oxc_linter/src/snapshots/schema_json.snap b/crates/oxc_linter/src/snapshots/schema_json.snap index f8b368e9e024a..a96cbe7c9b93d 100644 --- a/crates/oxc_linter/src/snapshots/schema_json.snap +++ b/crates/oxc_linter/src/snapshots/schema_json.snap @@ -64,7 +64,7 @@ expression: json "markdownDescription": "Globs to ignore during linting. These are resolved from the configuration file path." }, "jsPlugins": { - "description": "JS plugins.\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in language server at present.", + "description": "JS plugins, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in the language server (and thus editor integrations) at present.", "anyOf": [ { "type": "null" @@ -77,7 +77,7 @@ expression: json "uniqueItems": true } ], - "markdownDescription": "JS plugins.\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in language server at present." + "markdownDescription": "JS plugins, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in the language server (and thus editor integrations) at present." }, "overrides": { "description": "Add, remove, or otherwise reconfigure rules for specific files or groups of files.", @@ -250,9 +250,9 @@ expression: json ], "properties": { "name": { - "description": "Custom name/alias for the plugin.\n\nNote: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins:\n- react (includes react-hooks)\n- unicorn\n- typescript\n- oxc\n- import (includes import-x)\n- jsdoc\n- jest\n- vitest\n- jsx-a11y\n- nextjs\n- react-perf\n- promise\n- node\n- regex\n- vue\n- eslint\n\nIf you need to use the JavaScript version of any of these plugins, provide a custom alias to avoid conflicts.", + "description": "Custom name/alias for the plugin.\n\nNote: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins:\n- react (includes react-hooks)\n- unicorn\n- typescript (includes @typescript-eslint)\n- oxc\n- import (includes import-x)\n- jsdoc\n- jest\n- vitest\n- jsx-a11y\n- nextjs\n- react-perf\n- promise\n- node\n- vue\n- eslint\n\nIf you need to use the JavaScript version of any of these plugins, provide a custom alias to avoid conflicts.", "type": "string", - "markdownDescription": "Custom name/alias for the plugin.\n\nNote: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins:\n- react (includes react-hooks)\n- unicorn\n- typescript\n- oxc\n- import (includes import-x)\n- jsdoc\n- jest\n- vitest\n- jsx-a11y\n- nextjs\n- react-perf\n- promise\n- node\n- regex\n- vue\n- eslint\n\nIf you need to use the JavaScript version of any of these plugins, provide a custom alias to avoid conflicts." + "markdownDescription": "Custom name/alias for the plugin.\n\nNote: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins:\n- react (includes react-hooks)\n- unicorn\n- typescript (includes @typescript-eslint)\n- oxc\n- import (includes import-x)\n- jsdoc\n- jest\n- vitest\n- jsx-a11y\n- nextjs\n- react-perf\n- promise\n- node\n- vue\n- eslint\n\nIf you need to use the JavaScript version of any of these plugins, provide a custom alias to avoid conflicts." }, "specifier": { "description": "Path or package name of the plugin", @@ -522,7 +522,7 @@ expression: json "markdownDescription": "Enabled or disabled specific global variables." }, "jsPlugins": { - "description": "JS plugins for this override.\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in language server at present.", + "description": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in the language server (and thus editor integrations) at present.", "anyOf": [ { "type": "null" @@ -535,7 +535,7 @@ expression: json "uniqueItems": true } ], - "markdownDescription": "JS plugins for this override.\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in language server at present." + "markdownDescription": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in the language server (and thus editor integrations) at present." }, "plugins": { "description": "Optionally change what plugins are enabled for this override. When\nomitted, the base config's plugins are used.", diff --git a/npm/oxlint/configuration_schema.json b/npm/oxlint/configuration_schema.json index 20dba9fca4b52..46d66f94861c0 100644 --- a/npm/oxlint/configuration_schema.json +++ b/npm/oxlint/configuration_schema.json @@ -60,7 +60,7 @@ "markdownDescription": "Globs to ignore during linting. These are resolved from the configuration file path." }, "jsPlugins": { - "description": "JS plugins.\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in language server at present.", + "description": "JS plugins, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in the language server (and thus editor integrations) at present.", "anyOf": [ { "type": "null" @@ -73,7 +73,7 @@ "uniqueItems": true } ], - "markdownDescription": "JS plugins.\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in language server at present." + "markdownDescription": "JS plugins, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in the language server (and thus editor integrations) at present." }, "overrides": { "description": "Add, remove, or otherwise reconfigure rules for specific files or groups of files.", @@ -246,9 +246,9 @@ ], "properties": { "name": { - "description": "Custom name/alias for the plugin.\n\nNote: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins:\n- react (includes react-hooks)\n- unicorn\n- typescript\n- oxc\n- import (includes import-x)\n- jsdoc\n- jest\n- vitest\n- jsx-a11y\n- nextjs\n- react-perf\n- promise\n- node\n- regex\n- vue\n- eslint\n\nIf you need to use the JavaScript version of any of these plugins, provide a custom alias to avoid conflicts.", + "description": "Custom name/alias for the plugin.\n\nNote: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins:\n- react (includes react-hooks)\n- unicorn\n- typescript (includes @typescript-eslint)\n- oxc\n- import (includes import-x)\n- jsdoc\n- jest\n- vitest\n- jsx-a11y\n- nextjs\n- react-perf\n- promise\n- node\n- vue\n- eslint\n\nIf you need to use the JavaScript version of any of these plugins, provide a custom alias to avoid conflicts.", "type": "string", - "markdownDescription": "Custom name/alias for the plugin.\n\nNote: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins:\n- react (includes react-hooks)\n- unicorn\n- typescript\n- oxc\n- import (includes import-x)\n- jsdoc\n- jest\n- vitest\n- jsx-a11y\n- nextjs\n- react-perf\n- promise\n- node\n- regex\n- vue\n- eslint\n\nIf you need to use the JavaScript version of any of these plugins, provide a custom alias to avoid conflicts." + "markdownDescription": "Custom name/alias for the plugin.\n\nNote: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins:\n- react (includes react-hooks)\n- unicorn\n- typescript (includes @typescript-eslint)\n- oxc\n- import (includes import-x)\n- jsdoc\n- jest\n- vitest\n- jsx-a11y\n- nextjs\n- react-perf\n- promise\n- node\n- vue\n- eslint\n\nIf you need to use the JavaScript version of any of these plugins, provide a custom alias to avoid conflicts." }, "specifier": { "description": "Path or package name of the plugin", @@ -518,7 +518,7 @@ "markdownDescription": "Enabled or disabled specific global variables." }, "jsPlugins": { - "description": "JS plugins for this override.\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in language server at present.", + "description": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in the language server (and thus editor integrations) at present.", "anyOf": [ { "type": "null" @@ -531,7 +531,7 @@ "uniqueItems": true } ], - "markdownDescription": "JS plugins for this override.\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in language server at present." + "markdownDescription": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\nThey are not supported in the language server (and thus editor integrations) at present." }, "plugins": { "description": "Optionally change what plugins are enabled for this override. When\nomitted, the base config's plugins are used.", diff --git a/tasks/website_linter/src/snapshots/schema_markdown.snap b/tasks/website_linter/src/snapshots/schema_markdown.snap index 01c9033f7525f..fcb3216557a13 100644 --- a/tasks/website_linter/src/snapshots/schema_markdown.snap +++ b/tasks/website_linter/src/snapshots/schema_markdown.snap @@ -209,10 +209,13 @@ Globs to ignore during linting. These are resolved from the configuration file p type: `array | null` -JS plugins. +JS plugins, allows usage of ESLint plugins with Oxlint. + +Read more about JS plugins in +[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html). Note: JS plugins are experimental and not subject to semver. -They are not supported in language server at present. +They are not supported in the language server (and thus editor integrations) at present. ### jsPlugins[n] @@ -233,7 +236,7 @@ Custom name/alias for the plugin. Note: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins: - react (includes react-hooks) - unicorn -- typescript +- typescript (includes @typescript-eslint) - oxc - import (includes import-x) - jsdoc @@ -244,7 +247,6 @@ Note: The following plugin names are reserved because they are implemented nativ - react-perf - promise - node -- regex - vue - eslint @@ -304,10 +306,13 @@ Enabled or disabled specific global variables. type: `array | null` -JS plugins for this override. +JS plugins for this override, allows usage of ESLint plugins with Oxlint. + +Read more about JS plugins in +[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html). Note: JS plugins are experimental and not subject to semver. -They are not supported in language server at present. +They are not supported in the language server (and thus editor integrations) at present. ##### overrides[n].jsPlugins[n] @@ -328,7 +333,7 @@ Custom name/alias for the plugin. Note: The following plugin names are reserved because they are implemented natively in Rust within oxlint and cannot be used for JS plugins: - react (includes react-hooks) - unicorn -- typescript +- typescript (includes @typescript-eslint) - oxc - import (includes import-x) - jsdoc @@ -339,7 +344,6 @@ Note: The following plugin names are reserved because they are implemented nativ - react-perf - promise - node -- regex - vue - eslint