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
6 changes: 3 additions & 3 deletions .vitepress/data/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@
"value": "no-unused-vars",
"category": "correctness",
"type_aware": false,
"fix": "fixable_dangerous_suggestion",
"fix": "conditional_dangerous_fix_or_suggestion",
"default": true,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html"
},
Expand Down Expand Up @@ -1237,7 +1237,7 @@
"value": "no-useless-concat",
"category": "suspicious",
"type_aware": false,
"fix": "none",
"fix": "pending",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-useless-concat.html"
},
Expand Down Expand Up @@ -4792,7 +4792,7 @@
"value": "switch-exhaustiveness-check",
"category": "pedantic",
"type_aware": true,
"fix": "pending",
"fix": "conditional_suggestion",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/switch-exhaustiveness-check.html"
},
Expand Down
22 changes: 22 additions & 0 deletions src/docs/guide/usage/linter/generated-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,28 @@ type: `string`

Path or package name of the plugin

## options

type: `object`

Options for the linter.

### options.typeAware

type: `boolean`

Enable rules that require type information.

Equivalent to passing `--type-aware` on the CLI.

### options.typeCheck

type: `boolean`

Enable experimental type checking (includes TypeScript compiler diagnostics).

Equivalent to passing `--type-check` on the CLI.

## overrides

type: `array`
Expand Down
9 changes: 9 additions & 0 deletions src/docs/guide/usage/linter/rules/eslint/id-length.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ data["y"] = 3; // excused because of calculated property access

This rule accepts a configuration object with the following properties:

### checkGeneric

type: `boolean`

default: `true`

Whether to check TypeScript generic type parameter names.
Defaults to `true`.

### exceptionPatterns

type: `string[]`
Expand Down
42 changes: 41 additions & 1 deletion src/docs/guide/usage/linter/rules/eslint/no-unused-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "eslint/no-unused-vars"
category: "Correctness"
default: true
type_aware: false
fix: "fixable_dangerous_suggestion"
fix: "conditional_dangerous_fix_or_suggestion"
---

<!-- This file is auto-generated by tasks/website_linter/src/rules/doc_page.rs. Do not edit it manually. -->
Expand Down Expand Up @@ -289,6 +289,46 @@ foo.forEach((item) => {
});
```

### fix

type: `object`

default: `{"imports":"suggestion", "variables":"suggestion"}`

Fine-grained auto-fix controls for `no-unused-vars`.

#### fix.imports

type: `"off" | "suggestion" | "fix"`

##### `"off"`

Disable auto-fixes for this symbol kind.

##### `"suggestion"`

Emit suggestion-style fixes (current behavior).

##### `"fix"`

Emit fix-style fixes.

#### fix.variables

type: `"off" | "suggestion" | "fix"`

##### `"off"`

Disable auto-fixes for this symbol kind.

##### `"suggestion"`

Emit suggestion-style fixes (current behavior).

##### `"fix"`

Emit fix-style fixes.

### ignoreClassWithStaticInitBlock

type: `boolean`
Expand Down
9 changes: 3 additions & 6 deletions src/docs/guide/usage/linter/rules/eslint/no-useless-concat.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "eslint/no-useless-concat"
category: "Suspicious"
default: false
type_aware: false
fix: "none"
fix: "pending"
---

<!-- This file is auto-generated by tasks/website_linter/src/rules/doc_page.rs. Do not edit it manually. -->
Expand All @@ -17,7 +17,7 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin

### What it does

Disallow unnecessary concatenation of literals or template literals
Disallow unnecessary concatenation of literals or template literals.

### Why is this bad?

Expand All @@ -40,11 +40,8 @@ Examples of **correct** code for this rule:

```javascript
var foo = "a" + bar;
```

// when the string concatenation is multiline

```javascript
// When the string concatenation is multiline
var foo = "a" + "b" + "c";
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ simply delegates into its parent class.

::: warning
Caveat: This lint rule will report on constructors whose sole purpose
is to change visibility of a parent constructor. This is because the rule
does not have type information to determine if the parent constructor is
`public`, `protected`, or `private`.
is to change the visibility of a parent constructor, or to expose parameter
properties with modifiers. This is because the rule does not have type
information to determine if the parent constructor is `public`, `protected`,
or `private`.
:::

### Examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ var Hello = createReactClass({
});
```

## Configuration

This rule accepts one of the following string values:

type: `"allowed" | "disallow-in-func"`

## How to use

To **enable** this rule using the config file or in the CLI, you can use:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class C {
}
```

## Configuration

This rule accepts one of the following string values:

type: `"fields" | "getters"`

## How to use

To **enable** this rule using the config file or in the CLI, you can use:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "typescript/switch-exhaustiveness-check"
category: "Pedantic"
default: false
type_aware: true
fix: "pending"
fix: "conditional_suggestion"
---

<!-- This file is auto-generated by tasks/website_linter/src/rules/doc_page.rs. Do not edit it manually. -->
Expand Down
2 changes: 1 addition & 1 deletion src/docs/guide/usage/linter/rules/version.data.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
load() {
return "89c28356c7a2c6578059a434c92c534093a188dc";
return "8ec232e98d935a6980d8523aafa9c30b7e9e7b93";
},
};