Commit 1487271
committed
docs(linter): Add config option docs for
Part of #14743.
I also refactored the default definitions a bit to make sure they were simple and matched the usual patterns in the app.
Generated docs:
```md
## Configuration
This rule accepts a configuration object with the following properties:
### checkConstructors
type: `boolean`
default: `false`
Whether to check constructor methods.
### checkDestructured
type: `boolean`
default: `true`
Whether to check destructured parameters.
### checkDestructuredRoots
type: `boolean`
default: `true`
Whether to check destructured parameters when you have code like
`function doSomething({ a, b }) { ... }`. Because there is no named
parameter in this example, when this option is `true` you must
have a `@param` tag that corresponds to `{a, b}`.
### checkGetters
type: `boolean`
default: `true`
Whether to check getter methods.
### checkRestProperty
type: `boolean`
default: `false`
Whether to check rest properties.
### checkSetters
type: `boolean`
default: `true`
Whether to check setter methods.
### checkTypesPattern
type: `string`
default: `"^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$"`
Regex pattern string to match types that exempt parameters from checking.
### exemptedBy
type: `string[]`
default: `["inheritdoc"]`
List of JSDoc tags that exempt functions from `@param` checking.
```
```md
## Configuration
This rule accepts a configuration object with the following properties:
### checkConstructors
type: `boolean`
default: `false`
Whether to check constructor methods.
### checkGetters
type: `boolean`
default: `true`
Whether to check getter methods.
### exemptedBy
type: `string[]`
default: `["inheritdoc"]`
Tags that exempt functions from requiring `@returns`.
### forceRequireReturn
type: `boolean`
default: `false`
Whether to require a `@returns` tag even if the function doesn't return a value.
### forceReturnsWithAsync
type: `boolean`
default: `false`
Whether to require a `@returns` tag for async functions.
```jsdoc/require-param and jsdoc/require-returns rules (#15857)1 parent eea6b26 commit 1487271
File tree
4 files changed
+171
-157
lines changed- crates/oxc_linter
- src
- rules/jsdoc
- snapshots
- tests
4 files changed
+171
-157
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
33 | 77 | | |
34 | 78 | | |
35 | 79 | | |
36 | 80 | | |
37 | 81 | | |
38 | 82 | | |
39 | 83 | | |
40 | | - | |
| 84 | + | |
| 85 | + | |
41 | 86 | | |
42 | 87 | | |
43 | 88 | | |
| |||
55 | 100 | | |
56 | 101 | | |
57 | 102 | | |
| 103 | + | |
58 | 104 | | |
59 | 105 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
| |||
263 | 261 | | |
264 | 262 | | |
265 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
266 | 277 | | |
267 | 278 | | |
268 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
36 | 65 | | |
37 | 66 | | |
38 | 67 | | |
| |||
65 | 94 | | |
66 | 95 | | |
67 | 96 | | |
| 97 | + | |
68 | 98 | | |
69 | 99 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
246 | 252 | | |
247 | 253 | | |
248 | 254 | | |
| |||
0 commit comments