Commit b0cc5de
docs(linter): Add configuration option docs for 4 jest rules (#15172)
Part of #14743.
- jest/no-restricted-matchers
- jest/expect-expect
- jest/no-standalone-expect
- jest/no-restricted-jest-methods
Note for no-restricted-matchers that this is technically incorrect in
that the configuration options do not actually accept a key, it's just a
direct object passed as the first argument. But there's not any way to
represent that right now in the auto-gen system
Generated docs:
```md
## Configuration
This rule accepts a configuration object with the following properties:
### restrictedMatchers
type: `Record<string, string>`
default: `{}`
A map of restricted matchers/modifiers to custom messages.
The key is the matcher/modifier name (e.g., "toBeFalsy", "resolves", "not.toHaveBeenCalledWith").
The value is an optional custom message to display when the matcher/modifier is used.
```
```md
## Configuration
This rule accepts a configuration object with the following properties:
### additionalTestBlockFunctions
type: `string[]`
default: `[]`
An array of function names that should also be treated as test blocks.
### assertFunctionNamesJest
type: `string[]`
default: `["expect"]`
A list of function names that should be treated as assertion functions.
### assertFunctionNamesVitest
type: `string[]`
default: `["expect", "expectTypeOf", "assert", "assertType"]`
A list of function names that should be treated as assertion functions.
```
```md
## Configuration
This rule accepts a configuration object with the following properties:
### restrictedJestMethods
type: `Record<string, string>`
default: `{}`
A mapping of restricted Jest method names to custom messages.
```
```md
## Configuration
This rule accepts a configuration object with the following properties:
### additionalTestBlockFunctions
type: `string[]`
default: `[]`
An array of function names that should also be treated as test blocks.
```
---------
Signed-off-by: Connor Shea <[email protected]>
Co-authored-by: Copilot <[email protected]>1 parent 4dd1a4e commit b0cc5de
File tree
4 files changed
+28
-7
lines changed- crates/oxc_linter/src/rules/jest
- no_standalone_expect
4 files changed
+28
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
| 37 | + | |
35 | 38 | | |
| 39 | + | |
36 | 40 | | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
70 | | - | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| |||
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
94 | | - | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
72 | | - | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
0 commit comments