Skip to content

Commit c3e87fb

Browse files
authored
Release 1.26.0 (#604)
1 parent 5da9f20 commit c3e87fb

File tree

94 files changed

+2020
-449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2020
-449
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ type: `Record<string, boolean>`
9595

9696
Predefine global variables.
9797

98-
Environments specify what global variables are predefined. See [ESLint's list of environments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)
98+
Environments specify what global variables are predefined.
99+
See [ESLint's list of environments](https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments)
99100
for what environments are available and what each one provides.
100101

101102
## extends

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

Lines changed: 7 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: 611
5+
- Total number of rules: 613
66
- Rules turned on by default: 103
77

88
**Legend for 'Fixable?' column:**
@@ -13,7 +13,7 @@ The progress of all rule implementations is tracked [here](https://github.com/ox
1313
- ⚠️💡: a dangerous suggestion is available for this rule
1414
- 🚧: an auto-fix or suggestion is possible, but currently not implemented
1515

16-
## Correctness (197):
16+
## Correctness (196):
1717

1818
Code that is outright wrong or useless.
1919

@@ -161,7 +161,6 @@ Code that is outright wrong or useless.
161161
| [forward-ref-uses-ref](/docs/guide/usage/linter/rules/react/forward-ref-uses-ref.html) | react | | 💡 |
162162
| [jsx-key](/docs/guide/usage/linter/rules/react/jsx-key.html) | react | | |
163163
| [jsx-no-duplicate-props](/docs/guide/usage/linter/rules/react/jsx-no-duplicate-props.html) | react | | |
164-
| [jsx-no-target-blank](/docs/guide/usage/linter/rules/react/jsx-no-target-blank.html) | react | | |
165164
| [jsx-no-undef](/docs/guide/usage/linter/rules/react/jsx-no-undef.html) | react | | |
166165
| [jsx-props-no-spread-multi](/docs/guide/usage/linter/rules/react/jsx-props-no-spread-multi.html) | react | | 🛠️ |
167166
| [no-children-prop](/docs/guide/usage/linter/rules/react/no-children-prop.html) | react | | |
@@ -374,7 +373,7 @@ code that is most likely wrong or useless.
374373
| [no-required-prop-with-default](/docs/guide/usage/linter/rules/vue/no-required-prop-with-default.html) | vue | | 🚧 |
375374
| [require-default-export](/docs/guide/usage/linter/rules/vue/require-default-export.html) | vue | | |
376375

377-
## Pedantic (103):
376+
## Pedantic (105):
378377

379378
Lints which are rather strict or have occasional false positives.
380379

@@ -416,12 +415,14 @@ Lints which are rather strict or have occasional false positives.
416415
| [require-returns-description](/docs/guide/usage/linter/rules/jsdoc/require-returns-description.html) | jsdoc | | |
417416
| [require-returns-type](/docs/guide/usage/linter/rules/jsdoc/require-returns-type.html) | jsdoc | | |
418417
| [checked-requires-onchange-or-readonly](/docs/guide/usage/linter/rules/react/checked-requires-onchange-or-readonly.html) | react | | |
418+
| [jsx-no-target-blank](/docs/guide/usage/linter/rules/react/jsx-no-target-blank.html) | react | | |
419419
| [jsx-no-useless-fragment](/docs/guide/usage/linter/rules/react/jsx-no-useless-fragment.html) | react | | 💡 |
420420
| [no-unescaped-entities](/docs/guide/usage/linter/rules/react/no-unescaped-entities.html) | react | | |
421421
| [rules-of-hooks](/docs/guide/usage/linter/rules/react/rules-of-hooks.html) | react | | |
422422
| [ban-ts-comment](/docs/guide/usage/linter/rules/typescript/ban-ts-comment.html) | typescript | | 🛠️ |
423423
| [ban-types](/docs/guide/usage/linter/rules/typescript/ban-types.html) | typescript | | 🚧 |
424424
| [no-confusing-void-expression](/docs/guide/usage/linter/rules/typescript/no-confusing-void-expression.html) | typescript | | 🚧 |
425+
| [no-deprecated](/docs/guide/usage/linter/rules/typescript/no-deprecated.html) | typescript | | |
425426
| [no-misused-promises](/docs/guide/usage/linter/rules/typescript/no-misused-promises.html) | typescript | | 🚧 |
426427
| [no-mixed-enums](/docs/guide/usage/linter/rules/typescript/no-mixed-enums.html) | typescript | | 🚧 |
427428
| [no-unsafe-argument](/docs/guide/usage/linter/rules/typescript/no-unsafe-argument.html) | typescript | | 🚧 |
@@ -484,7 +485,7 @@ Lints which are rather strict or have occasional false positives.
484485
| [prefer-type-error](/docs/guide/usage/linter/rules/unicorn/prefer-type-error.html) | unicorn | | 🛠️ |
485486
| [require-number-to-fixed-digits-argument](/docs/guide/usage/linter/rules/unicorn/require-number-to-fixed-digits-argument.html) | unicorn | | 🛠️ |
486487

487-
## Style (164):
488+
## Style (165):
488489

489490
Code that should be written in a more idiomatic way.
490491

@@ -597,6 +598,7 @@ Code that should be written in a more idiomatic way.
597598
| [no-set-state](/docs/guide/usage/linter/rules/react/no-set-state.html) | react | | |
598599
| [prefer-es6-class](/docs/guide/usage/linter/rules/react/prefer-es6-class.html) | react | | |
599600
| [self-closing-comp](/docs/guide/usage/linter/rules/react/self-closing-comp.html) | react | | 🛠️ |
601+
| [state-in-constructor](/docs/guide/usage/linter/rules/react/state-in-constructor.html) | react | | |
600602
| [adjacent-overload-signatures](/docs/guide/usage/linter/rules/typescript/adjacent-overload-signatures.html) | typescript | | |
601603
| [array-type](/docs/guide/usage/linter/rules/typescript/array-type.html) | typescript | | 🛠️ |
602604
| [ban-tslint-comment](/docs/guide/usage/linter/rules/typescript/ban-tslint-comment.html) | typescript | | 🛠️ |

src/docs/guide/usage/linter/rules/eslint/class-methods-use-this.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,54 @@ class C {
4848
}
4949
```
5050

51+
## Configuration
52+
53+
This rule accepts a configuration object with the following properties:
54+
55+
### enforceForClassFields
56+
57+
type: `boolean`
58+
59+
default: `true`
60+
61+
Enforce this rule for class fields that are functions.
62+
63+
### exceptMethods
64+
65+
type: `array`
66+
67+
default: `[]`
68+
69+
List of method names to exempt from this rule.
70+
71+
#### exceptMethods[n]
72+
73+
type: `object`
74+
75+
##### exceptMethods[n].name
76+
77+
type: `string`
78+
79+
##### exceptMethods[n].private
80+
81+
type: `boolean`
82+
83+
### ignoreClassesWithImplements
84+
85+
type: `"all" | "public-fields"`
86+
87+
default: `null`
88+
89+
Whether to ignore classes that implement interfaces.
90+
91+
### ignoreOverrideMethods
92+
93+
type: `boolean`
94+
95+
default: `false`
96+
97+
Whether to ignore methods that are overridden.
98+
5199
## How to use
52100

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

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

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,6 @@ Omitting curly braces can reduce code readability and increase the likelihood of
2525
It can also lead to bugs if additional statements are added later without properly enclosing them in braces.
2626
Using curly braces consistently makes the code safer and easier to modify.
2727

28-
### Options
29-
30-
First option:
31-
32-
- Type: `string`
33-
- Default: `"all"`
34-
- Possible values:
35-
- `"all"`: require braces in all cases
36-
- `"multi"`: require braces only for multi-statement blocks
37-
- `"multi-line"`: require braces only for multi-line blocks
38-
- `"multi-or-nest"`: require braces for multi-line blocks or when nested
39-
40-
Second option:
41-
42-
- Type: `string`
43-
- Default: `undefined`
44-
- Possible values:
45-
- `"consistent"`: require braces if any other branch in the `if-else` chain has braces
46-
47-
Note : The second option can only be used in conjunction with the first option.
48-
49-
Example configuration:
50-
51-
```json
52-
{
53-
"curly": ["error", "multi-or-nest", "consistent"]
54-
}
55-
```
56-
5728
### Examples
5829

5930
#### `"all"` (default)
@@ -254,6 +225,31 @@ if (foo) {
254225
}
255226
```
256227

228+
## Configuration
229+
230+
This rule accepts a configuration object with the following properties:
231+
232+
### consistent
233+
234+
type: `boolean`
235+
236+
default: `false`
237+
238+
Whether to enforce consistent use of curly braces in if-else chains.
239+
240+
### curlyType
241+
242+
type: `"all" | "multi" | "multi-line" | "multi-or-nest"`
243+
244+
default: `"all"`
245+
246+
Which type of curly brace enforcement to use.
247+
248+
- `"all"`: require braces in all cases
249+
- `"multi"`: require braces only for multi-statement blocks
250+
- `"multi-line"`: require braces only for multi-line blocks
251+
- `"multi-or-nest"`: require braces for multi-line blocks or when nested
252+
257253
## How to use
258254

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

src/docs/guide/usage/linter/rules/eslint/grouped-accessor-pairs.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,15 @@ const foo = {
104104
};
105105
```
106106

107-
### Options
107+
## Configuration
108108

109-
This rule accepts two arguments:
109+
This rule accepts a configuration object with the following properties:
110110

111-
1. A string value to control the order of the getter/setter pairs:
112-
- `"anyOrder"` (default): Accessors can be in any order
113-
- `"getBeforeSet"`: Getters must come before setters
114-
- `"setBeforeGet"`: Setters must come before getters
115-
2. An object with the following option:
116-
- `enforceForTSTypes` (boolean, default: false): When enabled, also checks TypeScript interfaces and type aliases for grouped accessor pairs
111+
### enforceForTSTypes
117112

118-
### TypeScript
113+
type: `boolean`
114+
115+
default: `false`
119116

120117
When `enforceForTSTypes` is enabled, this rule also applies to TypeScript interfaces and type aliases:
121118

@@ -151,6 +148,18 @@ type Bar = {
151148
};
152149
```
153150

151+
### pairOrder
152+
153+
type: `"anyOrder" | "getBeforeSet" | "setBeforeGet"`
154+
155+
default: `"anyOrder"`
156+
157+
A string value to control the order of the getter/setter pairs:
158+
159+
- `"anyOrder"`: Accessors can be in any order
160+
- `"getBeforeSet"`: Getters must come before setters
161+
- `"setBeforeGet"`: Setters must come before getters
162+
154163
## How to use
155164

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

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

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,47 +57,43 @@ function foo() {
5757
}
5858
```
5959

60-
### Options
60+
## Configuration
6161

62-
#### max
62+
This rule accepts a configuration object with the following properties:
6363

64-
{ type: number, default: 50 }
64+
### iifes
6565

66-
The `max` enforces a maximum number of lines in a function.
66+
type: `boolean`
6767

68-
#### skipBlankLines
68+
default: `false`
6969

70-
{ type: boolean, default: false }
70+
The `IIFEs` option controls whether IIFEs are included in the line count.
71+
By default, IIFEs are not considered, but when set to `true`, they will
72+
be included in the line count for the function.
7173

72-
The `skipBlankLines` ignore lines made up purely of whitespace.
74+
### max
7375

74-
#### skipComments
76+
type: `integer`
7577

76-
{ type: boolean, default: false }
78+
default: `50`
7779

78-
The `skipComments` ignore lines containing just comments.
80+
Maximum number of lines allowed in a function.
7981

80-
#### IIFEs
82+
### skipBlankLines
8183

82-
{ type: boolean, default: false }
84+
type: `boolean`
8385

84-
The `IIFEs` option controls whether IIFEs are included in the line count.
85-
By default, IIFEs are not considered, but when set to `true`, they will
86-
be included in the line count for the function.
86+
default: `false`
8787

88-
Example:
88+
Skip lines made up purely of whitespace.
8989

90-
```json
91-
"eslint/max-lines-per-function": [
92-
"error",
93-
{
94-
"max": 50,
95-
"skipBlankLines": false,
96-
"skipComments": false,
97-
"IIFEs": false
98-
}
99-
]
100-
```
90+
### skipComments
91+
92+
type: `boolean`
93+
94+
default: `false`
95+
96+
Skip lines containing just comments.
10197

10298
## How to use
10399

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,34 @@ is not an objective maximum number of lines considered acceptable in a
2222
file, most people would agree it should not be in the thousands.
2323
Recommendations usually range from 100 to 500 lines.
2424

25+
## Configuration
26+
27+
This rule accepts a configuration object with the following properties:
28+
29+
### max
30+
31+
type: `integer`
32+
33+
default: `300`
34+
35+
Maximum number of lines allowed per file.
36+
37+
### skipBlankLines
38+
39+
type: `boolean`
40+
41+
default: `false`
42+
43+
Whether to ignore blank lines when counting.
44+
45+
### skipComments
46+
47+
type: `boolean`
48+
49+
default: `false`
50+
51+
Whether to ignore comments when counting.
52+
2553
## How to use
2654

2755
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: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,29 @@ let foo = (bar, baz, qux) => {
5353
};
5454
```
5555

56-
### Options
56+
## Configuration
5757

58-
#### max
58+
This rule accepts a configuration object with the following properties:
5959

60-
`{ "max": number }`
60+
### countVoidThis
6161

62-
This option is for changing the maximum allowed number of function parameters.
62+
type: `boolean`
6363

64-
For example `{ "max": 4 }` would mean that having a function take four
65-
parameters is allowed which overrides the default of three.
66-
67-
#### countVoidThis
68-
69-
`{ "countVoidThis": boolean }`
64+
default: `false`
7065

7166
This option is for counting the `this` parameter if it is of type `void`.
7267

7368
For example `{ "countVoidThis": true }` would mean that having a function
7469
take a `this` parameter of type `void` is counted towards the maximum number of parameters.
7570

71+
### max
72+
73+
type: `integer`
74+
75+
default: `3`
76+
77+
Maximum number of parameters allowed in function definitions.
78+
7679
## How to use
7780

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

0 commit comments

Comments
 (0)