Skip to content

Commit e8ca9f0

Browse files
authored
Release 1.31.0 (#670)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
1 parent 90e181e commit e8ca9f0

26 files changed

+256
-65
lines changed

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

Lines changed: 3 additions & 2 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: 617
9+
- Total number of rules: 618
1010
- Rules turned on by default: 103
1111

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

241-
## Restriction (78):
241+
## Restriction (79):
242242

243243
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.
244244

@@ -302,6 +302,7 @@ Lints which prevent the use of language and library features. Must not be enable
302302
| [no-non-null-asserted-nullish-coalescing](/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-nullish-coalescing.html) | typescript | | |
303303
| [no-non-null-assertion](/docs/guide/usage/linter/rules/typescript/no-non-null-assertion.html) | typescript | | |
304304
| [no-require-imports](/docs/guide/usage/linter/rules/typescript/no-require-imports.html) | typescript | | 🚧 |
305+
| [no-restricted-types](/docs/guide/usage/linter/rules/typescript/no-restricted-types.html) | typescript | | 🛠️💡 |
305306
| [no-var-requires](/docs/guide/usage/linter/rules/typescript/no-var-requires.html) | typescript | | |
306307
| [non-nullable-type-assertion-style](/docs/guide/usage/linter/rules/typescript/non-nullable-type-assertion-style.html) | typescript | | 🚧 |
307308
| [prefer-literal-enum-member](/docs/guide/usage/linter/rules/typescript/prefer-literal-enum-member.html) | typescript | | |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type: `boolean`
7575

7676
default: `false`
7777

78-
When set to true the `int32Hint` option allows the use of bitwise OR in |0
78+
When set to `true` the `int32Hint` option allows the use of bitwise OR in |0
7979
pattern for type casting.
8080

8181
For example with `{ "int32Hint": true }` the following is permitted:

src/docs/guide/usage/linter/rules/eslint/no-obj-calls.md

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

1616
### What it does
1717

18-
Disallow calling some global objects as functions
18+
Disallow calling some global objects as functions.
19+
20+
It is safe to disable this rule when using TypeScript, because
21+
TypeScript's compiler enforces this check.
1922

2023
### Why is this bad?
2124

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin
1515

1616
### What it does
1717

18-
Disallow the use of the `__proto__` property
18+
Disallow the use of the `__proto__` property.
1919

2020
### Why is this bad?
2121

2222
The `__proto__` property has been deprecated as of ECMAScript 3.1 and
2323
shouldn’t be used in new code. Use `Object.getPrototypeOf` and
2424
`Object.setPrototypeOf` instead.
2525

26+
For more information, see
27+
[the MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto).
28+
2629
### Examples
2730

2831
Examples of **incorrect** code for this rule:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ a = 10;
4040

4141
This rule accepts a configuration object with the following properties:
4242

43-
### builtInGlobals
43+
### builtinGlobals
4444

4545
type: `boolean`
4646

src/docs/guide/usage/linter/rules/eslint/no-return-assign.md

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

1616
### What it does
1717

18-
Disallows assignment operators in return statements
18+
Disallows assignment operators in return statements.
1919

2020
### Why is this bad?
2121

@@ -46,15 +46,16 @@ function x() {
4646

4747
## Configuration
4848

49-
This rule accepts a configuration object with the following properties:
49+
This rule accepts one of the following string values:
5050

51-
### alwaysDisallowAssignmentInReturn
51+
### `"always"`
5252

53-
type: `boolean`
53+
Disallow all assignments in return statements.
5454

55-
default: `false`
55+
### `"except-parens"`
5656

57-
Whether to always disallow assignment in return statements.
57+
Allow assignments in return statements only if they are enclosed in parentheses.
58+
This is the default mode.
5859

5960
## How to use
6061

src/docs/guide/usage/linter/rules/eslint/no-unused-expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ default: `false`
6565

6666
When set to `true`, allows ternary operators in expressions.
6767

68-
### enforceForJsx
68+
### enforceForJSX
6969

7070
type: `boolean`
7171

src/docs/guide/usage/linter/rules/eslint/radix.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ Enforce the consistent use of the radix argument when using `parseInt()`.
1919

2020
### Why is this bad?
2121

22-
Using the `parseInt()` function without specifying the radix can lead to unexpected results.
22+
Using the `parseInt()` function without specifying
23+
the radix can lead to unexpected results.
24+
25+
See the
26+
[MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#radix)
27+
for more information.
2328

2429
### Examples
2530

@@ -37,15 +42,15 @@ var num = parseInt("071", 10); // 71
3742

3843
## Configuration
3944

40-
This rule accepts a configuration object with the following properties:
45+
This rule accepts one of the following string values:
4146

42-
### radixType
47+
### `"always"`
4348

44-
type: `"always" | "as-needed"`
49+
Always require the radix parameter when using `parseInt()`.
4550

46-
default: `"always"`
51+
### `"as-needed"`
4752

48-
Configuration option to specify when to require the radix parameter.
53+
Only require the radix parameter when necessary.
4954

5055
## How to use
5156

src/docs/guide/usage/linter/rules/eslint/unicode-bom.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ var a = 123;
3535

3636
## Configuration
3737

38-
This rule accepts a configuration object with the following properties:
38+
This rule accepts one of the following string values:
3939

40-
### bomOption
40+
### `"always"`
4141

42-
type: `"always" | "never"`
42+
Always require a Unicode BOM (Byte Order Mark) at the beginning of the file.
4343

44-
Configuration option to specify whether to require or disallow Unicode BOM.
44+
### `"never"`
45+
46+
Never allow a Unicode BOM (Byte Order Mark) at the beginning of the file.
47+
This is the default option.
4548

4649
## How to use
4750

src/docs/guide/usage/linter/rules/import/consistent-type-specifier-style.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,15 @@ import Foo, { type Bar } from "Foo";
5555

5656
## Configuration
5757

58-
This rule accepts a configuration object with the following properties:
58+
This rule accepts one of the following string values:
5959

60-
### mode
60+
### `"prefer-top-level"`
6161

62-
type: `"prefer-top-level" | "prefer-inline"`
62+
Prefer `import type { Foo } from 'foo'` for type imports.
6363

64-
default: `"prefer-top-level"`
64+
### `"prefer-inline"`
6565

66-
Specify whether to prefer top-level type-only imports or inline type specifiers.
67-
68-
- `"prefer-top-level"`: `import type { Foo } from 'foo'`
69-
- `"prefer-inline"`: `import { type Foo } from 'foo'`
66+
Prefer `import { type Foo } from 'foo'` for type imports.
7067

7168
## How to use
7269

0 commit comments

Comments
 (0)