Skip to content

Commit a6b0100

Browse files
authored
docs(linter): fix config example headings (#7562)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
1 parent 0f3f67a commit a6b0100

7 files changed

Lines changed: 19 additions & 21 deletions

File tree

crates/oxc_linter/src/config/settings/jsx_a11y.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub struct JSXA11yPluginSettings {
2929
/// To have your custom components be checked as DOM elements, you can
3030
/// provide a mapping of your component names to the DOM element name.
3131
///
32-
/// ## Example
32+
/// Example:
3333
///
3434
/// ```json
3535
/// {

crates/oxc_linter/src/config/settings/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ use self::{
1515
///
1616
/// Configure the behavior of linter plugins.
1717
///
18-
/// ## Example
19-
///
2018
/// Here's an example if you're using Next.js in a monorepo:
2119
///
2220
/// ```json

crates/oxc_linter/src/config/settings/next.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct NextPluginSettings {
1212
/// This is particularly useful when you have a monorepo and your Next.js
1313
/// project is in a subfolder.
1414
///
15-
/// ## Example
15+
/// Example:
1616
///
1717
/// ```json
1818
/// {

crates/oxc_linter/src/config/settings/react.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
1212
pub struct ReactPluginSettings {
1313
/// Components used as alternatives to `<form>` for forms, such as `<Formik>`.
1414
///
15-
/// ## Example
15+
/// Example:
1616
///
1717
/// ```jsonc
1818
/// {
@@ -35,7 +35,7 @@ pub struct ReactPluginSettings {
3535

3636
/// Components used as alternatives to `<a>` for linking, such as `<Link>`.
3737
///
38-
/// ## Example
38+
/// Example:
3939
///
4040
/// ```jsonc
4141
/// {

crates/oxc_linter/src/snapshots/schema_json.snap

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
source: crates/oxc_linter/src/lib.rs
33
expression: json
4+
snapshot_kind: text
45
---
56
{
67
"$schema": "http://json-schema.org/draft-07/schema#",
@@ -252,7 +253,7 @@ expression: json
252253
"type": "object",
253254
"properties": {
254255
"components": {
255-
"description": "To have your custom components be checked as DOM elements, you can provide a mapping of your component names to the DOM element name.\n\n## Example\n\n```json { \"settings\": { \"jsx-a11y\": { \"components\": { \"Link\": \"a\", \"IconButton\": \"button\" } } } } ```",
256+
"description": "To have your custom components be checked as DOM elements, you can provide a mapping of your component names to the DOM element name.\n\nExample:\n\n```json { \"settings\": { \"jsx-a11y\": { \"components\": { \"Link\": \"a\", \"IconButton\": \"button\" } } } } ```",
256257
"default": {},
257258
"type": "object",
258259
"additionalProperties": {
@@ -279,7 +280,7 @@ expression: json
279280
"type": "object",
280281
"properties": {
281282
"rootDir": {
282-
"description": "The root directory of the Next.js project.\n\nThis is particularly useful when you have a monorepo and your Next.js project is in a subfolder.\n\n## Example\n\n```json { \"settings\": { \"next\": { \"rootDir\": \"apps/dashboard/\" } } } ```",
283+
"description": "The root directory of the Next.js project.\n\nThis is particularly useful when you have a monorepo and your Next.js project is in a subfolder.\n\nExample:\n\n```json { \"settings\": { \"next\": { \"rootDir\": \"apps/dashboard/\" } } } ```",
283284
"default": [],
284285
"allOf": [
285286
{
@@ -396,7 +397,7 @@ expression: json
396397
},
397398
"OxlintSettings": {
398399
"title": "Oxlint Plugin Settings",
399-
"description": "Configure the behavior of linter plugins.\n\n## Example\n\nHere's an example if you're using Next.js in a monorepo:\n\n```json { \"settings\": { \"next\": { \"rootDir\": \"apps/dashboard/\" }, \"react\": { \"linkComponents\": [ { \"name\": \"Link\", \"linkAttribute\": \"to\" } ] }, \"jsx-a11y\": { \"components\": { \"Link\": \"a\", \"Button\": \"button\" } } } } ```",
400+
"description": "Configure the behavior of linter plugins.\n\nHere's an example if you're using Next.js in a monorepo:\n\n```json { \"settings\": { \"next\": { \"rootDir\": \"apps/dashboard/\" }, \"react\": { \"linkComponents\": [ { \"name\": \"Link\", \"linkAttribute\": \"to\" } ] }, \"jsx-a11y\": { \"components\": { \"Link\": \"a\", \"Button\": \"button\" } } } } ```",
400401
"type": "object",
401402
"properties": {
402403
"jsdoc": {
@@ -455,15 +456,15 @@ expression: json
455456
"type": "object",
456457
"properties": {
457458
"formComponents": {
458-
"description": "Components used as alternatives to `<form>` for forms, such as `<Formik>`.\n\n## Example\n\n```jsonc { \"settings\": { \"react\": { \"formComponents\": [ \"CustomForm\", // OtherForm is considered a form component and has an endpoint attribute { \"name\": \"OtherForm\", \"formAttribute\": \"endpoint\" }, // allows specifying multiple properties if necessary { \"name\": \"Form\", \"formAttribute\": [\"registerEndpoint\", \"loginEndpoint\"] } ] } } } ```",
459+
"description": "Components used as alternatives to `<form>` for forms, such as `<Formik>`.\n\nExample:\n\n```jsonc { \"settings\": { \"react\": { \"formComponents\": [ \"CustomForm\", // OtherForm is considered a form component and has an endpoint attribute { \"name\": \"OtherForm\", \"formAttribute\": \"endpoint\" }, // allows specifying multiple properties if necessary { \"name\": \"Form\", \"formAttribute\": [\"registerEndpoint\", \"loginEndpoint\"] } ] } } } ```",
459460
"default": [],
460461
"type": "array",
461462
"items": {
462463
"$ref": "#/definitions/CustomComponent"
463464
}
464465
},
465466
"linkComponents": {
466-
"description": "Components used as alternatives to `<a>` for linking, such as `<Link>`.\n\n## Example\n\n```jsonc { \"settings\": { \"react\": { \"linkComponents\": [ \"HyperLink\", // Use `linkAttribute` for components that use a different prop name // than `href`. { \"name\": \"MyLink\", \"linkAttribute\": \"to\" }, // allows specifying multiple properties if necessary { \"name\": \"Link\", \"linkAttribute\": [\"to\", \"href\"] } ] } } } ```",
467+
"description": "Components used as alternatives to `<a>` for linking, such as `<Link>`.\n\nExample:\n\n```jsonc { \"settings\": { \"react\": { \"linkComponents\": [ \"HyperLink\", // Use `linkAttribute` for components that use a different prop name // than `href`. { \"name\": \"MyLink\", \"linkAttribute\": \"to\" }, // allows specifying multiple properties if necessary { \"name\": \"Link\", \"linkAttribute\": [\"to\", \"href\"] } ] } } } ```",
467468
"default": [],
468469
"type": "array",
469470
"items": {

npm/oxlint/configuration_schema.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
"type": "object",
249249
"properties": {
250250
"components": {
251-
"description": "To have your custom components be checked as DOM elements, you can provide a mapping of your component names to the DOM element name.\n\n## Example\n\n```json { \"settings\": { \"jsx-a11y\": { \"components\": { \"Link\": \"a\", \"IconButton\": \"button\" } } } } ```",
251+
"description": "To have your custom components be checked as DOM elements, you can provide a mapping of your component names to the DOM element name.\n\nExample:\n\n```json { \"settings\": { \"jsx-a11y\": { \"components\": { \"Link\": \"a\", \"IconButton\": \"button\" } } } } ```",
252252
"default": {},
253253
"type": "object",
254254
"additionalProperties": {
@@ -275,7 +275,7 @@
275275
"type": "object",
276276
"properties": {
277277
"rootDir": {
278-
"description": "The root directory of the Next.js project.\n\nThis is particularly useful when you have a monorepo and your Next.js project is in a subfolder.\n\n## Example\n\n```json { \"settings\": { \"next\": { \"rootDir\": \"apps/dashboard/\" } } } ```",
278+
"description": "The root directory of the Next.js project.\n\nThis is particularly useful when you have a monorepo and your Next.js project is in a subfolder.\n\nExample:\n\n```json { \"settings\": { \"next\": { \"rootDir\": \"apps/dashboard/\" } } } ```",
279279
"default": [],
280280
"allOf": [
281281
{
@@ -392,7 +392,7 @@
392392
},
393393
"OxlintSettings": {
394394
"title": "Oxlint Plugin Settings",
395-
"description": "Configure the behavior of linter plugins.\n\n## Example\n\nHere's an example if you're using Next.js in a monorepo:\n\n```json { \"settings\": { \"next\": { \"rootDir\": \"apps/dashboard/\" }, \"react\": { \"linkComponents\": [ { \"name\": \"Link\", \"linkAttribute\": \"to\" } ] }, \"jsx-a11y\": { \"components\": { \"Link\": \"a\", \"Button\": \"button\" } } } } ```",
395+
"description": "Configure the behavior of linter plugins.\n\nHere's an example if you're using Next.js in a monorepo:\n\n```json { \"settings\": { \"next\": { \"rootDir\": \"apps/dashboard/\" }, \"react\": { \"linkComponents\": [ { \"name\": \"Link\", \"linkAttribute\": \"to\" } ] }, \"jsx-a11y\": { \"components\": { \"Link\": \"a\", \"Button\": \"button\" } } } } ```",
396396
"type": "object",
397397
"properties": {
398398
"jsdoc": {
@@ -451,15 +451,15 @@
451451
"type": "object",
452452
"properties": {
453453
"formComponents": {
454-
"description": "Components used as alternatives to `<form>` for forms, such as `<Formik>`.\n\n## Example\n\n```jsonc { \"settings\": { \"react\": { \"formComponents\": [ \"CustomForm\", // OtherForm is considered a form component and has an endpoint attribute { \"name\": \"OtherForm\", \"formAttribute\": \"endpoint\" }, // allows specifying multiple properties if necessary { \"name\": \"Form\", \"formAttribute\": [\"registerEndpoint\", \"loginEndpoint\"] } ] } } } ```",
454+
"description": "Components used as alternatives to `<form>` for forms, such as `<Formik>`.\n\nExample:\n\n```jsonc { \"settings\": { \"react\": { \"formComponents\": [ \"CustomForm\", // OtherForm is considered a form component and has an endpoint attribute { \"name\": \"OtherForm\", \"formAttribute\": \"endpoint\" }, // allows specifying multiple properties if necessary { \"name\": \"Form\", \"formAttribute\": [\"registerEndpoint\", \"loginEndpoint\"] } ] } } } ```",
455455
"default": [],
456456
"type": "array",
457457
"items": {
458458
"$ref": "#/definitions/CustomComponent"
459459
}
460460
},
461461
"linkComponents": {
462-
"description": "Components used as alternatives to `<a>` for linking, such as `<Link>`.\n\n## Example\n\n```jsonc { \"settings\": { \"react\": { \"linkComponents\": [ \"HyperLink\", // Use `linkAttribute` for components that use a different prop name // than `href`. { \"name\": \"MyLink\", \"linkAttribute\": \"to\" }, // allows specifying multiple properties if necessary { \"name\": \"Link\", \"linkAttribute\": [\"to\", \"href\"] } ] } } } ```",
462+
"description": "Components used as alternatives to `<a>` for linking, such as `<Link>`.\n\nExample:\n\n```jsonc { \"settings\": { \"react\": { \"linkComponents\": [ \"HyperLink\", // Use `linkAttribute` for components that use a different prop name // than `href`. { \"name\": \"MyLink\", \"linkAttribute\": \"to\" }, // allows specifying multiple properties if necessary { \"name\": \"Link\", \"linkAttribute\": [\"to\", \"href\"] } ] } } } ```",
463463
"default": [],
464464
"type": "array",
465465
"items": {

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
source: tasks/website/src/linter/json_schema.rs
33
expression: snapshot
4+
snapshot_kind: text
45
---
56
# Oxlint Configuration File
67

@@ -225,8 +226,6 @@ type: `object`
225226

226227
Configure the behavior of linter plugins.
227228

228-
## Example
229-
230229
Here's an example if you're using Next.js in a monorepo:
231230

232231
```json
@@ -352,7 +351,7 @@ default: `{}`
352351

353352
To have your custom components be checked as DOM elements, you can provide a mapping of your component names to the DOM element name.
354353

355-
## Example
354+
Example:
356355

357356
```json { "settings": { "jsx-a11y": { "components": { "Link": "a", "IconButton": "button" } } } } ```
358357

@@ -407,7 +406,7 @@ default: `[]`
407406

408407
Components used as alternatives to `<form>` for forms, such as `<Formik>`.
409408

410-
## Example
409+
Example:
411410

412411
```jsonc { "settings": { "react": { "formComponents": [ "CustomForm", // OtherForm is considered a form component and has an endpoint attribute { "name": "OtherForm", "formAttribute": "endpoint" }, // allows specifying multiple properties if necessary { "name": "Form", "formAttribute": ["registerEndpoint", "loginEndpoint"] } ] } } } ```
413412
@@ -427,7 +426,7 @@ default: `[]`
427426
428427
Components used as alternatives to `<a>` for linking, such as `<Link>`.
429428
430-
## Example
429+
Example:
431430
432431
```jsonc { "settings": { "react": { "linkComponents": [ "HyperLink", // Use `linkAttribute` for components that use a different prop name // than `href`. { "name": "MyLink", "linkAttribute": "to" }, // allows specifying multiple properties if necessary { "name": "Link", "linkAttribute": ["to", "href"] } ] } } } ```
433432

0 commit comments

Comments
 (0)