From d68f1abf6939371f77bb3a7f091ebd94b6fc225d Mon Sep 17 00:00:00 2001 From: oxc-bot <176400334+oxc-bot@users.noreply.github.com> Date: Thu, 11 Sep 2025 09:31:12 +0000 Subject: [PATCH] Release 1.15.0 --- .../guide/usage/linter/generated-rules.md | 21 +-- .../linter/rules/eslint/block-scoped-var.md | 69 +++++++++- .../linter/rules/eslint/default-case-last.md | 31 ++++- .../usage/linter/rules/eslint/default-case.md | 69 +++++----- .../linter/rules/eslint/default-param-last.md | 44 ++++++- .../linter/rules/eslint/for-direction.md | 23 ++-- .../linter/rules/promise/no-return-wrap.md | 7 +- .../linter/rules/typescript/await-thenable.md | 3 + .../rules/typescript/no-array-delete.md | 3 + .../rules/typescript/no-base-to-string.md | 3 + .../no-confusing-void-expression.md | 6 +- .../no-duplicate-type-constituents.md | 3 + .../rules/typescript/no-floating-promises.md | 3 + .../rules/typescript/no-for-in-array.md | 3 + .../rules/typescript/no-implied-eval.md | 3 + .../no-meaningless-void-operator.md | 3 + .../rules/typescript/no-misused-promises.md | 3 + .../rules/typescript/no-misused-spread.md | 3 + .../linter/rules/typescript/no-mixed-enums.md | 3 + .../no-non-null-asserted-optional-chain.md | 2 +- .../no-redundant-type-constituents.md | 3 + .../no-unnecessary-boolean-literal-compare.md | 3 + .../no-unnecessary-template-expression.md | 3 + .../no-unnecessary-type-arguments.md | 3 + .../no-unnecessary-type-assertion.md | 3 + .../rules/typescript/no-unsafe-argument.md | 3 + .../rules/typescript/no-unsafe-assignment.md | 3 + .../linter/rules/typescript/no-unsafe-call.md | 3 + .../typescript/no-unsafe-enum-comparison.md | 3 + .../typescript/no-unsafe-member-access.md | 3 + .../rules/typescript/no-unsafe-return.md | 3 + .../typescript/no-unsafe-type-assertion.md | 3 + .../rules/typescript/no-unsafe-unary-minus.md | 3 + .../non-nullable-type-assertion-style.md | 3 + .../rules/typescript/only-throw-error.md | 3 + .../prefer-promise-reject-errors.md | 3 + .../prefer-reduce-type-parameter.md | 3 + .../typescript/prefer-return-this-type.md | 3 + .../typescript/promise-function-async.md | 3 + .../typescript/related-getter-setter-pairs.md | 3 + .../typescript/require-array-sort-compare.md | 3 + .../linter/rules/typescript/require-await.md | 3 + .../typescript/restrict-plus-operands.md | 3 + .../restrict-template-expressions.md | 3 + .../linter/rules/typescript/return-await.md | 3 + .../typescript/switch-exhaustiveness-check.md | 3 + .../linter/rules/typescript/unbound-method.md | 3 + .../use-unknown-in-catch-callback-variable.md | 3 + .../linter/rules/unicorn/no-array-reverse.md | 76 +++++++++++ .../guide/usage/linter/rules/version.data.js | 2 +- .../rules/vue/define-emits-declaration.md | 121 +++++++++++++++++ .../rules/vue/define-props-declaration.md | 88 +++++++++++++ .../linter/rules/vue/no-multiple-slot-args.md | 80 ++++++++++++ .../linter/rules/vue/valid-define-props.md | 122 ++++++++++++++++++ 54 files changed, 802 insertions(+), 76 deletions(-) create mode 100644 src/docs/guide/usage/linter/rules/unicorn/no-array-reverse.md create mode 100644 src/docs/guide/usage/linter/rules/vue/define-emits-declaration.md create mode 100644 src/docs/guide/usage/linter/rules/vue/define-props-declaration.md create mode 100644 src/docs/guide/usage/linter/rules/vue/no-multiple-slot-args.md create mode 100644 src/docs/guide/usage/linter/rules/vue/valid-define-props.md diff --git a/src/docs/guide/usage/linter/generated-rules.md b/src/docs/guide/usage/linter/generated-rules.md index 3c9a87f69c9..6878639abe6 100644 --- a/src/docs/guide/usage/linter/generated-rules.md +++ b/src/docs/guide/usage/linter/generated-rules.md @@ -2,8 +2,8 @@ The progress of all rule implementations is tracked [here](https://github.com/oxc-project/oxc/issues/481). -- Total number of rules: 574 -- Rules turned on by default: 103 +- Total number of rules: 579 +- Rules turned on by default: 102 **Legend for 'Fixable?' column:** @@ -174,7 +174,6 @@ Code that is outright wrong or useless. | [await-thenable](/docs/guide/usage/linter/rules/typescript/await-thenable.html) | typescript | βœ… | 🚧 | | [no-array-delete](/docs/guide/usage/linter/rules/typescript/no-array-delete.html) | typescript | βœ… | 🚧 | | [no-base-to-string](/docs/guide/usage/linter/rules/typescript/no-base-to-string.html) | typescript | βœ… | 🚧 | -| [no-confusing-void-expression](/docs/guide/usage/linter/rules/typescript/no-confusing-void-expression.html) | typescript | βœ… | 🚧 | | [no-duplicate-enum-values](/docs/guide/usage/linter/rules/typescript/no-duplicate-enum-values.html) | typescript | βœ… | | | [no-duplicate-type-constituents](/docs/guide/usage/linter/rules/typescript/no-duplicate-type-constituents.html) | typescript | βœ… | 🚧 | | [no-extra-non-null-assertion](/docs/guide/usage/linter/rules/typescript/no-extra-non-null-assertion.html) | typescript | βœ… | | @@ -184,7 +183,7 @@ Code that is outright wrong or useless. | [no-meaningless-void-operator](/docs/guide/usage/linter/rules/typescript/no-meaningless-void-operator.html) | typescript | βœ… | 🚧 | | [no-misused-new](/docs/guide/usage/linter/rules/typescript/no-misused-new.html) | typescript | βœ… | | | [no-misused-spread](/docs/guide/usage/linter/rules/typescript/no-misused-spread.html) | typescript | βœ… | 🚧 | -| [no-non-null-asserted-optional-chain](/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-optional-chain.html) | typescript | βœ… | πŸ› οΈ | +| [no-non-null-asserted-optional-chain](/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-optional-chain.html) | typescript | βœ… | πŸ’‘ | | [no-redundant-type-constituents](/docs/guide/usage/linter/rules/typescript/no-redundant-type-constituents.html) | typescript | βœ… | 🚧 | | [no-this-alias](/docs/guide/usage/linter/rules/typescript/no-this-alias.html) | typescript | βœ… | | | [no-unnecessary-parameter-property-assignment](/docs/guide/usage/linter/rules/typescript/no-unnecessary-parameter-property-assignment.html) | typescript | βœ… | πŸ’‘ | @@ -213,6 +212,7 @@ Code that is outright wrong or useless. | [no-conditional-tests](/docs/guide/usage/linter/rules/vitest/no-conditional-tests.html) | vitest | | | | [require-local-test-context-for-concurrent-snapshots](/docs/guide/usage/linter/rules/vitest/require-local-test-context-for-concurrent-snapshots.html) | vitest | | 🚧 | | [valid-define-emits](/docs/guide/usage/linter/rules/vue/valid-define-emits.html) | vue | | 🚧 | +| [valid-define-props](/docs/guide/usage/linter/rules/vue/valid-define-props.html) | vue | | 🚧 | ## Perf (11): @@ -232,7 +232,7 @@ Code that can be written to run faster. | [prefer-array-flat-map](/docs/guide/usage/linter/rules/unicorn/prefer-array-flat-map.html) | unicorn | | πŸ› οΈ | | [prefer-set-has](/docs/guide/usage/linter/rules/unicorn/prefer-set-has.html) | unicorn | | βš οΈπŸ› οΈοΈ | -## Restriction (70): +## Restriction (71): Lints which prevent the use of language and library features. Must not be enabled as a whole, should be considered on a case-by-case basis before enabling. @@ -308,8 +308,9 @@ Lints which prevent the use of language and library features. Must not be enable | [prefer-modern-math-apis](/docs/guide/usage/linter/rules/unicorn/prefer-modern-math-apis.html) | unicorn | | 🚧 | | [prefer-node-protocol](/docs/guide/usage/linter/rules/unicorn/prefer-node-protocol.html) | unicorn | | πŸ› οΈ | | [prefer-number-properties](/docs/guide/usage/linter/rules/unicorn/prefer-number-properties.html) | unicorn | | βš οΈπŸ› οΈοΈ | +| [no-multiple-slot-args](/docs/guide/usage/linter/rules/vue/no-multiple-slot-args.html) | vue | | 🚧 | -## Suspicious (40): +## Suspicious (41): code that is most likely wrong or useless. @@ -352,11 +353,12 @@ code that is most likely wrong or useless. | [no-unsafe-type-assertion](/docs/guide/usage/linter/rules/typescript/no-unsafe-type-assertion.html) | typescript | | 🚧 | | [consistent-function-scoping](/docs/guide/usage/linter/rules/unicorn/consistent-function-scoping.html) | unicorn | | 🚧 | | [no-accessor-recursion](/docs/guide/usage/linter/rules/unicorn/no-accessor-recursion.html) | unicorn | | | +| [no-array-reverse](/docs/guide/usage/linter/rules/unicorn/no-array-reverse.html) | unicorn | | πŸ› οΈ | | [no-instanceof-builtins](/docs/guide/usage/linter/rules/unicorn/no-instanceof-builtins.html) | unicorn | | 🚧 | | [prefer-add-event-listener](/docs/guide/usage/linter/rules/unicorn/prefer-add-event-listener.html) | unicorn | | 🚧 | | [require-post-message-target-origin](/docs/guide/usage/linter/rules/unicorn/require-post-message-target-origin.html) | unicorn | | πŸ’‘ | -## Pedantic (96): +## Pedantic (97): Lints which are rather strict or have occasional false positives. @@ -402,6 +404,7 @@ Lints which are rather strict or have occasional false positives. | [rules-of-hooks](/docs/guide/usage/linter/rules/react/rules-of-hooks.html) | react | | | | [ban-ts-comment](/docs/guide/usage/linter/rules/typescript/ban-ts-comment.html) | typescript | | πŸ› οΈ | | [ban-types](/docs/guide/usage/linter/rules/typescript/ban-types.html) | typescript | | 🚧 | +| [no-confusing-void-expression](/docs/guide/usage/linter/rules/typescript/no-confusing-void-expression.html) | typescript | | 🚧 | | [no-misused-promises](/docs/guide/usage/linter/rules/typescript/no-misused-promises.html) | typescript | | 🚧 | | [no-mixed-enums](/docs/guide/usage/linter/rules/typescript/no-mixed-enums.html) | typescript | | 🚧 | | [no-unsafe-argument](/docs/guide/usage/linter/rules/typescript/no-unsafe-argument.html) | typescript | | 🚧 | @@ -459,7 +462,7 @@ Lints which are rather strict or have occasional false positives. | [prefer-type-error](/docs/guide/usage/linter/rules/unicorn/prefer-type-error.html) | unicorn | | πŸ› οΈ | | [require-number-to-fixed-digits-argument](/docs/guide/usage/linter/rules/unicorn/require-number-to-fixed-digits-argument.html) | unicorn | | πŸ› οΈ | -## Style (155): +## Style (157): Code that should be written in a more idiomatic way. @@ -620,6 +623,8 @@ Code that should be written in a more idiomatic way. | [prefer-to-be-falsy](/docs/guide/usage/linter/rules/vitest/prefer-to-be-falsy.html) | vitest | | πŸ› οΈ | | [prefer-to-be-object](/docs/guide/usage/linter/rules/vitest/prefer-to-be-object.html) | vitest | | πŸ› οΈ | | [prefer-to-be-truthy](/docs/guide/usage/linter/rules/vitest/prefer-to-be-truthy.html) | vitest | | πŸ› οΈ | +| [define-emits-declaration](/docs/guide/usage/linter/rules/vue/define-emits-declaration.html) | vue | | 🚧 | +| [define-props-declaration](/docs/guide/usage/linter/rules/vue/define-props-declaration.html) | vue | | | ## Nursery (8): diff --git a/src/docs/guide/usage/linter/rules/eslint/block-scoped-var.md b/src/docs/guide/usage/linter/rules/eslint/block-scoped-var.md index f4e8640c3e2..9e2733c7ece 100644 --- a/src/docs/guide/usage/linter/rules/eslint/block-scoped-var.md +++ b/src/docs/guide/usage/linter/rules/eslint/block-scoped-var.md @@ -12,31 +12,63 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin ### What it does -Generates warnings when variables are used outside of the block in which they were defined. -This emulates C-style block scope. +Enforces that variables are both **declared** and **used** within the same block scope. +This rule prevents accidental use of variables outside their intended block, mimicking C-style block scoping in JavaScript. ### Why is this bad? -This rule aims to reduce the usage of variables outside of their binding context -and emulate traditional block scope from other languages. -This is to help newcomers to the language avoid difficult bugs with variable hoisting. +JavaScript’s `var` declarations are hoisted to the top of their enclosing function, which can cause variables declared in a block (e.g., inside an `if` or `for`) to be accessible outside of it. +This can lead to hard-to-find bugs. +By enforcing block scoping, this rule helps avoid hoisting issues and aligns more closely with how other languages treat block variables. + +### Options + +No options available for this rule. ### Examples Examples of **incorrect** code for this rule: ```js +/* block-scoped-var: "error" */ + function doIf() { if (true) { var build = true; } console.log(build); } + +function doLoop() { + for (var i = 0; i < 10; i++) { + // do something + } + console.log(i); // i is accessible here +} + +function doSomething() { + if (true) { + var foo = 1; + } + if (false) { + foo = 2; + } +} + +function doTry() { + try { + var foo = 1; + } catch (e) { + console.log(foo); + } +} ``` Examples of **correct** code for this rule: ```js +/* block-scoped-var: "error" */ + function doIf() { var build; if (true) { @@ -44,6 +76,33 @@ function doIf() { } console.log(build); } + +function doLoop() { + var i; + for (i = 0; i < 10; i++) { + // do something + } + console.log(i); +} + +function doSomething() { + var foo; + if (true) { + foo = 1; + } + if (false) { + foo = 2; + } +} + +function doTry() { + var foo; + try { + foo = 1; + } catch (e) { + console.log(foo); + } +} ``` ## How to use diff --git a/src/docs/guide/usage/linter/rules/eslint/default-case-last.md b/src/docs/guide/usage/linter/rules/eslint/default-case-last.md index 5676c992cd6..a99a35e8c0e 100644 --- a/src/docs/guide/usage/linter/rules/eslint/default-case-last.md +++ b/src/docs/guide/usage/linter/rules/eslint/default-case-last.md @@ -12,20 +12,25 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin ### What it does -Enforce default clauses in switch statements to be last +Requires the `default` clause in `switch` statements to be the last one. ### Why is this bad? -A switch statement can optionally have a default clause. -If present, it’s usually the last clause, but it doesn’t need to be. It is also allowed to put the default clause before all case clauses, or anywhere between. The behavior is mostly the same as if it was the last clause. The default block will be still executed only if there is no match in the case clauses (including those defined after the default), but there is also the ability to β€œfall through” from the default clause to the following clause in the list. However, such flow is not common and it would be confusing to the readers. -Even if there is no β€œfall through” logic, it’s still unexpected to see the default clause before or between the case clauses. By convention, it is expected to be the last clause. -If a switch statement should have a default clause, it’s considered a best practice to define it as the last clause. +By convention and for readability, the `default` clause should be the last one in a `switch`. +While it is legal to place it before or between `case` clauses, doing so is confusing and may +lead to unexpected "fall-through" behavior. + +### Options + +No options available for this rule ### Examples Examples of **incorrect** code for this rule: -```javascript +```js +/* default-case-last: "error" */ + switch (foo) { default: bar(); @@ -50,7 +55,9 @@ switch (foo) { Examples of **correct** code for this rule: -```javascript +```js +/* default-case-last: "error" */ + switch (foo) { case 1: bar(); @@ -62,6 +69,16 @@ switch (foo) { baz(); break; } + +switch (foo) { + case "x": + bar(); + break; + case "y": + default: + baz(); + break; +} ``` ## How to use diff --git a/src/docs/guide/usage/linter/rules/eslint/default-case.md b/src/docs/guide/usage/linter/rules/eslint/default-case.md index cdc8532e127..dc848ad44c0 100644 --- a/src/docs/guide/usage/linter/rules/eslint/default-case.md +++ b/src/docs/guide/usage/linter/rules/eslint/default-case.md @@ -12,23 +12,39 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin ### What it does -Require default cases in switch statements +Enforces that all `switch` statements include a `default` case, +unless explicitly marked with a configured comment. ### Why is this bad? -Some code conventions require that all switch statements have a default case, -even if the default case is empty. The thinking is that it’s better to always -explicitly state what the default behavior should be so that it’s clear -whether or not the developer forgot to include the default behavior by mistake. +Without a `default` case, it is unclear whether the omission was +intentional or an oversight. Adding a `default` or a special comment +makes the code more explicit and reduces mistakes. You may optionally include a `// no default` after the last case if there is no default case. The comment may be in any desired case, such as `// No Default`. -### Examples +### Options + +First option: + +- Type: `object` +- Properties: + - `commentPattern`: `string` (default: `/^no default$/i`) - A regex pattern used to detect comments that mark the absence of a `default` case as intentional. + +Example configuration: + +```json +{ + "default-case": ["error", { "commentPattern": "^skip\\sdefault" }] +} +``` Examples of **incorrect** code for this rule: -```javascript +```js +/* default-case: ["error"] */ + switch (foo) { case 1: break; @@ -37,56 +53,45 @@ switch (foo) { Examples of **correct** code for this rule: -```javascript +```js +/* default-case: ["error"] */ + switch (a) { case 1: - /* code */ break; - default: - /* code */ break; } -``` -```javascript switch (a) { case 1: - /* code */ break; - // no default } ``` -```javascript +#### `commentPattern` + +Examples of **incorrect** code for this rule with the `{ "commentPattern": "^skip\\sdefault" }` option: + +```js +/* default-case: ["error", { "commentPattern": "^skip\\sdefault" }] */ + switch (a) { case 1: - /* code */ break; - - // No Default + // no default } ``` -### Options - -#### commentPattern - -`{ type: string, default: "/^no default$/i" }` +Examples of **correct** code for this rule with the `{ "commentPattern": "^skip\\sdefault" }` option: -This option is for specifying an alternative regular expression which -will override the default `/^no default$/i` comment test pattern. +```js +/* default-case: ["error", { "commentPattern": "^skip\\sdefault" }] */ -For example if `{ "commentPattern": "^skip\\sdefault" }` were used -then the following example would not violate the rule: - -```javascript switch (a) { case 1: - /* code */ break; - // skip default } ``` diff --git a/src/docs/guide/usage/linter/rules/eslint/default-param-last.md b/src/docs/guide/usage/linter/rules/eslint/default-param-last.md index 6ca3bb517e9..bf961bc017e 100644 --- a/src/docs/guide/usage/linter/rules/eslint/default-param-last.md +++ b/src/docs/guide/usage/linter/rules/eslint/default-param-last.md @@ -12,29 +12,63 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin ### What it does -Enforce default parameters to be last +Requires default parameters in functions to be the last ones. ### Why is this bad? -Putting default parameter at last allows function calls to omit optional tail arguments. +Placing default parameters last allows function calls to omit optional trailing arguments, +which improves readability and consistency. This rule applies equally to JavaScript and +TypeScript functions. + +### Options + +No options available for this rule ### Examples Examples of **incorrect** code for this rule: -```javascript -// Incorrect: optional argument can **not** be omitted +```js +/* default-param-last: "error" */ + +function f(a = 0, b) {} +function f(a, b = 0, c) {} function createUser(isAdmin = false, id) {} createUser(undefined, "tabby"); ``` Examples of **correct** code for this rule: -```javascript +```js +/* default-param-last: "error" */ + +function f(a, b = 0) {} +function f(a = 0, b = 0) {} function createUser(id, isAdmin = false) {} createUser("tabby"); ``` +Examples of **incorrect** TypeScript code for this rule: + +```ts +/* default-param-last: "error" */ + +function greet(message: string = "Hello", name: string) {} +function combine(a: number = 1, b: number, c: number) {} +function combine(a: number, b: number = 2, c: number) {} +function combine(a: number = 1, b?: number, c: number) {} +``` + +Examples of **correct** TypeScript code for this rule: + +```ts +/* default-param-last: "error" */ + +function greet(name: string, message: string = "Hello") {} +function combine(a: number, b: number = 2, c: number = 3) {} +function combine(a: number, b?: number, c: number = 3) {} +``` + ## How to use To **enable** this rule in the CLI or using the config file, you can use: diff --git a/src/docs/guide/usage/linter/rules/eslint/for-direction.md b/src/docs/guide/usage/linter/rules/eslint/for-direction.md index 9f3769b1082..3484cad5d86 100644 --- a/src/docs/guide/usage/linter/rules/eslint/for-direction.md +++ b/src/docs/guide/usage/linter/rules/eslint/for-direction.md @@ -18,27 +18,26 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin ### What it does -Disallow `for` loop update causing the counter to move in the wrong direction. +Disallow `for` loops where the update clause moves the counter in the wrong +direction, preventing the loop from reaching its stop condition. ### Why is this bad? -A `for` loop with a stop condition that can never be reached, such as one -with a counter that moves in the wrong direction, will run infinitely. -While there are occasions when an infinite loop is intended, the -convention is to construct such loops as `while` loops. More typically, an -infinite `for` loop is a bug. +A `for` loop with a stop condition that can never be reached will run +infinitely. While infinite loops can be intentional, they are usually written +as `while` loops. More often, an infinite `for` loop is a bug. -This rule forbids `for` loops where the counter variable changes in such a -way that the stop condition will never be met. For example, if the -counter variable is increasing (i.e. `i++`) and the stop condition tests -that the counter is greater than zero (`i >= 0`) then the loop will never -exit. +### Options + +No options available for this rule. ### Examples Examples of **incorrect** code for this rule: ```js +/* eslint for-direction: "error" */ + for (var i = 0; i < 10; i--) { } @@ -59,6 +58,8 @@ for (let i = 0; i < 10; i += n) { Examples of **correct** code for this rule: ```js +/* eslint for-direction: "error" */ + for (var i = 0; i < 10; i++) { } diff --git a/src/docs/guide/usage/linter/rules/promise/no-return-wrap.md b/src/docs/guide/usage/linter/rules/promise/no-return-wrap.md index f26bda8de70..73d4d37f058 100644 --- a/src/docs/guide/usage/linter/rules/promise/no-return-wrap.md +++ b/src/docs/guide/usage/linter/rules/promise/no-return-wrap.md @@ -30,11 +30,12 @@ There is an option to turn off the enforcing of 2, see the options section below ### Why is this bad? -It is unnecessary to use `Promise.resolve` and Promise.reject`for converting raw values -to promises in the return statements of`then`and`catch`callbacks. Using these +It is unnecessary to use `Promise.resolve` and `Promise.reject` for converting raw values +to promises in the return statements of `then` and `catch` callbacks. Using these operations to convert raw values to promises is unnecessary as simply returning the raw value for the success case and throwing the raw error value in the failure case have the -same effect. This is why some take the opinion that returning values such as`Promise.resolve(1)`or`Promise.reject(err)` is syntactic noise. +same effect. This is why some take the opinion that returning values such as +`Promise.resolve(1)` or `Promise.reject(err)` is syntactic noise. ### Examples diff --git a/src/docs/guide/usage/linter/rules/typescript/await-thenable.md b/src/docs/guide/usage/linter/rules/typescript/await-thenable.md index 40c729d0365..8b2d132bbe7 100644 --- a/src/docs/guide/usage/linter/rules/typescript/await-thenable.md +++ b/src/docs/guide/usage/linter/rules/typescript/await-thenable.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-array-delete.md b/src/docs/guide/usage/linter/rules/typescript/no-array-delete.md index ae609f28fe1..a2556ab2818 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-array-delete.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-array-delete.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-base-to-string.md b/src/docs/guide/usage/linter/rules/typescript/no-base-to-string.md index aa56a2d8860..a2b2a8936d8 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-base-to-string.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-base-to-string.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-confusing-void-expression.md b/src/docs/guide/usage/linter/rules/typescript/no-confusing-void-expression.md index 4621f8e541f..12a5fd0d36b 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-confusing-void-expression.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-confusing-void-expression.md @@ -5,11 +5,11 @@ import { data } from '../version.data.js'; const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_linter/src/rules/typescript/no_confusing_void_expression.rs`; -# typescript/no-confusing-void-expression +# typescript/no-confusing-void-expression
- -βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-duplicate-type-constituents.md b/src/docs/guide/usage/linter/rules/typescript/no-duplicate-type-constituents.md index a2246ffb017..61a1f3bf6ac 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-duplicate-type-constituents.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-duplicate-type-constituents.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-floating-promises.md b/src/docs/guide/usage/linter/rules/typescript/no-floating-promises.md index c80fd51f243..a42e581a125 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-floating-promises.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-floating-promises.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-for-in-array.md b/src/docs/guide/usage/linter/rules/typescript/no-for-in-array.md index ef91ab3747e..141703ffd11 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-for-in-array.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-for-in-array.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-implied-eval.md b/src/docs/guide/usage/linter/rules/typescript/no-implied-eval.md index 6e4d4977967..08ef08b9f01 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-implied-eval.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-implied-eval.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-meaningless-void-operator.md b/src/docs/guide/usage/linter/rules/typescript/no-meaningless-void-operator.md index 4937be305a9..8786c001940 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-meaningless-void-operator.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-meaningless-void-operator.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-misused-promises.md b/src/docs/guide/usage/linter/rules/typescript/no-misused-promises.md index 3499dbbcb9d..4ff43be020d 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-misused-promises.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-misused-promises.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-misused-promises
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-misused-spread.md b/src/docs/guide/usage/linter/rules/typescript/no-misused-spread.md index 0e37eb1dc3a..d989def5789 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-misused-spread.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-misused-spread.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-mixed-enums.md b/src/docs/guide/usage/linter/rules/typescript/no-mixed-enums.md index 53148811514..b2e337e96ff 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-mixed-enums.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-mixed-enums.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-mixed-enums
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-optional-chain.md b/src/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-optional-chain.md index 96393d6f85a..1fc85088c8e 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-optional-chain.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-optional-chain.md @@ -12,7 +12,7 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. -πŸ› οΈ An auto-fix is available for this rule. +πŸ’‘ A suggestion is available for this rule.
diff --git a/src/docs/guide/usage/linter/rules/typescript/no-redundant-type-constituents.md b/src/docs/guide/usage/linter/rules/typescript/no-redundant-type-constituents.md index 233392252f1..ccea3021057 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-redundant-type-constituents.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-redundant-type-constituents.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-boolean-literal-compare.md b/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-boolean-literal-compare.md index 26d5b8be3ef..547464ec0b2 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-boolean-literal-compare.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-boolean-literal-compare.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unnecessary-boolean-literal-compare
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-template-expression.md b/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-template-expression.md index 6c7b705c2ce..c2428cbe397 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-template-expression.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-template-expression.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unnecessary-template-expression
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-arguments.md b/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-arguments.md index 8bba3d8a083..c24c89d7662 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-arguments.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-arguments.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unnecessary-type-arguments
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-assertion.md b/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-assertion.md index 54190e7dad4..51d7ff0484c 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-assertion.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-assertion.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unnecessary-type-assertion
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-argument.md b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-argument.md index 227793c4e46..155bc315c45 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-argument.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-argument.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unsafe-argument
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-assignment.md b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-assignment.md index 94a0757f8a9..a94695c992d 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-assignment.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-assignment.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unsafe-assignment
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-call.md b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-call.md index a54a82cd771..81acbe6af13 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-call.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-call.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unsafe-call
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-enum-comparison.md b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-enum-comparison.md index 5cd0f5b69ae..ba99919e557 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-enum-comparison.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-enum-comparison.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unsafe-enum-comparison
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-member-access.md b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-member-access.md index d195aa909d4..53517ae6ef3 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-member-access.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-member-access.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unsafe-member-access
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-return.md b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-return.md index f9c19aee35a..5d7c20ebb19 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-return.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-return.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unsafe-return
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-type-assertion.md b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-type-assertion.md index ccd2ba47397..75f5f0831fb 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-type-assertion.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-type-assertion.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/no-unsafe-type-assertion
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-unary-minus.md b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-unary-minus.md index 87099a27dee..5299d0d8ebd 100644 --- a/src/docs/guide/usage/linter/rules/typescript/no-unsafe-unary-minus.md +++ b/src/docs/guide/usage/linter/rules/typescript/no-unsafe-unary-minus.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/non-nullable-type-assertion-style.md b/src/docs/guide/usage/linter/rules/typescript/non-nullable-type-assertion-style.md index 83744b9ecc3..076da954753 100644 --- a/src/docs/guide/usage/linter/rules/typescript/non-nullable-type-assertion-style.md +++ b/src/docs/guide/usage/linter/rules/typescript/non-nullable-type-assertion-style.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/non-nullable-type-assertion-style
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/only-throw-error.md b/src/docs/guide/usage/linter/rules/typescript/only-throw-error.md index 0f0b62921db..1d7a92e594e 100644 --- a/src/docs/guide/usage/linter/rules/typescript/only-throw-error.md +++ b/src/docs/guide/usage/linter/rules/typescript/only-throw-error.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/only-throw-error
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/prefer-promise-reject-errors.md b/src/docs/guide/usage/linter/rules/typescript/prefer-promise-reject-errors.md index 05eacfebcf4..6d6f9797a4b 100644 --- a/src/docs/guide/usage/linter/rules/typescript/prefer-promise-reject-errors.md +++ b/src/docs/guide/usage/linter/rules/typescript/prefer-promise-reject-errors.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/prefer-promise-reject-errors
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/prefer-reduce-type-parameter.md b/src/docs/guide/usage/linter/rules/typescript/prefer-reduce-type-parameter.md index 0ce757196ec..c3a727995df 100644 --- a/src/docs/guide/usage/linter/rules/typescript/prefer-reduce-type-parameter.md +++ b/src/docs/guide/usage/linter/rules/typescript/prefer-reduce-type-parameter.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/prefer-reduce-type-parameter
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/prefer-return-this-type.md b/src/docs/guide/usage/linter/rules/typescript/prefer-return-this-type.md index 1a06f39d18b..0e951ebc322 100644 --- a/src/docs/guide/usage/linter/rules/typescript/prefer-return-this-type.md +++ b/src/docs/guide/usage/linter/rules/typescript/prefer-return-this-type.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/prefer-return-this-type
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/promise-function-async.md b/src/docs/guide/usage/linter/rules/typescript/promise-function-async.md index 57159dc62e9..750fcedf68e 100644 --- a/src/docs/guide/usage/linter/rules/typescript/promise-function-async.md +++ b/src/docs/guide/usage/linter/rules/typescript/promise-function-async.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/promise-function-async
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/related-getter-setter-pairs.md b/src/docs/guide/usage/linter/rules/typescript/related-getter-setter-pairs.md index 7831a141fda..654b768e9c7 100644 --- a/src/docs/guide/usage/linter/rules/typescript/related-getter-setter-pairs.md +++ b/src/docs/guide/usage/linter/rules/typescript/related-getter-setter-pairs.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/related-getter-setter-pairs
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/require-array-sort-compare.md b/src/docs/guide/usage/linter/rules/typescript/require-array-sort-compare.md index 98b1db0cbae..3c8314d66c6 100644 --- a/src/docs/guide/usage/linter/rules/typescript/require-array-sort-compare.md +++ b/src/docs/guide/usage/linter/rules/typescript/require-array-sort-compare.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/require-await.md b/src/docs/guide/usage/linter/rules/typescript/require-await.md index 8f814cd60af..e386ecca635 100644 --- a/src/docs/guide/usage/linter/rules/typescript/require-await.md +++ b/src/docs/guide/usage/linter/rules/typescript/require-await.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/require-await
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/restrict-plus-operands.md b/src/docs/guide/usage/linter/rules/typescript/restrict-plus-operands.md index 8160bfb19fa..0219fed191b 100644 --- a/src/docs/guide/usage/linter/rules/typescript/restrict-plus-operands.md +++ b/src/docs/guide/usage/linter/rules/typescript/restrict-plus-operands.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/restrict-plus-operands
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/restrict-template-expressions.md b/src/docs/guide/usage/linter/rules/typescript/restrict-template-expressions.md index c8784829be1..07e41d5fb32 100644 --- a/src/docs/guide/usage/linter/rules/typescript/restrict-template-expressions.md +++ b/src/docs/guide/usage/linter/rules/typescript/restrict-template-expressions.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/return-await.md b/src/docs/guide/usage/linter/rules/typescript/return-await.md index b18d1f051bc..208ee4c3617 100644 --- a/src/docs/guide/usage/linter/rules/typescript/return-await.md +++ b/src/docs/guide/usage/linter/rules/typescript/return-await.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/return-await
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/switch-exhaustiveness-check.md b/src/docs/guide/usage/linter/rules/typescript/switch-exhaustiveness-check.md index bbca03a3214..fe302bdfe1c 100644 --- a/src/docs/guide/usage/linter/rules/typescript/switch-exhaustiveness-check.md +++ b/src/docs/guide/usage/linter/rules/typescript/switch-exhaustiveness-check.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/switch-exhaustiveness-check
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/unbound-method.md b/src/docs/guide/usage/linter/rules/typescript/unbound-method.md index 42b55ce6a56..30cb1ca91b8 100644 --- a/src/docs/guide/usage/linter/rules/typescript/unbound-method.md +++ b/src/docs/guide/usage/linter/rules/typescript/unbound-method.md @@ -11,6 +11,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin βœ… This rule is turned on by default. + +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/typescript/use-unknown-in-catch-callback-variable.md b/src/docs/guide/usage/linter/rules/typescript/use-unknown-in-catch-callback-variable.md index f303cf44d30..d624700c375 100644 --- a/src/docs/guide/usage/linter/rules/typescript/use-unknown-in-catch-callback-variable.md +++ b/src/docs/guide/usage/linter/rules/typescript/use-unknown-in-catch-callback-variable.md @@ -8,6 +8,9 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin # typescript/use-unknown-in-catch-callback-variable
+ +πŸ’­ This rule requires type information. + 🚧 An auto-fix is still under development. diff --git a/src/docs/guide/usage/linter/rules/unicorn/no-array-reverse.md b/src/docs/guide/usage/linter/rules/unicorn/no-array-reverse.md new file mode 100644 index 00000000000..81da782480e --- /dev/null +++ b/src/docs/guide/usage/linter/rules/unicorn/no-array-reverse.md @@ -0,0 +1,76 @@ + + + + +# unicorn/no-array-reverse + +
+ +πŸ› οΈ An auto-fix is available for this rule. + +
+ +### What it does + +Prefer using `Array#toReversed()` over `Array#reverse()`. + +### Why is this bad? + +`Array#reverse()` modifies the original array in place, which can lead to unintended side effectsβ€”especially +when the original array is used elsewhere in the code. + +### Examples + +Examples of **incorrect** code for this rule: + +```js +const reversed = [...array].reverse(); +``` + +Examples of **correct** code for this rule: + +```js +const reversed = [...array].toReversed(); +``` + +### Options + +#### allowExpressionStatement + +`{ type: boolean, default: true }` + +This rule allow `array.reverse()` as an expression statement by default, +Pass allowExpressionStatement: false to forbid `Array#reverse()` even it's an expression statement. + +Examples of **incorrect** code for this rule with the `{ "allowExpressionStatement": false }` option: + +```js +array.reverse(); +``` + +## How to use + +To **enable** this rule in the CLI or using the config file, you can use: + +::: code-group + +```bash [CLI] +oxlint --deny unicorn/no-array-reverse +``` + +```json [Config (.oxlintrc.json)] +{ + "rules": { + "unicorn/no-array-reverse": "error" + } +} +``` + +::: + +## References + +- Rule Source diff --git a/src/docs/guide/usage/linter/rules/version.data.js b/src/docs/guide/usage/linter/rules/version.data.js index 03bcb9bdbf7..5f3fa91285f 100644 --- a/src/docs/guide/usage/linter/rules/version.data.js +++ b/src/docs/guide/usage/linter/rules/version.data.js @@ -1,5 +1,5 @@ export default { load() { - return "7fc4aef229419ae73e4feae806eb73b7fed3b983"; + return "b20b56df4f00f5f03bc3bd3977725c52d43bbb91"; }, }; diff --git a/src/docs/guide/usage/linter/rules/vue/define-emits-declaration.md b/src/docs/guide/usage/linter/rules/vue/define-emits-declaration.md new file mode 100644 index 00000000000..8a774ba1fe0 --- /dev/null +++ b/src/docs/guide/usage/linter/rules/vue/define-emits-declaration.md @@ -0,0 +1,121 @@ + + + + +# vue/define-emits-declaration + +
+ +🚧 An auto-fix is still under development. + +
+ +### What it does + +This rule enforces `defineEmits` typing style which you should use `type-based`, strict `type-literal` (introduced in Vue 3.3), or `runtime` declaration. +This rule only works in setup script and `lang="ts"`. + +### Examples + +Examples of **incorrect** code for this rule: + +```vue +// "vue/define-emits-declaration": ["error", "type-based"] + + +// "vue/define-emits-declaration": ["error", "type-literal"] + + +// "vue/define-emits-declaration": ["error", "runtime"] + +``` + +Examples of **correct** code for this rule: + +```vue +// "vue/define-emits-declaration": ["error", "type-based"] + + +// "vue/define-emits-declaration": ["error", "type-literal"] + + +// "vue/define-emits-declaration": ["error", "runtime"] + +``` + +### Options + +``` +"vue/define-emits-declaration": ["error", "type-based" | "type-literal" | "runtime"] +``` + +- `type-based` (default): Enforce type-based declaration +- `type-literal`: Enforce type-literal declaration +- `runtime`: Enforce runtime declaration + +## How to use + +To **enable** this rule in the CLI or using the config file, you can use: + +::: code-group + +```bash [CLI] +oxlint --deny vue/define-emits-declaration --vue-plugin +``` + +```json [Config (.oxlintrc.json)] +{ + "plugins": ["vue"], + "rules": { + "vue/define-emits-declaration": "error" + } +} +``` + +::: + +## References + +- Rule Source diff --git a/src/docs/guide/usage/linter/rules/vue/define-props-declaration.md b/src/docs/guide/usage/linter/rules/vue/define-props-declaration.md new file mode 100644 index 00000000000..2127056d1df --- /dev/null +++ b/src/docs/guide/usage/linter/rules/vue/define-props-declaration.md @@ -0,0 +1,88 @@ + + + + +# vue/define-props-declaration + +
+
+ +### What it does + +This rule enforces `defineProps` typing style which you should use `type-based` or `runtime` declaration. +This rule only works in setup script and `lang="ts"`. + +### Examples + +Examples of **incorrect** code for this rule: + +```vue +// "vue/define-props-declaration": ["error", "type-based"] + + +// "vue/define-props-declaration": ["error", "runtime"] + +``` + +Examples of **correct** code for this rule: + +```vue +// "vue/define-props-declaration": ["error", "type-based"] + + +// "vue/define-props-declaration": ["error", "runtime"] + +``` + +### Options + +``` +"vue/define-props-declaration": ["error", "type-based" | "runtime"] +``` + +- `type-based` (default) enforces type-based declaration +- `runtime` enforces runtime declaration + +## How to use + +To **enable** this rule in the CLI or using the config file, you can use: + +::: code-group + +```bash [CLI] +oxlint --deny vue/define-props-declaration --vue-plugin +``` + +```json [Config (.oxlintrc.json)] +{ + "plugins": ["vue"], + "rules": { + "vue/define-props-declaration": "error" + } +} +``` + +::: + +## References + +- Rule Source diff --git a/src/docs/guide/usage/linter/rules/vue/no-multiple-slot-args.md b/src/docs/guide/usage/linter/rules/vue/no-multiple-slot-args.md new file mode 100644 index 00000000000..95268e4acd0 --- /dev/null +++ b/src/docs/guide/usage/linter/rules/vue/no-multiple-slot-args.md @@ -0,0 +1,80 @@ + + + + +# vue/no-multiple-slot-args + +
+ +🚧 An auto-fix is still under development. + +
+ +### What it does + +Disallow passing multiple arguments to scoped slots. + +### Why is this bad? + +Users have to use the arguments in fixed order and cannot omit the ones they don't need. +e.g. if you have a slot that passes in 5 arguments but the user actually only need the last 2 of them, +they will have to declare all 5 just to use the last 2. + +More information can be found in [vuejs/vue#9468](https://github.com/vuejs/vue/issues/9468#issuecomment-462210146) + +### Examples + +Examples of **incorrect** code for this rule: + +```vue + +``` + +Examples of **correct** code for this rule: + +```vue + +``` + +## How to use + +To **enable** this rule in the CLI or using the config file, you can use: + +::: code-group + +```bash [CLI] +oxlint --deny vue/no-multiple-slot-args --vue-plugin +``` + +```json [Config (.oxlintrc.json)] +{ + "plugins": ["vue"], + "rules": { + "vue/no-multiple-slot-args": "error" + } +} +``` + +::: + +## References + +- Rule Source diff --git a/src/docs/guide/usage/linter/rules/vue/valid-define-props.md b/src/docs/guide/usage/linter/rules/vue/valid-define-props.md new file mode 100644 index 00000000000..8c126f3c865 --- /dev/null +++ b/src/docs/guide/usage/linter/rules/vue/valid-define-props.md @@ -0,0 +1,122 @@ + + + + +# vue/valid-define-props + +
+ +🚧 An auto-fix is still under development. + +
+ +### What it does + +This rule checks whether `defineProps` compiler macro is valid. + +This rule reports `defineProps` compiler macros in the following cases: + +- `defineProps` is referencing locally declared variables. +- `defineProps` has both a literal type and an argument. e.g. `defineProps<{ /*props*/ }>({ /*props*/ })` +- `defineProps` has been called multiple times. +- Props are defined in both `defineProps` and `export default {}`. +- Props are not defined in either `defineProps` or `export default {}`. + +### Why is this bad? + +Misusing `defineProps` can lead to runtime errors, and lost type safety. +Vue may still compile the code, but properties may break silently or be typed incorrectly. + +### Examples + +Examples of **incorrect** code for this rule: + +```vue + +``` + +```vue + +``` + +```vue + +``` + +```vue + + +``` + +Examples of **correct** code for this rule: + +```vue + +``` + +```vue + +``` + +```vue + +``` + +```vue + + +``` + +## How to use + +To **enable** this rule in the CLI or using the config file, you can use: + +::: code-group + +```bash [CLI] +oxlint --deny vue/valid-define-props --vue-plugin +``` + +```json [Config (.oxlintrc.json)] +{ + "plugins": ["vue"], + "rules": { + "vue/valid-define-props": "error" + } +} +``` + +::: + +## References + +- Rule Source