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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .vitepress/data/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -4922,6 +4922,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/unicorn/consistent-function-scoping.html"
},
{
"scope": "unicorn",
"value": "custom-error-definition",
"category": "style",
"type_aware": false,
"fix": "pending",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/unicorn/custom-error-definition.html"
},
{
"scope": "unicorn",
"value": "empty-brace-spaces",
Expand Down Expand Up @@ -6092,6 +6101,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/vitest/prefer-import-in-mock.html"
},
{
"scope": "vitest",
"value": "prefer-strict-boolean-matchers",
"category": "style",
"type_aware": false,
"fix": "fixable_fix",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/vitest/prefer-strict-boolean-matchers.html"
},
{
"scope": "vitest",
"value": "prefer-to-be-falsy",
Expand Down
218 changes: 218 additions & 0 deletions src/docs/guide/usage/formatter/generated-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,115 @@ Whether to insert a final newline at the end of the file.
- Default: `true`
- Overrides `.editorconfig.insert_final_newline`

## jsdoc

type: `object`

Enable JSDoc comment formatting.

When enabled, JSDoc comments are normalized and reformatted:
tag aliases are canonicalized, descriptions are capitalized,
long lines are wrapped, and short comments are collapsed to single-line.

Pass an object (`jsdoc: {}`) to enable with defaults, or omit to disable.

- Default: Disabled

### jsdoc.addDefaultToDescription

type: `boolean`

Append default values to `@param` descriptions (e.g. "Default is `value`").

- Default: `true`

### jsdoc.bracketSpacing

type: `boolean`

Add spaces inside JSDoc type braces: `{string}` → `{ string }`.

- Default: `false`

### jsdoc.capitalizeDescriptions

type: `boolean`

Capitalize the first letter of tag descriptions.

- Default: `true`

### jsdoc.commentLineStrategy

type: `string`

How to format comment blocks.

- `"singleLine"` — Convert to single-line `/** content */` when possible.
- `"multiline"` — Always use multi-line format.
- `"keep"` — Preserve original formatting.

- Default: `"singleLine"`

### jsdoc.descriptionTag

type: `boolean`

Emit `@description` tag instead of inline description.

- Default: `false`

### jsdoc.descriptionWithDot

type: `boolean`

Add a trailing dot to the end of descriptions.

- Default: `false`

### jsdoc.keepUnparsableExampleIndent

type: `boolean`

Preserve indentation in unparsable `@example` code.

- Default: `false`

### jsdoc.lineWrappingStyle

type: `string`

Strategy for wrapping description lines at print width.

- `"greedy"` — Always re-wrap text to fit within print width.
- `"balance"` — Preserve original line breaks if all lines fit within print width.

- Default: `"greedy"`

### jsdoc.preferCodeFences

type: `boolean`

Use fenced code blocks (` ``` `) instead of 4-space indentation for code without a language tag.

- Default: `false`

### jsdoc.separateReturnsFromParam

type: `boolean`

Add a blank line between the last `@param` and `@returns`.

- Default: `false`

### jsdoc.separateTagGroups

type: `boolean`

Add blank lines between different tag groups (e.g. between `@param` and `@returns`).

- Default: `false`

## jsxSingleQuote

type: `boolean`
Expand Down Expand Up @@ -191,6 +300,115 @@ Whether to insert a final newline at the end of the file.
- Default: `true`
- Overrides `.editorconfig.insert_final_newline`

##### overrides[n].options.jsdoc

type: `object`

Enable JSDoc comment formatting.

When enabled, JSDoc comments are normalized and reformatted:
tag aliases are canonicalized, descriptions are capitalized,
long lines are wrapped, and short comments are collapsed to single-line.

Pass an object (`jsdoc: {}`) to enable with defaults, or omit to disable.

- Default: Disabled

###### overrides[n].options.jsdoc.addDefaultToDescription

type: `boolean`

Append default values to `@param` descriptions (e.g. "Default is `value`").

- Default: `true`

###### overrides[n].options.jsdoc.bracketSpacing

type: `boolean`

Add spaces inside JSDoc type braces: `{string}` → `{ string }`.

- Default: `false`

###### overrides[n].options.jsdoc.capitalizeDescriptions

type: `boolean`

Capitalize the first letter of tag descriptions.

- Default: `true`

###### overrides[n].options.jsdoc.commentLineStrategy

type: `string`

How to format comment blocks.

- `"singleLine"` — Convert to single-line `/** content */` when possible.
- `"multiline"` — Always use multi-line format.
- `"keep"` — Preserve original formatting.

- Default: `"singleLine"`

###### overrides[n].options.jsdoc.descriptionTag

type: `boolean`

Emit `@description` tag instead of inline description.

- Default: `false`

###### overrides[n].options.jsdoc.descriptionWithDot

type: `boolean`

Add a trailing dot to the end of descriptions.

- Default: `false`

###### overrides[n].options.jsdoc.keepUnparsableExampleIndent

type: `boolean`

Preserve indentation in unparsable `@example` code.

- Default: `false`

###### overrides[n].options.jsdoc.lineWrappingStyle

type: `string`

Strategy for wrapping description lines at print width.

- `"greedy"` — Always re-wrap text to fit within print width.
- `"balance"` — Preserve original line breaks if all lines fit within print width.

- Default: `"greedy"`

###### overrides[n].options.jsdoc.preferCodeFences

type: `boolean`

Use fenced code blocks (` ``` `) instead of 4-space indentation for code without a language tag.

- Default: `false`

###### overrides[n].options.jsdoc.separateReturnsFromParam

type: `boolean`

Add a blank line between the last `@param` and `@returns`.

- Default: `false`

###### overrides[n].options.jsdoc.separateTagGroups

type: `boolean`

Add blank lines between different tag groups (e.g. between `@param` and `@returns`).

- Default: `false`

##### overrides[n].options.jsxSingleQuote

type: `boolean`
Expand Down
20 changes: 2 additions & 18 deletions src/docs/guide/usage/linter/rules/eslint/accessor-pairs.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,8 @@ Report a setter without a getter.

## How to use

To **enable** this rule using the config file or in the CLI, you can use:

::: code-group

```json [Config (.oxlintrc.json)]
{
"rules": {
"accessor-pairs": "error"
}
}
```

```bash [CLI]
oxlint --deny accessor-pairs
```

:::
<RuleHowToUse />

## References

- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>
<RuleReferences />
20 changes: 2 additions & 18 deletions src/docs/guide/usage/linter/rules/eslint/array-callback-return.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,8 @@ When set to true, rule will also report forEach callbacks that return a value.

## How to use

To **enable** this rule using the config file or in the CLI, you can use:

::: code-group

```json [Config (.oxlintrc.json)]
{
"rules": {
"array-callback-return": "error"
}
}
```

```bash [CLI]
oxlint --deny array-callback-return
```

:::
<RuleHowToUse />

## References

- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>
<RuleReferences />
20 changes: 2 additions & 18 deletions src/docs/guide/usage/linter/rules/eslint/arrow-body-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,8 @@ default: `false`

## How to use

To **enable** this rule using the config file or in the CLI, you can use:

::: code-group

```json [Config (.oxlintrc.json)]
{
"rules": {
"arrow-body-style": "error"
}
}
```

```bash [CLI]
oxlint --deny arrow-body-style
```

:::
<RuleHowToUse />

## References

- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>
<RuleReferences />
20 changes: 2 additions & 18 deletions src/docs/guide/usage/linter/rules/eslint/block-scoped-var.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,8 @@ function doTry() {

## How to use

To **enable** this rule using the config file or in the CLI, you can use:

::: code-group

```json [Config (.oxlintrc.json)]
{
"rules": {
"block-scoped-var": "error"
}
}
```

```bash [CLI]
oxlint --deny block-scoped-var
```

:::
<RuleHowToUse />

## References

- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>
<RuleReferences />
20 changes: 2 additions & 18 deletions src/docs/guide/usage/linter/rules/eslint/capitalized-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,8 @@ A regex pattern. Comments that match the pattern will not cause violations.

## How to use

To **enable** this rule using the config file or in the CLI, you can use:

::: code-group

```json [Config (.oxlintrc.json)]
{
"rules": {
"capitalized-comments": "error"
}
}
```

```bash [CLI]
oxlint --deny capitalized-comments
```

:::
<RuleHowToUse />

## References

- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>
<RuleReferences />
Loading
Loading