Skip to content

Commit e94c6a5

Browse files
Boshengithub-actions[bot]
authored andcommitted
Release 1.24.0
1 parent 4b97112 commit e94c6a5

36 files changed

+626
-63
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ Globs to ignore during linting. These are resolved from the configuration file p
147147

148148
type: `string[]`
149149

150-
default: `null`
151-
152150
JS plugins.
153151

154152
Note: JS plugins are experimental and not subject to semver.

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
- Total number of rules: 607
5+
- Total number of rules: 610
66
- Rules turned on by default: 103
77

88
**Legend for 'Fixable?' column:**
@@ -235,7 +235,7 @@ Code that can be written to run faster.
235235
| [prefer-array-flat-map](/docs/guide/usage/linter/rules/unicorn/prefer-array-flat-map.html) | unicorn | | 🛠️ |
236236
| [prefer-set-has](/docs/guide/usage/linter/rules/unicorn/prefer-set-has.html) | unicorn | | ⚠️🛠️️ |
237237

238-
## Restriction (77):
238+
## Restriction (78):
239239

240240
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.
241241

@@ -274,7 +274,7 @@ Lints which prevent the use of language and library features. Must not be enable
274274
| [anchor-ambiguous-text](/docs/guide/usage/linter/rules/jsx_a11y/anchor-ambiguous-text.html) | jsx_a11y | | |
275275
| [no-new-require](/docs/guide/usage/linter/rules/node/no-new-require.html) | node | | |
276276
| [no-process-env](/docs/guide/usage/linter/rules/node/no-process-env.html) | node | | |
277-
| [bad-bitwise-operator](/docs/guide/usage/linter/rules/oxc/bad-bitwise-operator.html) | oxc | | |
277+
| [bad-bitwise-operator](/docs/guide/usage/linter/rules/oxc/bad-bitwise-operator.html) | oxc | | 🚧 |
278278
| [no-async-await](/docs/guide/usage/linter/rules/oxc/no-async-await.html) | oxc | | |
279279
| [no-barrel-file](/docs/guide/usage/linter/rules/oxc/no-barrel-file.html) | oxc | | |
280280
| [no-const-enum](/docs/guide/usage/linter/rules/oxc/no-const-enum.html) | oxc | | 🛠️ |
@@ -283,6 +283,7 @@ Lints which prevent the use of language and library features. Must not be enable
283283
| [catch-or-return](/docs/guide/usage/linter/rules/promise/catch-or-return.html) | promise | | |
284284
| [spec-only](/docs/guide/usage/linter/rules/promise/spec-only.html) | promise | | |
285285
| [button-has-type](/docs/guide/usage/linter/rules/react/button-has-type.html) | react | | |
286+
| [forbid-dom-props](/docs/guide/usage/linter/rules/react/forbid-dom-props.html) | react | | |
286287
| [forbid-elements](/docs/guide/usage/linter/rules/react/forbid-elements.html) | react | | |
287288
| [jsx-filename-extension](/docs/guide/usage/linter/rules/react/jsx-filename-extension.html) | react | | 🚧 |
288289
| [no-danger](/docs/guide/usage/linter/rules/react/no-danger.html) | react | | |
@@ -373,7 +374,7 @@ code that is most likely wrong or useless.
373374
| [no-required-prop-with-default](/docs/guide/usage/linter/rules/vue/no-required-prop-with-default.html) | vue | | 🚧 |
374375
| [require-default-export](/docs/guide/usage/linter/rules/vue/require-default-export.html) | vue | | |
375376

376-
## Pedantic (101):
377+
## Pedantic (102):
377378

378379
Lints which are rather strict or have occasional false positives.
379380

@@ -400,6 +401,7 @@ Lints which are rather strict or have occasional false positives.
400401
| [no-redeclare](/docs/guide/usage/linter/rules/eslint/no-redeclare.html) | eslint | | |
401402
| [no-self-compare](/docs/guide/usage/linter/rules/eslint/no-self-compare.html) | eslint | | |
402403
| [no-throw-literal](/docs/guide/usage/linter/rules/eslint/no-throw-literal.html) | eslint | | 💡 |
404+
| [no-warning-comments](/docs/guide/usage/linter/rules/eslint/no-warning-comments.html) | eslint | | |
403405
| [radix](/docs/guide/usage/linter/rules/eslint/radix.html) | eslint | | ⚠️🛠️️ |
404406
| [require-await](/docs/guide/usage/linter/rules/eslint/require-await.html) | eslint | | ⚠️🛠️️ |
405407
| [sort-vars](/docs/guide/usage/linter/rules/eslint/sort-vars.html) | eslint | | 🚧 |
@@ -652,12 +654,13 @@ Code that should be written in a more idiomatic way.
652654
| [define-props-destructuring](/docs/guide/usage/linter/rules/vue/define-props-destructuring.html) | vue | | |
653655
| [require-typed-ref](/docs/guide/usage/linter/rules/vue/require-typed-ref.html) | vue | | |
654656

655-
## Nursery (10):
657+
## Nursery (11):
656658

657659
New lints that are still under development.
658660

659661
| Rule name | Source | Default | Fixable? |
660662
| --------------------------------------------------------------------------------------------------------- | ------- | ------- | -------- |
663+
| [constructor-super](/docs/guide/usage/linter/rules/eslint/constructor-super.html) | eslint | | |
661664
| [getter-return](/docs/guide/usage/linter/rules/eslint/getter-return.html) | eslint | | |
662665
| [no-misleading-character-class](/docs/guide/usage/linter/rules/eslint/no-misleading-character-class.html) | eslint | | |
663666
| [no-undef](/docs/guide/usage/linter/rules/eslint/no-undef.html) | eslint | | |

src/docs/guide/usage/linter/rules/eslint/constructor-super.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,78 @@
11
<!-- This file is auto-generated by tasks/website/src/linter/rules/doc_page.rs. Do not edit it manually. -->
22

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/constructor_super.rs`;
6+
</script>
7+
38
# eslint/constructor-super <Badge type="info" text="Nursery" />
49

510
<div class="rule-meta">
611
</div>
712

813
### What it does
914

10-
Require 'super()' calls in constructors.
15+
Requires `super()` calls in constructors of derived classes and disallows `super()` calls
16+
in constructors of non-derived classes.
1117

1218
### Why is this bad?
1319

14-
### Example
20+
In JavaScript, calling `super()` in the constructor of a derived class (a class that extends
21+
another class) is required. Failing to do so will result in a ReferenceError at runtime.
22+
Conversely, calling `super()` in a non-derived class is a syntax error.
23+
24+
### Examples
25+
26+
Examples of **incorrect** code for this rule:
1527

16-
```javascript
28+
```js
29+
// Missing super() call
1730
class A extends B {
1831
constructor() {}
1932
}
33+
34+
// super() in non-derived class
35+
class A {
36+
constructor() {
37+
super();
38+
}
39+
}
40+
41+
// super() only in some code paths
42+
class C extends D {
43+
constructor() {
44+
if (condition) {
45+
super();
46+
}
47+
}
48+
}
49+
```
50+
51+
Examples of **correct** code for this rule:
52+
53+
```js
54+
// Proper super() call in derived class
55+
class A extends B {
56+
constructor() {
57+
super();
58+
}
59+
}
60+
61+
// No super() in non-derived class
62+
class A {
63+
constructor() {}
64+
}
65+
66+
// super() in all code paths
67+
class C extends D {
68+
constructor() {
69+
if (condition) {
70+
super();
71+
} else {
72+
super();
73+
}
74+
}
75+
}
2076
```
2177

2278
## How to use
@@ -41,4 +97,4 @@ oxlint --deny constructor-super
4197

4298
## References
4399

44-
- [Rule Source](https://github.com/oxc-project/oxc/blob/c22276e8fbbf443c4293a3cfe7758ac1ceea325c/crates/oxc_linter/src/rules/eslint/constructor_super.rs)
100+
- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,24 @@ type: `boolean`
154154

155155
default: `false`
156156

157+
When true, arrow functions are allowed regardless of the style setting.
158+
157159
### allowTypeAnnotation
158160

159161
type: `boolean`
160162

161163
default: `false`
162164

165+
When true, functions with type annotations are allowed regardless of the style setting.
166+
163167
### style
164168

165169
type: `"expression" | "declaration"`
166170

167171
default: `"expression"`
168172

173+
The style to enforce. Either "expression" (default) or "declaration".
174+
169175
## How to use
170176

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

src/docs/guide/usage/linter/rules/eslint/max-depth.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ Example:
9191
]
9292
```
9393
94+
## Configuration
95+
96+
This rule accepts a configuration object with the following properties:
97+
98+
### max
99+
100+
type: `integer`
101+
94102
## How to use
95103
96104
To **enable** this rule in the CLI or using the config file, you can use:

src/docs/guide/usage/linter/rules/eslint/max-params.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ let foo = (bar, baz, qux) => {
5555

5656
### Options
5757

58-
### max
58+
#### max
5959

6060
`{ "max": number }`
6161

@@ -64,7 +64,7 @@ This option is for changing the maximum allowed number of function parameters.
6464
For example `{ "max": 4 }` would mean that having a function take four
6565
parameters is allowed which overrides the default of three.
6666

67-
### countVoidThis
67+
#### countVoidThis
6868

6969
`{ "countVoidThis": boolean }`
7070

src/docs/guide/usage/linter/rules/eslint/no-empty-function.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,23 @@ Disallows the usages of empty functions
1919
Empty functions can reduce readability because readers need to guess whether it's
2020
intentional or not. So writing a clear comment for empty functions is a good practice.
2121

22-
### Configuration
22+
### Options
2323

24-
You may pass an object containing a list of `allow`ed function kinds.
25-
For example:
24+
#### allow
25+
26+
`{ type: string[], default: [] }`
27+
28+
You may pass a list of allowed function kinds, which will allow functions of
29+
these kinds to be empty.
30+
31+
Example:
2632

2733
```json
28-
// oxlint.json
2934
{
30-
"rules": {
31-
"no-empty-function": ["error", { "allow": ["functions"] }]
32-
}
35+
"no-empty-function": [
36+
"error",
37+
{ "allow": ["functions"] }
38+
]
3339
}
3440
```
3541

src/docs/guide/usage/linter/rules/eslint/no-invalid-regexp.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ new RegExp();
4040
this.RegExp("[");
4141
```
4242

43+
## Configuration
44+
45+
This rule accepts a configuration object with the following properties:
46+
47+
### allowConstructorFlags
48+
49+
type: `string[]`
50+
51+
default: `[]`
52+
53+
Case-sensitive array of flags that will be allowed.
54+
4355
## How to use
4456

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

src/docs/guide/usage/linter/rules/eslint/no-irregular-whitespace.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ function example() {
3636

3737
Examples of **correct** code for this rule:
3838

39-
````javascript
39+
```javascript
4040
function example() {
41-
var foo = 'bar'; // regular spaces only
41+
var foo = "bar"; // regular spaces only
4242
}
43-
43+
```
4444

4545
## How to use
4646

@@ -50,7 +50,7 @@ To **enable** this rule in the CLI or using the config file, you can use:
5050

5151
```bash [CLI]
5252
oxlint --deny no-irregular-whitespace
53-
````
53+
```
5454

5555
```json [Config (.oxlintrc.json)]
5656
{

src/docs/guide/usage/linter/rules/eslint/no-param-reassign.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,34 @@ function baz(qux) {
3232
}
3333
```
3434

35+
## Configuration
36+
37+
This rule accepts a configuration object with the following properties:
38+
39+
### ignorePropertyModificationsFor
40+
41+
type: `string[]`
42+
43+
default: `[]`
44+
45+
An array of parameter names whose property modifications should be ignored.
46+
47+
### ignorePropertyModificationsForRegex
48+
49+
type: `string[]`
50+
51+
An array of regex patterns (as strings) for parameter names whose property modifications should be ignored.
52+
Note that this uses [Rust regex syntax](https://docs.rs/regex/latest/regex/) and so may not have all features
53+
available to JavaScript regexes.
54+
55+
### props
56+
57+
type: `boolean`
58+
59+
default: `false`
60+
61+
When true, also check for modifications to properties of parameters.
62+
3563
## How to use
3664

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

0 commit comments

Comments
 (0)