Skip to content

Commit 6e7b51b

Browse files
Boshencamc314
andauthored
Release 1.32.0 (#688)
* Release 1.32.0 * fmt --------- Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> Co-authored-by: Cameron Clark <cameron.clark@hey.com>
1 parent 3df7f4a commit 6e7b51b

21 files changed

+235
-87
lines changed

src/docs/guide/usage/linter/generated-cli.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ Arguments:
7575
Enable the promise plugin and detect promise usage problems
7676
- **`--node-plugin`** &mdash;
7777
Enable the node plugin and detect node usage problems
78-
- **`--regex-plugin`** &mdash;
79-
Enable the regex plugin and detect regex usage problems
8078
- **`--vue-plugin`** &mdash;
8179
Enable the vue plugin and detect vue usage problems
8280

src/docs/guide/usage/linter/generated-rules.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ search: false
66

77
The progress of all rule implementations is tracked [here](https://github.com/oxc-project/oxc/issues/481).
88

9-
- Total number of rules: 618
9+
- Total number of rules: 619
1010
- Rules turned on by default: 103
1111

1212
**Legend for 'Fixable?' column:**
@@ -378,7 +378,7 @@ code that is most likely wrong or useless.
378378
| [no-required-prop-with-default](/docs/guide/usage/linter/rules/vue/no-required-prop-with-default.html) | vue | | 🚧 |
379379
| [require-default-export](/docs/guide/usage/linter/rules/vue/require-default-export.html) | vue | | |
380380

381-
## Pedantic (106):
381+
## Pedantic (107):
382382

383383
Lints which are rather strict or have occasional false positives.
384384

@@ -405,6 +405,7 @@ Lints which are rather strict or have occasional false positives.
405405
| [no-redeclare](/docs/guide/usage/linter/rules/eslint/no-redeclare.html) | eslint | | |
406406
| [no-self-compare](/docs/guide/usage/linter/rules/eslint/no-self-compare.html) | eslint | | |
407407
| [no-throw-literal](/docs/guide/usage/linter/rules/eslint/no-throw-literal.html) | eslint | | 💡 |
408+
| [no-useless-return](/docs/guide/usage/linter/rules/eslint/no-useless-return.html) | eslint | | 🚧 |
408409
| [no-warning-comments](/docs/guide/usage/linter/rules/eslint/no-warning-comments.html) | eslint | | |
409410
| [radix](/docs/guide/usage/linter/rules/eslint/radix.html) | eslint | | ⚠️🛠️️ |
410411
| [require-await](/docs/guide/usage/linter/rules/eslint/require-await.html) | eslint | | ⚠️🛠️️ |
@@ -497,7 +498,7 @@ Code that should be written in a more idiomatic way.
497498

498499
| Rule name | Source | Default | Fixable? |
499500
| ------------------------------------------------------------------------------------------------------------------------ | ---------- | ------- | -------- |
500-
| [arrow-body-style](/docs/guide/usage/linter/rules/eslint/arrow-body-style.html) | eslint | | 🚧 |
501+
| [arrow-body-style](/docs/guide/usage/linter/rules/eslint/arrow-body-style.html) | eslint | | 🛠️ |
501502
| [curly](/docs/guide/usage/linter/rules/eslint/curly.html) | eslint | | 🛠️ |
502503
| [default-case-last](/docs/guide/usage/linter/rules/eslint/default-case-last.html) | eslint | | |
503504
| [default-param-last](/docs/guide/usage/linter/rules/eslint/default-param-last.html) | eslint | | |

src/docs/guide/usage/linter/rules/eslint/arrow-body-style.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin
99

1010
<div class="rule-meta">
1111
<Alert class="fix" type="info">
12-
<span class="emoji">🚧</span> An auto-fix is planned for this rule, but not implemented at this time.
12+
<span class="emoji">🛠️</span> An auto-fix is available for this rule.
1313
</Alert>
1414
</div>
1515

@@ -32,13 +32,13 @@ First option:
3232

3333
- Type: `string`
3434
- Enum: `"always"`, `"as-needed"`, `"never"`
35-
- Default: `"never"`
35+
- Default: `"as-needed"`
3636

3737
Possible values:
3838

39-
- `never` enforces no braces where they can be omitted (default)
39+
- `never` enforces no braces around the function body (constrains arrow functions to the role of returning an expression)
4040
- `always` enforces braces around the function body
41-
- `as-needed` enforces no braces around the function body (constrains arrow functions to the role of returning an expression)
41+
- `as-needed` enforces no braces where they can be omitted (default)
4242

4343
Second option:
4444

src/docs/guide/usage/linter/rules/eslint/max-lines-per-function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function foo() {
6161

6262
This rule accepts a configuration object with the following properties:
6363

64-
### iifes
64+
### IIFEs
6565

6666
type: `boolean`
6767

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<!-- This file is auto-generated by tasks/website_linter/src/rules/doc_page.rs. Do not edit it manually. -->
2+
3+
<script setup>
4+
import { data } from '../version.data.js';
5+
const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_linter/src/rules/eslint/no_useless_return.rs`;
6+
</script>
7+
8+
# eslint/no-useless-return <Badge type="info" text="Pedantic" />
9+
10+
<div class="rule-meta">
11+
<Alert class="fix" type="info">
12+
<span class="emoji">🚧</span> An auto-fix is planned for this rule, but not implemented at this time.
13+
</Alert>
14+
</div>
15+
16+
### What it does
17+
18+
Disallows redundant return statements.
19+
20+
### Why is this bad?
21+
22+
A `return;` statement with nothing after it is redundant, and has no effect
23+
on the runtime behavior of a function. This can be confusing, so it's better
24+
to disallow these redundant statements.
25+
26+
### Examples
27+
28+
Examples of **incorrect** code for this rule:
29+
30+
```js
31+
function foo() {
32+
return;
33+
}
34+
35+
function bar() {
36+
doSomething();
37+
return;
38+
}
39+
40+
function baz() {
41+
if (condition) {
42+
doSomething();
43+
return;
44+
}
45+
}
46+
```
47+
48+
Examples of **correct** code for this rule:
49+
50+
```js
51+
function foo() {
52+
return 5;
53+
}
54+
55+
function bar() {
56+
if (condition) {
57+
return;
58+
}
59+
doSomething();
60+
}
61+
62+
function baz() {
63+
return doSomething();
64+
}
65+
```
66+
67+
## How to use
68+
69+
To **enable** this rule using the config file or in the CLI, you can use:
70+
71+
::: code-group
72+
73+
```json [Config (.oxlintrc.json)]
74+
{
75+
"rules": {
76+
"no-useless-return": "error"
77+
}
78+
}
79+
```
80+
81+
```bash [CLI]
82+
oxlint --deny no-useless-return
83+
```
84+
85+
:::
86+
87+
## References
88+
89+
- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>

src/docs/guide/usage/linter/rules/jest/consistent-test-it.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe("foo", function() {
5858
```
5959

6060
This rule is compatible with [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest/blob/v1.1.9/docs/rules/consistent-test-it.md),
61-
to use it, add the following configuration to your `.eslintrc.json`:
61+
to use it, add the following configuration to your `.oxlintrc.json`:
6262

6363
```json
6464
{

src/docs/guide/usage/linter/rules/jest/expect-expect.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test("should assert something", () => {});
3030
```
3131

3232
This rule is compatible with [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest/blob/v1.1.9/docs/rules/expect-expect.md),
33-
to use it, add the following configuration to your `.eslintrc.json`:
33+
to use it, add the following configuration to your `.oxlintrc.json`:
3434

3535
```json
3636
{
@@ -52,32 +52,23 @@ default: `[]`
5252

5353
An array of function names that should also be treated as test blocks.
5454

55-
### assertFunctionNamesJest
55+
### assertFunctionNames
5656

5757
type: `string[]`
5858

5959
default: `["expect"]`
6060

6161
A list of function names that should be treated as assertion functions.
6262

63-
### assertFunctionNamesVitest
64-
65-
type: `string[]`
66-
67-
default: `["expect", "expectTypeOf", "assert", "assertType"]`
68-
69-
A list of function names that should be treated as assertion functions for Vitest.
63+
NOTE: The default value is `["expect"]` for Jest and
64+
`["expect", "expectTypeOf", "assert", "assertType"]` for Vitest.
7065

7166
## How to use
7267

73-
To **enable** this rule in the CLI or using the config file, you can use:
68+
To **enable** this rule using the config file or in the CLI, you can use:
7469

7570
::: code-group
7671

77-
```bash [CLI]
78-
oxlint --deny jest/expect-expect --jest-plugin
79-
```
80-
8172
```json [Config (.oxlintrc.json)]
8273
{
8374
"plugins": ["jest"],
@@ -87,6 +78,10 @@ oxlint --deny jest/expect-expect --jest-plugin
8778
}
8879
```
8980

81+
```bash [CLI]
82+
oxlint --deny jest/expect-expect --jest-plugin
83+
```
84+
9085
:::
9186

9287
## References

src/docs/guide/usage/linter/rules/jest/no-alias-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ expect(a).toThrow();
5757
```
5858

5959
This rule is compatible with [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest/blob/v1.1.9/docs/rules/no-alias-methods.md),
60-
to use it, add the following configuration to your `.eslintrc.json`:
60+
to use it, add the following configuration to your `.oxlintrc.json`:
6161

6262
```json
6363
{

src/docs/guide/usage/linter/rules/jest/no-commented-out-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Examples of **incorrect** code for this rule:
3535
```
3636

3737
This rule is compatible with [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest/blob/v1.1.9/docs/rules/no-commented-out-tests.md),
38-
to use it, add the following configuration to your `.eslintrc.json`:
38+
to use it, add the following configuration to your `.oxlintrc.json`:
3939

4040
```json
4141
{

src/docs/guide/usage/linter/rules/jest/no-disabled-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ it("foo", () => {
4545
```
4646

4747
This rule is compatible with [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest/blob/v1.1.9/docs/rules/no-disabled-tests.md),
48-
to use it, add the following configuration to your `.eslintrc.json`:
48+
to use it, add the following configuration to your `.oxlintrc.json`:
4949

5050
```json
5151
{

0 commit comments

Comments
 (0)