eslint-plugin-jsdoc 44.2.2 → 44.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alignTransform.js +86 -4
- package/dist/alignTransform.js.map +1 -1
- package/dist/exportParser.js +134 -4
- package/dist/exportParser.js.map +1 -1
- package/dist/getDefaultTagStructureForMode.js +71 -62
- package/dist/getDefaultTagStructureForMode.js.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/iterateJsdoc.js +1081 -111
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/jsdocUtils.js +381 -132
- package/dist/jsdocUtils.js.map +1 -1
- package/dist/rules/checkAlignment.js +6 -0
- package/dist/rules/checkAlignment.js.map +1 -1
- package/dist/rules/checkExamples.js +70 -6
- package/dist/rules/checkExamples.js.map +1 -1
- package/dist/rules/checkIndentation.js +11 -1
- package/dist/rules/checkIndentation.js.map +1 -1
- package/dist/rules/checkLineAlignment.js +69 -5
- package/dist/rules/checkLineAlignment.js.map +1 -1
- package/dist/rules/checkParamNames.js +12 -7
- package/dist/rules/checkParamNames.js.map +1 -1
- package/dist/rules/checkPropertyNames.js +13 -7
- package/dist/rules/checkPropertyNames.js.map +1 -1
- package/dist/rules/checkTagNames.js +45 -5
- package/dist/rules/checkTagNames.js.map +1 -1
- package/dist/rules/checkTypes.js +97 -36
- package/dist/rules/checkTypes.js.map +1 -1
- package/dist/rules/checkValues.js +6 -6
- package/dist/rules/checkValues.js.map +1 -1
- package/dist/rules/emptyTags.js +8 -1
- package/dist/rules/emptyTags.js.map +1 -1
- package/dist/rules/informativeDocs.js +26 -7
- package/dist/rules/informativeDocs.js.map +1 -1
- package/dist/rules/matchDescription.js +19 -2
- package/dist/rules/matchDescription.js.map +1 -1
- package/dist/rules/matchName.js +2 -2
- package/dist/rules/matchName.js.map +1 -1
- package/dist/rules/multilineBlocks.js +12 -1
- package/dist/rules/multilineBlocks.js.map +1 -1
- package/dist/rules/noBadBlocks.js +4 -6
- package/dist/rules/noBadBlocks.js.map +1 -1
- package/dist/rules/noBlankBlockDescriptions.js +2 -0
- package/dist/rules/noBlankBlockDescriptions.js.map +1 -1
- package/dist/rules/noMissingSyntax.js +58 -15
- package/dist/rules/noMissingSyntax.js.map +1 -1
- package/dist/rules/noMultiAsterisks.js +1 -6
- package/dist/rules/noMultiAsterisks.js.map +1 -1
- package/dist/rules/noRestrictedSyntax.js +17 -4
- package/dist/rules/noRestrictedSyntax.js.map +1 -1
- package/dist/rules/noTypes.js +3 -0
- package/dist/rules/noTypes.js.map +1 -1
- package/dist/rules/noUndefinedTypes.js +61 -20
- package/dist/rules/noUndefinedTypes.js.map +1 -1
- package/dist/rules/requireAsteriskPrefix.js +20 -0
- package/dist/rules/requireAsteriskPrefix.js.map +1 -1
- package/dist/rules/requireDescription.js +6 -2
- package/dist/rules/requireDescription.js.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.js +73 -10
- package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -1
- package/dist/rules/requireFileOverview.js +9 -4
- package/dist/rules/requireFileOverview.js.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.js +23 -6
- package/dist/rules/requireHyphenBeforeParamDescription.js.map +1 -1
- package/dist/rules/requireJsdoc.js +148 -30
- package/dist/rules/requireJsdoc.js.map +1 -1
- package/dist/rules/requireParam.js +46 -2
- package/dist/rules/requireParam.js.map +1 -1
- package/dist/rules/requireProperty.js +1 -1
- package/dist/rules/requireProperty.js.map +1 -1
- package/dist/rules/requireReturns.js +2 -2
- package/dist/rules/requireReturns.js.map +1 -1
- package/dist/rules/requireReturnsCheck.js +9 -2
- package/dist/rules/requireReturnsCheck.js.map +1 -1
- package/dist/rules/requireThrows.js +2 -2
- package/dist/rules/requireThrows.js.map +1 -1
- package/dist/rules/requireYields.js +9 -2
- package/dist/rules/requireYields.js.map +1 -1
- package/dist/rules/requireYieldsCheck.js +19 -5
- package/dist/rules/requireYieldsCheck.js.map +1 -1
- package/dist/rules/sortTags.js +67 -9
- package/dist/rules/sortTags.js.map +1 -1
- package/dist/rules/tagLines.js +22 -3
- package/dist/rules/tagLines.js.map +1 -1
- package/dist/rules/textEscaping.js +16 -2
- package/dist/rules/textEscaping.js.map +1 -1
- package/dist/rules/validTypes.js +25 -8
- package/dist/rules/validTypes.js.map +1 -1
- package/dist/tagNames.js +27 -0
- package/dist/tagNames.js.map +1 -1
- package/dist/utils/hasReturnValue.js +87 -42
- package/dist/utils/hasReturnValue.js.map +1 -1
- package/docs/rules/check-tag-names.md +15 -0
- package/docs/rules/no-missing-syntax.md +6 -0
- package/docs/rules/no-undefined-types.md +18 -0
- package/docs/rules/require-description-complete-sentence.md +525 -289
- package/docs/rules/require-description.md +289 -525
- package/docs/rules/require-file-overview.md +7 -0
- package/docs/rules/require-jsdoc.md +1 -1
- package/docs/rules/require-param-description.md +116 -1694
- package/docs/rules/require-param-name.md +58 -133
- package/docs/rules/require-param-type.md +119 -55
- package/docs/rules/require-param.md +1700 -111
- package/docs/rules/require-property-description.md +39 -79
- package/docs/rules/require-property-name.md +21 -30
- package/docs/rules/require-property-type.md +21 -21
- package/docs/rules/require-property.md +82 -33
- package/docs/rules/require-returns-check.md +636 -747
- package/docs/rules/require-returns-description.md +61 -933
- package/docs/rules/require-returns-type.md +42 -79
- package/docs/rules/require-returns.md +1081 -61
- package/docs/rules/require-yields-check.md +238 -517
- package/docs/rules/require-yields.md +517 -238
- package/docs/rules/valid-types.md +1 -1
- package/docs/settings.md +1 -1
- package/package.json +13 -5
- package/tsconfig.json +5 -2
|
@@ -1,326 +1,362 @@
|
|
|
1
|
-
<a name="user-content-require-yields"></a>
|
|
2
|
-
<a name="require-yields"></a>
|
|
3
|
-
# <code>require-yields</code>
|
|
1
|
+
<a name="user-content-require-yields-check"></a>
|
|
2
|
+
<a name="require-yields-check"></a>
|
|
3
|
+
# <code>require-yields-check</code>
|
|
4
4
|
|
|
5
|
-
* [Options](#user-content-require-yields-options)
|
|
6
|
-
* [Context and settings](#user-content-require-yields-context-and-settings)
|
|
7
|
-
* [Failing examples](#user-content-require-yields-failing-examples)
|
|
8
|
-
* [Passing examples](#user-content-require-yields-passing-examples)
|
|
5
|
+
* [Options](#user-content-require-yields-check-options)
|
|
6
|
+
* [Context and settings](#user-content-require-yields-check-context-and-settings)
|
|
7
|
+
* [Failing examples](#user-content-require-yields-check-failing-examples)
|
|
8
|
+
* [Passing examples](#user-content-require-yields-check-passing-examples)
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Ensures that if a `@yields` is present that a `yield` (or `yield` with a
|
|
12
|
+
value) is present in the function body (or that if a `@next` is present that
|
|
13
|
+
there is a `yield` with a return value present).
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
Please also note that JavaScript does allow generators not to have `yield`
|
|
16
|
+
(e.g., with just a return or even no explicit return), but if you want to
|
|
17
|
+
enforce that all generators (except wholly empty ones) have a `yield` in the
|
|
18
|
+
function body, you can use the ESLint
|
|
19
|
+
[`require-yield`](https://eslint.org/docs/rules/require-yield) rule. In
|
|
20
|
+
conjunction with this, you can also use the `checkGeneratorsOnly` option
|
|
21
|
+
as an optimization so that this rule won't need to do its own checking within
|
|
22
|
+
function bodies.
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
option to expect a non-standard `@next` tag.
|
|
24
|
+
Will also report if multiple `@yields` tags are present.
|
|
17
25
|
|
|
18
|
-
<a name="user-content-require-yields-options"></a>
|
|
19
|
-
<a name="require-yields-options"></a>
|
|
26
|
+
<a name="user-content-require-yields-check-options"></a>
|
|
27
|
+
<a name="require-yields-check-options"></a>
|
|
20
28
|
## Options
|
|
21
29
|
|
|
22
|
-
- `
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- `
|
|
28
|
-
`@yields`
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
the
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
present and the `forceRequireYields` option is set or if the
|
|
42
|
-
`withGeneratorTag` option is set with a present `@generator` tag
|
|
43
|
-
(since we are not checking against the actual `yield` values in these
|
|
44
|
-
cases).
|
|
45
|
-
- `withGeneratorTag` - If a `@generator` tag is present on a block, require
|
|
46
|
-
`@yields`/`@yield`. Defaults to `true`. See `contexts` to `any` if you want
|
|
47
|
-
to catch `@generator` with `@callback` or such not attached to a function.
|
|
48
|
-
- `next` - If `true`, this option will insist that any use of a `yield` return
|
|
49
|
-
value (e.g., `const rv = yield;` or `const rv = yield value;`) has a
|
|
50
|
-
(non-standard) `@next` tag (in addition to any `@yields` tag) so as to be
|
|
51
|
-
able to document the type expected to be supplied into the iterator
|
|
52
|
-
(the `Generator` iterator that is returned by the call to the generator
|
|
53
|
-
function) to the iterator (e.g., `it.next(value)`). The tag will not be
|
|
54
|
-
expected if the generator function body merely has plain `yield;` or
|
|
55
|
-
`yield value;` statements without returning the values. Defaults to
|
|
56
|
-
`false`.
|
|
57
|
-
- `forceRequireNext` - Set to `true` to always insist on
|
|
58
|
-
`@next` documentation even if there are no `yield` statements in the
|
|
59
|
-
function or none return values. May be desired to flag that a project is
|
|
60
|
-
aware of the expected yield return being `undefined`. Defaults to `false`.
|
|
61
|
-
- `nextWithGeneratorTag` - If a `@generator` tag is present on a block, require
|
|
62
|
-
(non-standard ) `@next` (see `next` option). This will require using `void`
|
|
63
|
-
or `undefined` in cases where generators do not use the `next()`-supplied
|
|
64
|
-
incoming `yield`-returned value. Defaults to `false`. See `contexts` to
|
|
65
|
-
`any` if you want to catch `@generator` with `@callback` or such not
|
|
66
|
-
attached to a function.
|
|
67
|
-
|
|
68
|
-
<a name="user-content-require-yields-context-and-settings"></a>
|
|
69
|
-
<a name="require-yields-context-and-settings"></a>
|
|
30
|
+
- `checkGeneratorsOnly` - Avoids checking the function body and merely insists
|
|
31
|
+
that all generators have `@yields`. This can be an optimization with the
|
|
32
|
+
ESLint `require-yield` rule, as that rule already ensures a `yield` is
|
|
33
|
+
present in generators, albeit assuming the generator is not empty).
|
|
34
|
+
Defaults to `false`.
|
|
35
|
+
- `next` - If `true`, this option will insist that any use of a (non-standard)
|
|
36
|
+
`@next` tag (in addition to any `@yields` tag) will be matched by a `yield`
|
|
37
|
+
which uses a return value in the body of the generator (e.g.,
|
|
38
|
+
`const rv = yield;` or `const rv = yield value;`). This (non-standard)
|
|
39
|
+
tag is intended to be used to indicate a type and/or description of
|
|
40
|
+
the value expected to be supplied by the user when supplied to the iterator
|
|
41
|
+
by its `next` method, as with `it.next(value)` (with the iterator being
|
|
42
|
+
the `Generator` iterator that is returned by the call to the generator
|
|
43
|
+
function). This option will report an error if the generator function body
|
|
44
|
+
merely has plain `yield;` or `yield value;` statements without returning
|
|
45
|
+
the values. Defaults to `false`.
|
|
46
|
+
|
|
47
|
+
<a name="user-content-require-yields-check-context-and-settings"></a>
|
|
48
|
+
<a name="require-yields-check-context-and-settings"></a>
|
|
70
49
|
## Context and settings
|
|
71
50
|
|
|
72
51
|
|||
|
|
73
52
|
|---|---|
|
|
74
|
-
|Context
|
|
53
|
+
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
|
|
75
54
|
|Tags|`yields`|
|
|
76
55
|
|Aliases|`yield`|
|
|
77
56
|
|Recommended|true|
|
|
78
|
-
|
|
|
79
|
-
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
57
|
+
|Options|`checkGeneratorsOnly`|
|
|
80
58
|
|
|
81
|
-
<a name="user-content-require-yields-failing-examples"></a>
|
|
82
|
-
<a name="require-yields-failing-examples"></a>
|
|
59
|
+
<a name="user-content-require-yields-check-failing-examples"></a>
|
|
60
|
+
<a name="require-yields-check-failing-examples"></a>
|
|
83
61
|
## Failing examples
|
|
84
62
|
|
|
85
63
|
The following patterns are considered problems:
|
|
86
64
|
|
|
87
65
|
````js
|
|
88
66
|
/**
|
|
89
|
-
*
|
|
67
|
+
* @yields
|
|
90
68
|
*/
|
|
91
69
|
function * quux (foo) {
|
|
92
70
|
|
|
93
|
-
yield foo;
|
|
94
71
|
}
|
|
95
|
-
// Message:
|
|
72
|
+
// Message: JSDoc @yields declaration present but yield expression not available in function.
|
|
96
73
|
|
|
97
74
|
/**
|
|
98
75
|
* @yields
|
|
99
76
|
*/
|
|
100
|
-
function
|
|
77
|
+
function quux (foo) {
|
|
101
78
|
|
|
102
|
-
const retVal = yield foo;
|
|
103
79
|
}
|
|
104
|
-
// "jsdoc/require-yields": ["error"|"warn", {"
|
|
105
|
-
// Message:
|
|
80
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"checkGeneratorsOnly":true}]
|
|
81
|
+
// Message: JSDoc @yields declaration present but yield expression not available in function.
|
|
106
82
|
|
|
107
83
|
/**
|
|
108
|
-
* @
|
|
84
|
+
* @next
|
|
109
85
|
*/
|
|
110
|
-
function
|
|
86
|
+
function quux (foo) {
|
|
111
87
|
|
|
112
|
-
const retVal = yield;
|
|
113
88
|
}
|
|
114
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
115
|
-
// Message:
|
|
89
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"checkGeneratorsOnly":true,"next":true}]
|
|
90
|
+
// Message: JSDoc @next declaration present but yield expression with return value not available in function.
|
|
116
91
|
|
|
117
92
|
/**
|
|
118
|
-
* @
|
|
93
|
+
* @next {SomeType}
|
|
119
94
|
*/
|
|
120
|
-
function * quux () {
|
|
95
|
+
function * quux (foo) {
|
|
96
|
+
|
|
121
97
|
}
|
|
122
|
-
// "jsdoc/require-yields": ["error"|"warn", {"
|
|
123
|
-
// Message:
|
|
98
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
99
|
+
// Message: JSDoc @next declaration present but yield expression with return value not available in function.
|
|
124
100
|
|
|
125
101
|
/**
|
|
126
|
-
* @
|
|
102
|
+
* @next {SomeType}
|
|
127
103
|
*/
|
|
128
|
-
function * quux () {
|
|
104
|
+
function * quux (foo) {
|
|
129
105
|
yield;
|
|
130
106
|
}
|
|
131
|
-
// "jsdoc/require-yields": ["error"|"warn", {"
|
|
132
|
-
// Message:
|
|
107
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
108
|
+
// Message: JSDoc @next declaration present but yield expression with return value not available in function.
|
|
133
109
|
|
|
134
110
|
/**
|
|
135
|
-
*
|
|
111
|
+
* @next {SomeType}
|
|
136
112
|
*/
|
|
137
113
|
function * quux (foo) {
|
|
138
|
-
|
|
139
|
-
const a = yield foo;
|
|
114
|
+
yield 5;
|
|
140
115
|
}
|
|
141
|
-
//
|
|
116
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
117
|
+
// Message: JSDoc @next declaration present but yield expression with return value not available in function.
|
|
142
118
|
|
|
143
119
|
/**
|
|
144
|
-
*
|
|
120
|
+
* @yield
|
|
145
121
|
*/
|
|
146
122
|
function * quux (foo) {
|
|
147
|
-
|
|
123
|
+
|
|
148
124
|
}
|
|
149
125
|
// Settings: {"jsdoc":{"tagNamePreference":{"yields":"yield"}}}
|
|
150
|
-
// Message:
|
|
126
|
+
// Message: JSDoc @yield declaration present but yield expression not available in function.
|
|
151
127
|
|
|
152
128
|
/**
|
|
153
|
-
* @
|
|
129
|
+
* @yield-returns {Something}
|
|
154
130
|
*/
|
|
155
131
|
function * quux (foo) {
|
|
156
|
-
|
|
132
|
+
yield;
|
|
157
133
|
}
|
|
158
134
|
// Settings: {"jsdoc":{"tagNamePreference":{"next":"yield-returns"}}}
|
|
159
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
160
|
-
// Message:
|
|
135
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
136
|
+
// Message: JSDoc @yield-returns declaration present but yield expression with return value not available in function.
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @yields {undefined} Foo.
|
|
140
|
+
* @yields {String} Foo.
|
|
141
|
+
*/
|
|
142
|
+
function * quux () {
|
|
143
|
+
|
|
144
|
+
yield foo;
|
|
145
|
+
}
|
|
146
|
+
// Message: Found more than one @yields declaration.
|
|
147
|
+
|
|
148
|
+
class Foo {
|
|
149
|
+
/**
|
|
150
|
+
* @yields {string}
|
|
151
|
+
*/
|
|
152
|
+
* bar () {
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Message: JSDoc @yields declaration present but yield expression not available in function.
|
|
161
156
|
|
|
162
157
|
/**
|
|
163
158
|
* @yields
|
|
159
|
+
*/
|
|
160
|
+
function * quux () {
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
// Settings: {"jsdoc":{"tagNamePreference":{"yields":false}}}
|
|
164
|
+
// Message: Unexpected tag `@yields`
|
|
165
|
+
|
|
166
|
+
/**
|
|
164
167
|
* @next
|
|
165
168
|
*/
|
|
166
169
|
function * quux () {
|
|
167
|
-
|
|
170
|
+
|
|
168
171
|
}
|
|
169
172
|
// Settings: {"jsdoc":{"tagNamePreference":{"next":false}}}
|
|
170
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
173
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
171
174
|
// Message: Unexpected tag `@next`
|
|
172
175
|
|
|
173
176
|
/**
|
|
174
|
-
*
|
|
177
|
+
* @yields {string}
|
|
175
178
|
*/
|
|
176
|
-
function *
|
|
177
|
-
|
|
179
|
+
function * f () {
|
|
180
|
+
function * g() {
|
|
181
|
+
yield 'foo'
|
|
182
|
+
}
|
|
178
183
|
}
|
|
179
|
-
//
|
|
180
|
-
// Message: Missing JSDoc @yields declaration.
|
|
184
|
+
// Message: JSDoc @yields declaration present but yield expression not available in function.
|
|
181
185
|
|
|
182
186
|
/**
|
|
183
|
-
*
|
|
187
|
+
* @yields {Promise<void>}
|
|
184
188
|
*/
|
|
185
|
-
function * quux() {
|
|
186
|
-
|
|
189
|
+
async function * quux() {}
|
|
190
|
+
// Message: JSDoc @yields declaration present but yield expression not available in function.
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @yields {Promise<void>}
|
|
194
|
+
*/
|
|
195
|
+
const quux = async function * () {}
|
|
196
|
+
// Message: JSDoc @yields declaration present but yield expression not available in function.
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @yields {never} Foo.
|
|
200
|
+
*/
|
|
201
|
+
function * quux () {
|
|
202
|
+
yield 5;
|
|
187
203
|
}
|
|
188
|
-
//
|
|
189
|
-
// Message: Missing JSDoc @yields declaration.
|
|
204
|
+
// Message: JSDoc @yields declaration set with "never" but yield expression is present in function.
|
|
190
205
|
|
|
191
206
|
/**
|
|
192
|
-
*
|
|
207
|
+
* @next {never}
|
|
193
208
|
*/
|
|
194
|
-
|
|
195
|
-
yield;
|
|
209
|
+
function * quux (foo) {
|
|
210
|
+
const a = yield;
|
|
196
211
|
}
|
|
197
|
-
// "jsdoc/require-yields": ["error"|"warn", {"
|
|
198
|
-
// Message:
|
|
212
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
213
|
+
// Message: JSDoc @next declaration set with "never" but yield expression with return value is present in function.
|
|
214
|
+
````
|
|
199
215
|
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
<a name="user-content-require-yields-check-passing-examples"></a>
|
|
219
|
+
<a name="require-yields-check-passing-examples"></a>
|
|
220
|
+
## Passing examples
|
|
221
|
+
|
|
222
|
+
The following patterns are not considered problems:
|
|
223
|
+
|
|
224
|
+
````js
|
|
200
225
|
/**
|
|
201
|
-
*
|
|
226
|
+
* @yields Foo.
|
|
202
227
|
*/
|
|
203
|
-
|
|
204
|
-
|
|
228
|
+
function * quux () {
|
|
229
|
+
|
|
230
|
+
yield foo;
|
|
205
231
|
}
|
|
206
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
207
|
-
// Message: Missing JSDoc @yields declaration.
|
|
208
232
|
|
|
209
233
|
/**
|
|
210
|
-
*
|
|
234
|
+
* @yields {string} Foo.
|
|
211
235
|
*/
|
|
212
236
|
function * quux () {
|
|
213
|
-
|
|
237
|
+
|
|
238
|
+
yield foo;
|
|
214
239
|
}
|
|
215
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"forceRequireYields":true}]
|
|
216
|
-
// Message: Missing JSDoc @yields declaration.
|
|
217
240
|
|
|
218
241
|
/**
|
|
219
|
-
* @
|
|
220
|
-
* @generator
|
|
242
|
+
* @yields {string} Foo.
|
|
221
243
|
*/
|
|
222
|
-
|
|
223
|
-
|
|
244
|
+
function * quux () {
|
|
245
|
+
|
|
246
|
+
yield foo;
|
|
247
|
+
}
|
|
224
248
|
|
|
225
249
|
/**
|
|
226
|
-
*
|
|
227
|
-
* @generator
|
|
250
|
+
*
|
|
228
251
|
*/
|
|
229
|
-
|
|
230
|
-
|
|
252
|
+
function * quux () {
|
|
253
|
+
}
|
|
231
254
|
|
|
232
255
|
/**
|
|
233
|
-
* @yields {undefined}
|
|
234
|
-
* @yields {void}
|
|
256
|
+
* @yields {undefined} Foo.
|
|
235
257
|
*/
|
|
236
|
-
function * quux (
|
|
258
|
+
function * quux () {}
|
|
237
259
|
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
|
|
260
|
+
/**
|
|
261
|
+
* @yields { void } Foo.
|
|
262
|
+
*/
|
|
263
|
+
function quux () {}
|
|
241
264
|
|
|
242
265
|
/**
|
|
243
|
-
* @yields
|
|
266
|
+
* @yields Foo.
|
|
267
|
+
* @abstract
|
|
244
268
|
*/
|
|
245
269
|
function * quux () {
|
|
246
|
-
|
|
270
|
+
throw new Error('must be implemented by subclass!');
|
|
247
271
|
}
|
|
248
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"yields":false}}}
|
|
249
|
-
// Message: Unexpected tag `@yields`
|
|
250
272
|
|
|
251
273
|
/**
|
|
252
|
-
* @
|
|
274
|
+
* @yields Foo.
|
|
275
|
+
* @virtual
|
|
253
276
|
*/
|
|
254
|
-
function * quux (
|
|
255
|
-
|
|
277
|
+
function * quux () {
|
|
278
|
+
throw new Error('must be implemented by subclass!');
|
|
256
279
|
}
|
|
257
|
-
// "jsdoc/require-yields": ["error"|"warn", {"exemptedBy":["notPresent"]}]
|
|
258
|
-
// Message: Missing JSDoc @yields declaration.
|
|
259
280
|
|
|
260
281
|
/**
|
|
261
|
-
* @
|
|
282
|
+
* @yields Foo.
|
|
283
|
+
* @constructor
|
|
262
284
|
*/
|
|
263
|
-
|
|
264
|
-
return;
|
|
285
|
+
function * quux () {
|
|
265
286
|
}
|
|
266
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
267
|
-
// Message: Missing JSDoc @yields declaration.
|
|
268
287
|
|
|
269
288
|
/**
|
|
270
|
-
* @
|
|
289
|
+
* @interface
|
|
271
290
|
*/
|
|
272
|
-
|
|
273
|
-
|
|
291
|
+
class Foo {
|
|
292
|
+
/**
|
|
293
|
+
* @yields {string}
|
|
294
|
+
*/
|
|
295
|
+
* bar () {
|
|
296
|
+
}
|
|
274
297
|
}
|
|
275
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
276
|
-
// Message: Missing JSDoc @yields declaration.
|
|
277
298
|
|
|
278
|
-
|
|
299
|
+
/**
|
|
300
|
+
* @record
|
|
301
|
+
*/
|
|
302
|
+
class Foo {
|
|
279
303
|
/**
|
|
280
|
-
*
|
|
304
|
+
* @yields {string}
|
|
281
305
|
*/
|
|
282
|
-
*
|
|
283
|
-
yield;
|
|
306
|
+
* bar () {
|
|
284
307
|
}
|
|
285
308
|
}
|
|
286
|
-
// "jsdoc
|
|
287
|
-
// Message: Missing JSDoc @yields declaration.
|
|
309
|
+
// Settings: {"jsdoc":{"mode":"closure"}}
|
|
288
310
|
|
|
289
311
|
/**
|
|
290
|
-
* @
|
|
312
|
+
* @yields {undefined} Foo.
|
|
291
313
|
*/
|
|
292
|
-
|
|
293
|
-
yield Promise.all(a);
|
|
314
|
+
function * quux () {
|
|
294
315
|
}
|
|
295
|
-
// Message: Missing JSDoc @yields declaration.
|
|
296
316
|
|
|
297
317
|
/**
|
|
298
|
-
* @
|
|
318
|
+
* @yields {void} Foo.
|
|
299
319
|
*/
|
|
300
|
-
|
|
301
|
-
|
|
320
|
+
function * quux () {
|
|
321
|
+
}
|
|
302
322
|
|
|
303
323
|
/**
|
|
304
|
-
* @
|
|
305
|
-
|
|
324
|
+
* @yields {never} Foo.
|
|
325
|
+
*/
|
|
326
|
+
function * quux () {
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @yields {void} Foo.
|
|
306
331
|
*/
|
|
307
|
-
|
|
308
|
-
|
|
332
|
+
function * quux () {
|
|
333
|
+
yield undefined;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* @yields {void} Foo.
|
|
338
|
+
*/
|
|
339
|
+
function * quux () {
|
|
340
|
+
yield;
|
|
341
|
+
}
|
|
309
342
|
|
|
310
343
|
/**
|
|
311
344
|
*
|
|
312
345
|
*/
|
|
313
346
|
function * quux () {
|
|
314
|
-
|
|
315
|
-
yield;
|
|
316
|
-
}
|
|
317
|
-
yield true;
|
|
347
|
+
yield undefined;
|
|
318
348
|
}
|
|
319
|
-
// Message: Missing JSDoc @yields declaration.
|
|
320
349
|
|
|
321
350
|
/**
|
|
322
351
|
*
|
|
323
352
|
*/
|
|
353
|
+
function * quux () {
|
|
354
|
+
yield;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @yields {true}
|
|
359
|
+
*/
|
|
324
360
|
function * quux () {
|
|
325
361
|
try {
|
|
326
362
|
yield true;
|
|
@@ -328,10 +364,9 @@ function * quux () {
|
|
|
328
364
|
}
|
|
329
365
|
yield;
|
|
330
366
|
}
|
|
331
|
-
// Message: Missing JSDoc @yields declaration.
|
|
332
367
|
|
|
333
368
|
/**
|
|
334
|
-
*
|
|
369
|
+
* @yields {true}
|
|
335
370
|
*/
|
|
336
371
|
function * quux () {
|
|
337
372
|
try {
|
|
@@ -340,10 +375,9 @@ function * quux () {
|
|
|
340
375
|
}
|
|
341
376
|
yield;
|
|
342
377
|
}
|
|
343
|
-
// Message: Missing JSDoc @yields declaration.
|
|
344
378
|
|
|
345
379
|
/**
|
|
346
|
-
*
|
|
380
|
+
* @yields {true}
|
|
347
381
|
*/
|
|
348
382
|
function * quux () {
|
|
349
383
|
try {
|
|
@@ -352,10 +386,9 @@ function * quux () {
|
|
|
352
386
|
}
|
|
353
387
|
yield true;
|
|
354
388
|
}
|
|
355
|
-
// Message: Missing JSDoc @yields declaration.
|
|
356
389
|
|
|
357
390
|
/**
|
|
358
|
-
*
|
|
391
|
+
* @yields {true}
|
|
359
392
|
*/
|
|
360
393
|
function * quux () {
|
|
361
394
|
try {
|
|
@@ -365,10 +398,9 @@ function * quux () {
|
|
|
365
398
|
}
|
|
366
399
|
yield;
|
|
367
400
|
}
|
|
368
|
-
// Message: Missing JSDoc @yields declaration.
|
|
369
401
|
|
|
370
402
|
/**
|
|
371
|
-
*
|
|
403
|
+
* @yields {true}
|
|
372
404
|
*/
|
|
373
405
|
function * quux () {
|
|
374
406
|
switch (true) {
|
|
@@ -377,10 +409,9 @@ function * quux () {
|
|
|
377
409
|
}
|
|
378
410
|
yield;
|
|
379
411
|
}
|
|
380
|
-
// Message: Missing JSDoc @yields declaration.
|
|
381
412
|
|
|
382
413
|
/**
|
|
383
|
-
*
|
|
414
|
+
* @yields {true}
|
|
384
415
|
*/
|
|
385
416
|
function * quux () {
|
|
386
417
|
switch (true) {
|
|
@@ -389,10 +420,9 @@ function * quux () {
|
|
|
389
420
|
}
|
|
390
421
|
yield true;
|
|
391
422
|
}
|
|
392
|
-
// Message: Missing JSDoc @yields declaration.
|
|
393
423
|
|
|
394
424
|
/**
|
|
395
|
-
*
|
|
425
|
+
* @yields {true}
|
|
396
426
|
*/
|
|
397
427
|
function * quux () {
|
|
398
428
|
for (const i of abc) {
|
|
@@ -400,40 +430,36 @@ function * quux () {
|
|
|
400
430
|
}
|
|
401
431
|
yield;
|
|
402
432
|
}
|
|
403
|
-
// Message: Missing JSDoc @yields declaration.
|
|
404
433
|
|
|
405
434
|
/**
|
|
406
|
-
*
|
|
435
|
+
* @yields {true}
|
|
407
436
|
*/
|
|
408
437
|
function * quux () {
|
|
409
438
|
for (const a in b) {
|
|
410
439
|
yield true;
|
|
411
440
|
}
|
|
412
441
|
}
|
|
413
|
-
// Message: Missing JSDoc @yields declaration.
|
|
414
442
|
|
|
415
443
|
/**
|
|
416
|
-
*
|
|
444
|
+
* @yields {true}
|
|
417
445
|
*/
|
|
418
446
|
function * quux () {
|
|
419
447
|
for (let i=0; i<n; i+=1) {
|
|
420
448
|
yield true;
|
|
421
449
|
}
|
|
422
450
|
}
|
|
423
|
-
// Message: Missing JSDoc @yields declaration.
|
|
424
451
|
|
|
425
452
|
/**
|
|
426
|
-
*
|
|
453
|
+
* @yields {true}
|
|
427
454
|
*/
|
|
428
455
|
function * quux () {
|
|
429
456
|
while(true) {
|
|
430
457
|
yield true
|
|
431
458
|
}
|
|
432
459
|
}
|
|
433
|
-
// Message: Missing JSDoc @yields declaration.
|
|
434
460
|
|
|
435
461
|
/**
|
|
436
|
-
*
|
|
462
|
+
* @yields {true}
|
|
437
463
|
*/
|
|
438
464
|
function * quux () {
|
|
439
465
|
do {
|
|
@@ -441,10 +467,9 @@ function * quux () {
|
|
|
441
467
|
}
|
|
442
468
|
while(true)
|
|
443
469
|
}
|
|
444
|
-
// Message: Missing JSDoc @yields declaration.
|
|
445
470
|
|
|
446
471
|
/**
|
|
447
|
-
*
|
|
472
|
+
* @yields {true}
|
|
448
473
|
*/
|
|
449
474
|
function * quux () {
|
|
450
475
|
if (true) {
|
|
@@ -452,20 +477,18 @@ function * quux () {
|
|
|
452
477
|
}
|
|
453
478
|
yield true;
|
|
454
479
|
}
|
|
455
|
-
// Message: Missing JSDoc @yields declaration.
|
|
456
480
|
|
|
457
481
|
/**
|
|
458
|
-
*
|
|
482
|
+
* @yields {true}
|
|
459
483
|
*/
|
|
460
484
|
function * quux () {
|
|
461
485
|
if (true) {
|
|
462
486
|
yield true;
|
|
463
487
|
}
|
|
464
488
|
}
|
|
465
|
-
// Message: Missing JSDoc @yields declaration.
|
|
466
489
|
|
|
467
490
|
/**
|
|
468
|
-
*
|
|
491
|
+
* @yields {true}
|
|
469
492
|
*/
|
|
470
493
|
function * quux () {
|
|
471
494
|
var a = {};
|
|
@@ -473,10 +496,9 @@ function * quux () {
|
|
|
473
496
|
yield true;
|
|
474
497
|
}
|
|
475
498
|
}
|
|
476
|
-
// Message: Missing JSDoc @yields declaration.
|
|
477
499
|
|
|
478
500
|
/**
|
|
479
|
-
*
|
|
501
|
+
* @yields {true}
|
|
480
502
|
*/
|
|
481
503
|
function * quux () {
|
|
482
504
|
if (true) {
|
|
@@ -486,338 +508,37 @@ function * quux () {
|
|
|
486
508
|
}
|
|
487
509
|
yield;
|
|
488
510
|
}
|
|
489
|
-
// Message: Missing JSDoc @yields declaration.
|
|
490
|
-
````
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
<a name="user-content-require-yields-passing-examples"></a>
|
|
495
|
-
<a name="require-yields-passing-examples"></a>
|
|
496
|
-
## Passing examples
|
|
497
|
-
|
|
498
|
-
The following patterns are not considered problems:
|
|
499
|
-
|
|
500
|
-
````js
|
|
501
|
-
/**
|
|
502
|
-
* @yields Foo.
|
|
503
|
-
*/
|
|
504
|
-
function * quux () {
|
|
505
|
-
|
|
506
|
-
yield foo;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* @yields Foo.
|
|
511
|
-
*/
|
|
512
|
-
function * quux () {
|
|
513
|
-
|
|
514
|
-
yield foo;
|
|
515
|
-
}
|
|
516
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"]}]
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
*
|
|
520
|
-
*/
|
|
521
|
-
function * quux () {
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
*
|
|
526
|
-
*/
|
|
527
|
-
function * quux () {
|
|
528
|
-
yield;
|
|
529
|
-
}
|
|
530
511
|
|
|
531
512
|
/**
|
|
532
|
-
*
|
|
533
|
-
*/
|
|
534
|
-
function quux (bar) {
|
|
535
|
-
bar.doSomething(function * (baz) {
|
|
536
|
-
yield baz.corge();
|
|
537
|
-
})
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* @yields {Array}
|
|
542
|
-
*/
|
|
543
|
-
function * quux (bar) {
|
|
544
|
-
yield bar.doSomething(function * (baz) {
|
|
545
|
-
yield baz.corge();
|
|
546
|
-
})
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* @inheritdoc
|
|
551
|
-
*/
|
|
552
|
-
function * quux (foo) {
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* @override
|
|
557
|
-
*/
|
|
558
|
-
function * quux (foo) {
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* @constructor
|
|
563
|
-
*/
|
|
564
|
-
function * quux (foo) {
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* @implements
|
|
569
|
-
*/
|
|
570
|
-
function * quux (foo) {
|
|
571
|
-
yield;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* @override
|
|
576
|
-
*/
|
|
577
|
-
function * quux (foo) {
|
|
578
|
-
|
|
579
|
-
yield foo;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* @class
|
|
584
|
-
*/
|
|
585
|
-
function * quux (foo) {
|
|
586
|
-
yield foo;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* @constructor
|
|
591
|
-
*/
|
|
592
|
-
function * quux (foo) {
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
* @yields {object}
|
|
597
|
-
*/
|
|
598
|
-
function * quux () {
|
|
599
|
-
|
|
600
|
-
yield {a: foo};
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
/**
|
|
604
|
-
* @yields {void}
|
|
605
|
-
*/
|
|
606
|
-
function * quux () {
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* @yields {undefined}
|
|
611
|
-
*/
|
|
612
|
-
function * quux () {
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
*
|
|
617
|
-
*/
|
|
618
|
-
function * quux () {
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* @yields {void}
|
|
623
|
-
*/
|
|
624
|
-
function quux () {
|
|
625
|
-
}
|
|
626
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* @yields {void}
|
|
630
513
|
* @next {void}
|
|
631
514
|
*/
|
|
632
|
-
function * quux () {
|
|
633
|
-
}
|
|
634
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireNext":true}]
|
|
635
|
-
|
|
636
|
-
/**
|
|
637
|
-
* @yields {void}
|
|
638
|
-
*/
|
|
639
|
-
function * quux () {
|
|
640
|
-
yield undefined;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* @yields {void}
|
|
645
|
-
*/
|
|
646
|
-
function * quux () {
|
|
647
|
-
yield undefined;
|
|
648
|
-
}
|
|
649
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* @yields {void}
|
|
653
|
-
*/
|
|
654
|
-
function * quux () {
|
|
655
|
-
yield;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* @yields {void}
|
|
660
|
-
*/
|
|
661
|
-
function * quux () {
|
|
662
|
-
}
|
|
663
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* @yields {void}
|
|
667
|
-
*/
|
|
668
|
-
function * quux () {
|
|
669
|
-
yield;
|
|
670
|
-
}
|
|
671
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
672
|
-
|
|
673
|
-
/** @type {SpecialIterator} */
|
|
674
|
-
function * quux () {
|
|
675
|
-
yield 5;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* @yields {Something}
|
|
680
|
-
*/
|
|
681
|
-
async function * quux () {
|
|
682
|
-
}
|
|
683
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
684
|
-
|
|
685
|
-
/**
|
|
686
|
-
*
|
|
687
|
-
*/
|
|
688
|
-
async function * quux () {}
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
*
|
|
692
|
-
*/
|
|
693
|
-
const quux = async function * () {}
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* @type {MyCallback}
|
|
697
|
-
*/
|
|
698
|
-
function * quux () {
|
|
699
|
-
yield;
|
|
700
|
-
}
|
|
701
|
-
// "jsdoc/require-yields": ["error"|"warn", {"exemptedBy":["type"]}]
|
|
702
|
-
|
|
703
|
-
/**
|
|
704
|
-
* @param {array} a
|
|
705
|
-
*/
|
|
706
|
-
async function * foo (a) {
|
|
707
|
-
yield;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
*
|
|
712
|
-
*/
|
|
713
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"]}]
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* @function
|
|
717
|
-
*/
|
|
718
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"]}]
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* @function
|
|
722
|
-
*/
|
|
723
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* @callback
|
|
727
|
-
*/
|
|
728
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* @generator
|
|
732
|
-
*/
|
|
733
|
-
// "jsdoc/require-yields": ["error"|"warn", {"withGeneratorTag":true}]
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* @generator
|
|
737
|
-
*/
|
|
738
|
-
// "jsdoc/require-yields": ["error"|"warn", {"nextWithGeneratorTag":true}]
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* @generator
|
|
742
|
-
* @yields
|
|
743
|
-
*/
|
|
744
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"withGeneratorTag":true}]
|
|
745
|
-
|
|
746
|
-
/**
|
|
747
|
-
* @generator
|
|
748
|
-
* @yields
|
|
749
|
-
* @next
|
|
750
|
-
*/
|
|
751
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"nextWithGeneratorTag":true}]
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* @generator
|
|
755
|
-
*/
|
|
756
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"withGeneratorTag":false}]
|
|
757
|
-
|
|
758
|
-
/**
|
|
759
|
-
* @generator
|
|
760
|
-
* @yields
|
|
761
|
-
*/
|
|
762
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"nextWithGeneratorTag":false}]
|
|
763
|
-
|
|
764
|
-
/**
|
|
765
|
-
* @yields
|
|
766
|
-
*/
|
|
767
515
|
function * quux (foo) {
|
|
768
516
|
|
|
769
|
-
const a = yield foo;
|
|
770
517
|
}
|
|
518
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
771
519
|
|
|
772
520
|
/**
|
|
773
|
-
* @
|
|
774
|
-
* @next
|
|
521
|
+
* @next {SomeType}
|
|
775
522
|
*/
|
|
776
523
|
function * quux (foo) {
|
|
777
|
-
|
|
524
|
+
const a = yield;
|
|
778
525
|
}
|
|
779
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
526
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
780
527
|
|
|
781
528
|
/**
|
|
782
|
-
* @
|
|
783
|
-
* @next
|
|
529
|
+
* @next {SomeType}
|
|
784
530
|
*/
|
|
785
531
|
function * quux (foo) {
|
|
786
|
-
const a = yield
|
|
787
|
-
}
|
|
788
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
789
|
-
|
|
790
|
-
/**
|
|
791
|
-
*
|
|
792
|
-
*/
|
|
793
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"nextWithGeneratorTag":true}]
|
|
794
|
-
|
|
795
|
-
/**
|
|
796
|
-
*
|
|
797
|
-
*/
|
|
798
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"next":true}]
|
|
799
|
-
|
|
800
|
-
/**
|
|
801
|
-
*
|
|
802
|
-
*/
|
|
803
|
-
function quux () {}
|
|
804
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"next":true}]
|
|
805
|
-
|
|
806
|
-
/**
|
|
807
|
-
* @yields {void}
|
|
808
|
-
*/
|
|
809
|
-
function * quux () {
|
|
810
|
-
yield;
|
|
532
|
+
const a = yield 5;
|
|
811
533
|
}
|
|
812
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
534
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
813
535
|
|
|
814
536
|
/**
|
|
815
|
-
*
|
|
537
|
+
* @next {never}
|
|
816
538
|
*/
|
|
817
539
|
function * quux (foo) {
|
|
818
|
-
|
|
819
|
-
yield foo;
|
|
820
|
-
}
|
|
540
|
+
|
|
821
541
|
}
|
|
542
|
+
// "jsdoc/require-yields-check": ["error"|"warn", {"next":true}]
|
|
822
543
|
````
|
|
823
544
|
|