Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions crates/oxc_linter/src/config/oxlintrc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,35 @@ pub struct Oxlintrc {
///
/// Note: JS plugins are experimental and not subject to semver.
/// They are not supported in the language server (and thus editor integrations) at present.
///
/// Examples:
///
/// Basic usage with a local plugin path.
///
/// ```json
/// {
/// "jsPlugins": ["./eslint-plugin-custom.js"],
/// "rules": {
/// "custom/rule-name": "warn"
/// }
/// }
/// ```
///
/// Using a built-in Rust plugin alongside a JS plugin with the same name
/// by giving the JS plugin an alias.
///
/// ```json
/// {
/// "plugins": ["import"],
/// "jsPlugins": [
/// { "name": "import-js", "specifier": "eslint-plugin-import" }
/// ],
/// "rules": {
/// "import/no-cycle": "error",
/// "import-js/no-unresolved": "warn"
/// }
/// }
/// ```
#[serde(rename = "jsPlugins", default, skip_serializing_if = "Option::is_none")]
#[schemars(schema_with = "external_plugins_schema")]
pub external_plugins: Option<FxHashSet<ExternalPluginEntry>>,
Expand Down
4 changes: 2 additions & 2 deletions npm/oxlint/configuration_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"markdownDescription": "Globs to ignore during linting. These are resolved from the configuration file path."
},
"jsPlugins": {
"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.",
"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.\n\nExamples:\n\nBasic usage with a local plugin path.\n\n```json\n{\n\"jsPlugins\": [\"./eslint-plugin-custom.js\"],\n\"rules\": {\n\"custom/rule-name\": \"warn\"\n}\n}\n```\n\nUsing a built-in Rust plugin alongside a JS plugin with the same name\nby giving the JS plugin an alias.\n\n```json\n{\n\"plugins\": [\"import\"],\n\"jsPlugins\": [\n{ \"name\": \"import-js\", \"specifier\": \"eslint-plugin-import\" }\n],\n\"rules\": {\n\"import/no-cycle\": \"error\",\n\"import-js/no-unresolved\": \"warn\"\n}\n}\n```",
"anyOf": [
{
"type": "null"
Expand All @@ -73,7 +73,7 @@
"uniqueItems": true
}
],
"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."
"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.\n\nExamples:\n\nBasic usage with a local plugin path.\n\n```json\n{\n\"jsPlugins\": [\"./eslint-plugin-custom.js\"],\n\"rules\": {\n\"custom/rule-name\": \"warn\"\n}\n}\n```\n\nUsing a built-in Rust plugin alongside a JS plugin with the same name\nby giving the JS plugin an alias.\n\n```json\n{\n\"plugins\": [\"import\"],\n\"jsPlugins\": [\n{ \"name\": \"import-js\", \"specifier\": \"eslint-plugin-import\" }\n],\n\"rules\": {\n\"import/no-cycle\": \"error\",\n\"import-js/no-unresolved\": \"warn\"\n}\n}\n```"
},
"overrides": {
"description": "Add, remove, or otherwise reconfigure rules for specific files or groups of files.",
Expand Down
4 changes: 2 additions & 2 deletions tasks/website_linter/src/snapshots/schema_json.snap
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ expression: json
"markdownDescription": "Globs to ignore during linting. These are resolved from the configuration file path."
},
"jsPlugins": {
"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.",
"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.\n\nExamples:\n\nBasic usage with a local plugin path.\n\n```json\n{\n\"jsPlugins\": [\"./eslint-plugin-custom.js\"],\n\"rules\": {\n\"custom/rule-name\": \"warn\"\n}\n}\n```\n\nUsing a built-in Rust plugin alongside a JS plugin with the same name\nby giving the JS plugin an alias.\n\n```json\n{\n\"plugins\": [\"import\"],\n\"jsPlugins\": [\n{ \"name\": \"import-js\", \"specifier\": \"eslint-plugin-import\" }\n],\n\"rules\": {\n\"import/no-cycle\": \"error\",\n\"import-js/no-unresolved\": \"warn\"\n}\n}\n```",
"anyOf": [
{
"type": "null"
Expand All @@ -77,7 +77,7 @@ expression: json
"uniqueItems": true
}
],
"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."
"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.\n\nExamples:\n\nBasic usage with a local plugin path.\n\n```json\n{\n\"jsPlugins\": [\"./eslint-plugin-custom.js\"],\n\"rules\": {\n\"custom/rule-name\": \"warn\"\n}\n}\n```\n\nUsing a built-in Rust plugin alongside a JS plugin with the same name\nby giving the JS plugin an alias.\n\n```json\n{\n\"plugins\": [\"import\"],\n\"jsPlugins\": [\n{ \"name\": \"import-js\", \"specifier\": \"eslint-plugin-import\" }\n],\n\"rules\": {\n\"import/no-cycle\": \"error\",\n\"import-js/no-unresolved\": \"warn\"\n}\n}\n```"
},
"overrides": {
"description": "Add, remove, or otherwise reconfigure rules for specific files or groups of files.",
Expand Down
29 changes: 29 additions & 0 deletions tasks/website_linter/src/snapshots/schema_markdown.snap
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,35 @@ Read more about JS plugins in
Note: JS plugins are experimental and not subject to semver.
They are not supported in the language server (and thus editor integrations) at present.

Examples:

Basic usage with a local plugin path.

```json
{
"jsPlugins": ["./eslint-plugin-custom.js"],
"rules": {
"custom/rule-name": "warn"
}
}
```

Using a built-in Rust plugin alongside a JS plugin with the same name
by giving the JS plugin an alias.

```json
{
"plugins": ["import"],
"jsPlugins": [
{ "name": "import-js", "specifier": "eslint-plugin-import" }
],
"rules": {
"import/no-cycle": "error",
"import-js/no-unresolved": "warn"
}
}
```


### jsPlugins[n]

Expand Down
Loading