Skip to content

Commit 84ef5ab

Browse files
authored
docs(linter): Avoid linebreaks for markdown links and update plugins docs in the configuration schema. (#15246)
This bothered me: <img width="795" height="245" alt="Screenshot 2025-11-03 at 5 27 07 PM" src="https://github.com/user-attachments/assets/071a1800-b5dd-427d-ad11-310081d116ae" /> Although I think this may not fix the problem anyway because we aren't serializing the values in the configuration_schema.json file as `markdownDescription`? So VS Code may not render it as markdown anyway. Also updated the docs for the `plugins` field, which previously had no docs: <img width="683" height="213" alt="Screenshot 2025-11-03 at 7 28 25 PM" src="https://github.com/user-attachments/assets/47ea2465-878b-440a-a9b0-de68a43fcb8c" />
1 parent 7a00691 commit 84ef5ab

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

crates/oxc_linter/src/config/env.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ use serde::{Deserialize, Serialize};
66

77
/// Predefine global variables.
88
///
9-
/// Environments specify what global variables are predefined. See [ESLint's
10-
/// list of
11-
/// environments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)
9+
/// Environments specify what global variables are predefined.
10+
/// See [ESLint's list of environments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)
1211
/// for what environments are available and what each one provides.
1312
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
1413
pub struct OxlintEnv(FxHashMap<String, bool>);

crates/oxc_linter/src/config/oxlintrc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ use super::{
6363
#[serde(default)]
6464
#[non_exhaustive]
6565
pub struct Oxlintrc {
66+
/// Enabled built-in plugins for Oxlint.
67+
/// You can view the list of available plugins on
68+
/// [the website](https://oxc.rs/docs/guide/usage/linter/plugins.html#supported-plugins).
69+
///
70+
/// NOTE: Setting the `plugins` field will overwrite the base set of plugins.
71+
/// The `plugins` array should reflect all of the plugins you want to use.
6672
pub plugins: Option<LintPlugins>,
6773
/// JS plugins.
6874
///

crates/oxc_linter/src/snapshots/schema_json.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ expression: json
7171
]
7272
},
7373
"plugins": {
74+
"description": "Enabled built-in plugins for Oxlint.\nYou can view the list of available plugins on\n[the website](https://oxc.rs/docs/guide/usage/linter/plugins.html#supported-plugins).\n\nNOTE: Setting the `plugins` field will overwrite the base set of plugins.\nThe `plugins` array should reflect all of the plugins you want to use.",
7475
"default": null,
7576
"anyOf": [
7677
{
@@ -395,7 +396,7 @@ expression: json
395396
"additionalProperties": false
396397
},
397398
"OxlintEnv": {
398-
"description": "Predefine global variables.\n\nEnvironments specify what global variables are predefined. See [ESLint's\nlist of\nenvironments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)\nfor what environments are available and what each one provides.",
399+
"description": "Predefine global variables.\n\nEnvironments specify what global variables are predefined.\nSee [ESLint's list of environments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)\nfor what environments are available and what each one provides.",
399400
"type": "object",
400401
"additionalProperties": {
401402
"type": "boolean"

npm/oxlint/configuration_schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
]
6868
},
6969
"plugins": {
70+
"description": "Enabled built-in plugins for Oxlint.\nYou can view the list of available plugins on\n[the website](https://oxc.rs/docs/guide/usage/linter/plugins.html#supported-plugins).\n\nNOTE: Setting the `plugins` field will overwrite the base set of plugins.\nThe `plugins` array should reflect all of the plugins you want to use.",
7071
"default": null,
7172
"anyOf": [
7273
{
@@ -391,7 +392,7 @@
391392
"additionalProperties": false
392393
},
393394
"OxlintEnv": {
394-
"description": "Predefine global variables.\n\nEnvironments specify what global variables are predefined. See [ESLint's\nlist of\nenvironments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)\nfor what environments are available and what each one provides.",
395+
"description": "Predefine global variables.\n\nEnvironments specify what global variables are predefined.\nSee [ESLint's list of environments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)\nfor what environments are available and what each one provides.",
395396
"type": "object",
396397
"additionalProperties": {
397398
"type": "boolean"

tasks/website/src/linter/snapshots/schema_markdown.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ type: `Record<string, boolean>`
137137

138138
Predefine global variables.
139139

140-
Environments specify what global variables are predefined. See [ESLint's
141-
list of
142-
environments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)
140+
Environments specify what global variables are predefined.
141+
See [ESLint's list of environments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)
143142
for what environments are available and what each one provides.
144143

145144

0 commit comments

Comments
 (0)