eslint-plugin-jsdoc 46.4.6 → 46.5.1
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/README.md +31 -0
- package/dist/index.js +21 -10
- package/dist/index.js.map +1 -1
- package/dist/jsdocUtils.js +1 -1
- package/dist/jsdocUtils.js.map +1 -1
- package/dist/rules/matchDescription.js +1 -1
- package/dist/rules/matchDescription.js.map +1 -1
- package/package.json +14 -12
- package/dist/WarnSettings.d.ts +0 -17
- package/dist/WarnSettings.d.ts.map +0 -1
- package/dist/alignTransform.d.ts +0 -32
- package/dist/alignTransform.d.ts.map +0 -1
- package/dist/defaultTagOrder.d.ts +0 -5
- package/dist/defaultTagOrder.d.ts.map +0 -1
- package/dist/exportParser.d.ts +0 -41
- package/dist/exportParser.d.ts.map +0 -1
- package/dist/getDefaultTagStructureForMode.d.ts +0 -11
- package/dist/getDefaultTagStructureForMode.d.ts.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/iterateJsdoc.d.ts +0 -460
- package/dist/iterateJsdoc.d.ts.map +0 -1
- package/dist/jsdocUtils.d.ts +0 -421
- package/dist/jsdocUtils.d.ts.map +0 -1
- package/dist/rules/checkAccess.d.ts +0 -3
- package/dist/rules/checkAccess.d.ts.map +0 -1
- package/dist/rules/checkAlignment.d.ts +0 -3
- package/dist/rules/checkAlignment.d.ts.map +0 -1
- package/dist/rules/checkExamples.d.ts +0 -4
- package/dist/rules/checkExamples.d.ts.map +0 -1
- package/dist/rules/checkIndentation.d.ts +0 -3
- package/dist/rules/checkIndentation.d.ts.map +0 -1
- package/dist/rules/checkLineAlignment.d.ts +0 -10
- package/dist/rules/checkLineAlignment.d.ts.map +0 -1
- package/dist/rules/checkParamNames.d.ts +0 -3
- package/dist/rules/checkParamNames.d.ts.map +0 -1
- package/dist/rules/checkPropertyNames.d.ts +0 -3
- package/dist/rules/checkPropertyNames.d.ts.map +0 -1
- package/dist/rules/checkSyntax.d.ts +0 -3
- package/dist/rules/checkSyntax.d.ts.map +0 -1
- package/dist/rules/checkTagNames.d.ts +0 -3
- package/dist/rules/checkTagNames.d.ts.map +0 -1
- package/dist/rules/checkTypes.d.ts +0 -3
- package/dist/rules/checkTypes.d.ts.map +0 -1
- package/dist/rules/checkValues.d.ts +0 -3
- package/dist/rules/checkValues.d.ts.map +0 -1
- package/dist/rules/emptyTags.d.ts +0 -3
- package/dist/rules/emptyTags.d.ts.map +0 -1
- package/dist/rules/implementsOnClasses.d.ts +0 -3
- package/dist/rules/implementsOnClasses.d.ts.map +0 -1
- package/dist/rules/importsAsDependencies.d.ts +0 -3
- package/dist/rules/importsAsDependencies.d.ts.map +0 -1
- package/dist/rules/informativeDocs.d.ts +0 -3
- package/dist/rules/informativeDocs.d.ts.map +0 -1
- package/dist/rules/matchDescription.d.ts +0 -3
- package/dist/rules/matchDescription.d.ts.map +0 -1
- package/dist/rules/matchName.d.ts +0 -3
- package/dist/rules/matchName.d.ts.map +0 -1
- package/dist/rules/multilineBlocks.d.ts +0 -3
- package/dist/rules/multilineBlocks.d.ts.map +0 -1
- package/dist/rules/noBadBlocks.d.ts +0 -3
- package/dist/rules/noBadBlocks.d.ts.map +0 -1
- package/dist/rules/noBlankBlockDescriptions.d.ts +0 -3
- package/dist/rules/noBlankBlockDescriptions.d.ts.map +0 -1
- package/dist/rules/noBlankBlocks.d.ts +0 -3
- package/dist/rules/noBlankBlocks.d.ts.map +0 -1
- package/dist/rules/noDefaults.d.ts +0 -3
- package/dist/rules/noDefaults.d.ts.map +0 -1
- package/dist/rules/noMissingSyntax.d.ts +0 -10
- package/dist/rules/noMissingSyntax.d.ts.map +0 -1
- package/dist/rules/noMultiAsterisks.d.ts +0 -3
- package/dist/rules/noMultiAsterisks.d.ts.map +0 -1
- package/dist/rules/noRestrictedSyntax.d.ts +0 -3
- package/dist/rules/noRestrictedSyntax.d.ts.map +0 -1
- package/dist/rules/noTypes.d.ts +0 -3
- package/dist/rules/noTypes.d.ts.map +0 -1
- package/dist/rules/noUndefinedTypes.d.ts +0 -3
- package/dist/rules/noUndefinedTypes.d.ts.map +0 -1
- package/dist/rules/requireAsteriskPrefix.d.ts +0 -3
- package/dist/rules/requireAsteriskPrefix.d.ts.map +0 -1
- package/dist/rules/requireDescription.d.ts +0 -3
- package/dist/rules/requireDescription.d.ts.map +0 -1
- package/dist/rules/requireDescriptionCompleteSentence.d.ts +0 -3
- package/dist/rules/requireDescriptionCompleteSentence.d.ts.map +0 -1
- package/dist/rules/requireExample.d.ts +0 -3
- package/dist/rules/requireExample.d.ts.map +0 -1
- package/dist/rules/requireFileOverview.d.ts +0 -3
- package/dist/rules/requireFileOverview.d.ts.map +0 -1
- package/dist/rules/requireHyphenBeforeParamDescription.d.ts +0 -3
- package/dist/rules/requireHyphenBeforeParamDescription.d.ts.map +0 -1
- package/dist/rules/requireJsdoc.d.ts +0 -9
- package/dist/rules/requireJsdoc.d.ts.map +0 -1
- package/dist/rules/requireParam.d.ts +0 -4
- package/dist/rules/requireParam.d.ts.map +0 -1
- package/dist/rules/requireParamDescription.d.ts +0 -3
- package/dist/rules/requireParamDescription.d.ts.map +0 -1
- package/dist/rules/requireParamName.d.ts +0 -3
- package/dist/rules/requireParamName.d.ts.map +0 -1
- package/dist/rules/requireParamType.d.ts +0 -3
- package/dist/rules/requireParamType.d.ts.map +0 -1
- package/dist/rules/requireProperty.d.ts +0 -3
- package/dist/rules/requireProperty.d.ts.map +0 -1
- package/dist/rules/requirePropertyDescription.d.ts +0 -3
- package/dist/rules/requirePropertyDescription.d.ts.map +0 -1
- package/dist/rules/requirePropertyName.d.ts +0 -3
- package/dist/rules/requirePropertyName.d.ts.map +0 -1
- package/dist/rules/requirePropertyType.d.ts +0 -3
- package/dist/rules/requirePropertyType.d.ts.map +0 -1
- package/dist/rules/requireReturns.d.ts +0 -3
- package/dist/rules/requireReturns.d.ts.map +0 -1
- package/dist/rules/requireReturnsCheck.d.ts +0 -3
- package/dist/rules/requireReturnsCheck.d.ts.map +0 -1
- package/dist/rules/requireReturnsDescription.d.ts +0 -3
- package/dist/rules/requireReturnsDescription.d.ts.map +0 -1
- package/dist/rules/requireReturnsType.d.ts +0 -3
- package/dist/rules/requireReturnsType.d.ts.map +0 -1
- package/dist/rules/requireThrows.d.ts +0 -3
- package/dist/rules/requireThrows.d.ts.map +0 -1
- package/dist/rules/requireYields.d.ts +0 -3
- package/dist/rules/requireYields.d.ts.map +0 -1
- package/dist/rules/requireYieldsCheck.d.ts +0 -3
- package/dist/rules/requireYieldsCheck.d.ts.map +0 -1
- package/dist/rules/sortTags.d.ts +0 -3
- package/dist/rules/sortTags.d.ts.map +0 -1
- package/dist/rules/tagLines.d.ts +0 -3
- package/dist/rules/tagLines.d.ts.map +0 -1
- package/dist/rules/textEscaping.d.ts +0 -3
- package/dist/rules/textEscaping.d.ts.map +0 -1
- package/dist/rules/validTypes.d.ts +0 -3
- package/dist/rules/validTypes.d.ts.map +0 -1
- package/dist/tagNames.d.ts +0 -16
- package/dist/tagNames.d.ts.map +0 -1
- package/dist/utils/hasReturnValue.d.ts +0 -20
- package/dist/utils/hasReturnValue.d.ts.map +0 -1
- package/docs/advanced.md +0 -102
- package/docs/rules/check-access.md +0 -193
- package/docs/rules/check-alignment.md +0 -169
- package/docs/rules/check-examples.md +0 -784
- package/docs/rules/check-indentation.md +0 -296
- package/docs/rules/check-line-alignment.md +0 -1002
- package/docs/rules/check-param-names.md +0 -1035
- package/docs/rules/check-property-names.md +0 -244
- package/docs/rules/check-syntax.md +0 -80
- package/docs/rules/check-tag-names.md +0 -1132
- package/docs/rules/check-types.md +0 -1198
- package/docs/rules/check-values.md +0 -409
- package/docs/rules/empty-tags.md +0 -220
- package/docs/rules/implements-on-classes.md +0 -219
- package/docs/rules/imports-as-dependencies.md +0 -99
- package/docs/rules/informative-docs.md +0 -400
- package/docs/rules/match-description.md +0 -1008
- package/docs/rules/match-name.md +0 -249
- package/docs/rules/multiline-blocks.md +0 -398
- package/docs/rules/no-bad-blocks.md +0 -174
- package/docs/rules/no-blank-block-descriptions.md +0 -91
- package/docs/rules/no-blank-blocks.md +0 -98
- package/docs/rules/no-defaults.md +0 -207
- package/docs/rules/no-missing-syntax.md +0 -275
- package/docs/rules/no-multi-asterisks.md +0 -278
- package/docs/rules/no-restricted-syntax.md +0 -383
- package/docs/rules/no-types.md +0 -168
- package/docs/rules/no-undefined-types.md +0 -789
- package/docs/rules/require-asterisk-prefix.md +0 -297
- package/docs/rules/require-description-complete-sentence.md +0 -820
- package/docs/rules/require-description.md +0 -585
- package/docs/rules/require-example.md +0 -390
- package/docs/rules/require-file-overview.md +0 -324
- package/docs/rules/require-hyphen-before-param-description.md +0 -281
- package/docs/rules/require-jsdoc.md +0 -1857
- package/docs/rules/require-param-description.md +0 -238
- package/docs/rules/require-param-name.md +0 -163
- package/docs/rules/require-param-type.md +0 -227
- package/docs/rules/require-param.md +0 -1820
- package/docs/rules/require-property-description.md +0 -88
- package/docs/rules/require-property-name.md +0 -79
- package/docs/rules/require-property-type.md +0 -79
- package/docs/rules/require-property.md +0 -128
- package/docs/rules/require-returns-check.md +0 -1053
- package/docs/rules/require-returns-description.md +0 -181
- package/docs/rules/require-returns-type.md +0 -144
- package/docs/rules/require-returns.md +0 -1191
- package/docs/rules/require-throws.md +0 -326
- package/docs/rules/require-yields-check.md +0 -544
- package/docs/rules/require-yields.md +0 -823
- package/docs/rules/sort-tags.md +0 -635
- package/docs/rules/tag-lines.md +0 -551
- package/docs/rules/text-escaping.md +0 -177
- package/docs/rules/valid-types.md +0 -881
- package/docs/settings.md +0 -362
- package/tsconfig-prod.json +0 -20
- package/tsconfig.json +0 -21
|
@@ -1,823 +0,0 @@
|
|
|
1
|
-
<a name="user-content-require-yields"></a>
|
|
2
|
-
<a name="require-yields"></a>
|
|
3
|
-
# <code>require-yields</code>
|
|
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)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Requires that yields are documented.
|
|
12
|
-
|
|
13
|
-
Will also report if multiple `@yields` tags are present.
|
|
14
|
-
|
|
15
|
-
See the `next`, `forceRequireNext`, and `nextWithGeneratorTag` options for an
|
|
16
|
-
option to expect a non-standard `@next` tag.
|
|
17
|
-
|
|
18
|
-
<a name="user-content-require-yields-options"></a>
|
|
19
|
-
<a name="require-yields-options"></a>
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
- `exemptedBy` - Array of tags (e.g., `['type']`) whose presence on the
|
|
23
|
-
document block avoids the need for a `@yields`. Defaults to an array
|
|
24
|
-
with `inheritdoc`. If you set this array, it will overwrite the default,
|
|
25
|
-
so be sure to add back `inheritdoc` if you wish its presence to cause
|
|
26
|
-
exemption of the rule.
|
|
27
|
-
- `forceRequireYields` - Set to `true` to always insist on
|
|
28
|
-
`@yields` documentation for generators even if there are only
|
|
29
|
-
expressionless `yield` statements in the function. May be desired to flag
|
|
30
|
-
that a project is aware of an `undefined`/`void` yield. Defaults to
|
|
31
|
-
`false`.
|
|
32
|
-
- `contexts` - Set this to an array of strings representing the AST context
|
|
33
|
-
(or an object with `context` and `comment` properties) where you wish
|
|
34
|
-
the rule to be applied.
|
|
35
|
-
Overrides the default contexts (see below). Set to `"any"` if you want
|
|
36
|
-
the rule to apply to any jsdoc block throughout your files (as is necessary
|
|
37
|
-
for finding function blocks not attached to a function declaration or
|
|
38
|
-
expression, i.e., `@callback` or `@function` (or its aliases `@func` or
|
|
39
|
-
`@method`) (including those associated with an `@interface`). This
|
|
40
|
-
rule will only apply on non-default contexts when there is such a tag
|
|
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>
|
|
70
|
-
## Context and settings
|
|
71
|
-
|
|
72
|
-
|||
|
|
73
|
-
|---|---|
|
|
74
|
-
|Context|Generator functions (`FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled)|
|
|
75
|
-
|Tags|`yields`|
|
|
76
|
-
|Aliases|`yield`|
|
|
77
|
-
|Recommended|true|
|
|
78
|
-
| Options |`contexts`, `exemptedBy`, `forceRequireNext`, `forceRequireYields`, `next`, `nextWithGeneratorTag`, `withGeneratorTag`|
|
|
79
|
-
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
80
|
-
|
|
81
|
-
<a name="user-content-require-yields-failing-examples"></a>
|
|
82
|
-
<a name="require-yields-failing-examples"></a>
|
|
83
|
-
## Failing examples
|
|
84
|
-
|
|
85
|
-
The following patterns are considered problems:
|
|
86
|
-
|
|
87
|
-
````js
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
*/
|
|
91
|
-
function * quux (foo) {
|
|
92
|
-
|
|
93
|
-
yield foo;
|
|
94
|
-
}
|
|
95
|
-
// Message: Missing JSDoc @yields declaration.
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* @yields
|
|
99
|
-
*/
|
|
100
|
-
function * quux (foo) {
|
|
101
|
-
|
|
102
|
-
const retVal = yield foo;
|
|
103
|
-
}
|
|
104
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
105
|
-
// Message: Missing JSDoc @next declaration.
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* @yields
|
|
109
|
-
*/
|
|
110
|
-
function * quux (foo) {
|
|
111
|
-
|
|
112
|
-
const retVal = yield;
|
|
113
|
-
}
|
|
114
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
115
|
-
// Message: Missing JSDoc @next declaration.
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* @yields {void}
|
|
119
|
-
*/
|
|
120
|
-
function * quux () {
|
|
121
|
-
}
|
|
122
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireNext":true}]
|
|
123
|
-
// Message: Missing JSDoc @next declaration.
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @yields {void}
|
|
127
|
-
*/
|
|
128
|
-
function * quux () {
|
|
129
|
-
yield;
|
|
130
|
-
}
|
|
131
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireNext":true}]
|
|
132
|
-
// Message: Missing JSDoc @next declaration.
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
*
|
|
136
|
-
*/
|
|
137
|
-
function * quux (foo) {
|
|
138
|
-
|
|
139
|
-
const a = yield foo;
|
|
140
|
-
}
|
|
141
|
-
// Message: Missing JSDoc @yields declaration.
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
*/
|
|
146
|
-
function * quux (foo) {
|
|
147
|
-
yield foo;
|
|
148
|
-
}
|
|
149
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"yields":"yield"}}}
|
|
150
|
-
// Message: Missing JSDoc @yield declaration.
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @yields
|
|
154
|
-
*/
|
|
155
|
-
function * quux (foo) {
|
|
156
|
-
const val = yield foo;
|
|
157
|
-
}
|
|
158
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"next":"yield-returns"}}}
|
|
159
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
160
|
-
// Message: Missing JSDoc @yield-returns declaration.
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* @yields
|
|
164
|
-
* @next
|
|
165
|
-
*/
|
|
166
|
-
function * quux () {
|
|
167
|
-
const ret = yield 5;
|
|
168
|
-
}
|
|
169
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"next":false}}}
|
|
170
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
171
|
-
// Message: Unexpected tag `@next`
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
*
|
|
175
|
-
*/
|
|
176
|
-
function * quux() {
|
|
177
|
-
yield 5;
|
|
178
|
-
}
|
|
179
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
180
|
-
// Message: Missing JSDoc @yields declaration.
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
184
|
-
*/
|
|
185
|
-
function * quux() {
|
|
186
|
-
yield;
|
|
187
|
-
}
|
|
188
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
189
|
-
// Message: Missing JSDoc @yields declaration.
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
*
|
|
193
|
-
*/
|
|
194
|
-
const quux = async function * () {
|
|
195
|
-
yield;
|
|
196
|
-
}
|
|
197
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
198
|
-
// Message: Missing JSDoc @yields declaration.
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
*
|
|
202
|
-
*/
|
|
203
|
-
async function * quux () {
|
|
204
|
-
yield;
|
|
205
|
-
}
|
|
206
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
207
|
-
// Message: Missing JSDoc @yields declaration.
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
*
|
|
211
|
-
*/
|
|
212
|
-
function * quux () {
|
|
213
|
-
yield;
|
|
214
|
-
}
|
|
215
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"forceRequireYields":true}]
|
|
216
|
-
// Message: Missing JSDoc @yields declaration.
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @function
|
|
220
|
-
* @generator
|
|
221
|
-
*/
|
|
222
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"forceRequireYields":true}]
|
|
223
|
-
// Message: Missing JSDoc @yields declaration.
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* @callback
|
|
227
|
-
* @generator
|
|
228
|
-
*/
|
|
229
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"forceRequireYields":true}]
|
|
230
|
-
// Message: Missing JSDoc @yields declaration.
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* @yields {undefined}
|
|
234
|
-
* @yields {void}
|
|
235
|
-
*/
|
|
236
|
-
function * quux (foo) {
|
|
237
|
-
|
|
238
|
-
return foo;
|
|
239
|
-
}
|
|
240
|
-
// Message: Found more than one @yields declaration.
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* @yields
|
|
244
|
-
*/
|
|
245
|
-
function * quux () {
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"yields":false}}}
|
|
249
|
-
// Message: Unexpected tag `@yields`
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* @param foo
|
|
253
|
-
*/
|
|
254
|
-
function * quux (foo) {
|
|
255
|
-
yield 'bar';
|
|
256
|
-
}
|
|
257
|
-
// "jsdoc/require-yields": ["error"|"warn", {"exemptedBy":["notPresent"]}]
|
|
258
|
-
// Message: Missing JSDoc @yields declaration.
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* @param {array} a
|
|
262
|
-
*/
|
|
263
|
-
async function * foo(a) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
267
|
-
// Message: Missing JSDoc @yields declaration.
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* @param {array} a
|
|
271
|
-
*/
|
|
272
|
-
async function * foo(a) {
|
|
273
|
-
yield Promise.all(a);
|
|
274
|
-
}
|
|
275
|
-
// "jsdoc/require-yields": ["error"|"warn", {"forceRequireYields":true}]
|
|
276
|
-
// Message: Missing JSDoc @yields declaration.
|
|
277
|
-
|
|
278
|
-
class quux {
|
|
279
|
-
/**
|
|
280
|
-
*
|
|
281
|
-
*/
|
|
282
|
-
* quux () {
|
|
283
|
-
yield;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"forceRequireYields":true}]
|
|
287
|
-
// Message: Missing JSDoc @yields declaration.
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* @param {array} a
|
|
291
|
-
*/
|
|
292
|
-
async function * foo(a) {
|
|
293
|
-
yield Promise.all(a);
|
|
294
|
-
}
|
|
295
|
-
// Message: Missing JSDoc @yields declaration.
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* @generator
|
|
299
|
-
*/
|
|
300
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"withGeneratorTag":true}]
|
|
301
|
-
// Message: Missing JSDoc @yields declaration.
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* @generator
|
|
305
|
-
* @yields
|
|
306
|
-
*/
|
|
307
|
-
// "jsdoc/require-yields": ["error"|"warn", {"contexts":["any"],"nextWithGeneratorTag":true}]
|
|
308
|
-
// Message: Missing JSDoc @next declaration.
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
*
|
|
312
|
-
*/
|
|
313
|
-
function * quux () {
|
|
314
|
-
if (true) {
|
|
315
|
-
yield;
|
|
316
|
-
}
|
|
317
|
-
yield true;
|
|
318
|
-
}
|
|
319
|
-
// Message: Missing JSDoc @yields declaration.
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
*
|
|
323
|
-
*/
|
|
324
|
-
function * quux () {
|
|
325
|
-
try {
|
|
326
|
-
yield true;
|
|
327
|
-
} catch (err) {
|
|
328
|
-
}
|
|
329
|
-
yield;
|
|
330
|
-
}
|
|
331
|
-
// Message: Missing JSDoc @yields declaration.
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
*
|
|
335
|
-
*/
|
|
336
|
-
function * quux () {
|
|
337
|
-
try {
|
|
338
|
-
} finally {
|
|
339
|
-
yield true;
|
|
340
|
-
}
|
|
341
|
-
yield;
|
|
342
|
-
}
|
|
343
|
-
// Message: Missing JSDoc @yields declaration.
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
*
|
|
347
|
-
*/
|
|
348
|
-
function * quux () {
|
|
349
|
-
try {
|
|
350
|
-
yield;
|
|
351
|
-
} catch (err) {
|
|
352
|
-
}
|
|
353
|
-
yield true;
|
|
354
|
-
}
|
|
355
|
-
// Message: Missing JSDoc @yields declaration.
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
*
|
|
359
|
-
*/
|
|
360
|
-
function * quux () {
|
|
361
|
-
try {
|
|
362
|
-
something();
|
|
363
|
-
} catch (err) {
|
|
364
|
-
yield true;
|
|
365
|
-
}
|
|
366
|
-
yield;
|
|
367
|
-
}
|
|
368
|
-
// Message: Missing JSDoc @yields declaration.
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
*
|
|
372
|
-
*/
|
|
373
|
-
function * quux () {
|
|
374
|
-
switch (true) {
|
|
375
|
-
case 'abc':
|
|
376
|
-
yield true;
|
|
377
|
-
}
|
|
378
|
-
yield;
|
|
379
|
-
}
|
|
380
|
-
// Message: Missing JSDoc @yields declaration.
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
*
|
|
384
|
-
*/
|
|
385
|
-
function * quux () {
|
|
386
|
-
switch (true) {
|
|
387
|
-
case 'abc':
|
|
388
|
-
yield;
|
|
389
|
-
}
|
|
390
|
-
yield true;
|
|
391
|
-
}
|
|
392
|
-
// Message: Missing JSDoc @yields declaration.
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
*
|
|
396
|
-
*/
|
|
397
|
-
function * quux () {
|
|
398
|
-
for (const i of abc) {
|
|
399
|
-
yield true;
|
|
400
|
-
}
|
|
401
|
-
yield;
|
|
402
|
-
}
|
|
403
|
-
// Message: Missing JSDoc @yields declaration.
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
*
|
|
407
|
-
*/
|
|
408
|
-
function * quux () {
|
|
409
|
-
for (const a in b) {
|
|
410
|
-
yield true;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
// Message: Missing JSDoc @yields declaration.
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
*
|
|
417
|
-
*/
|
|
418
|
-
function * quux () {
|
|
419
|
-
for (let i=0; i<n; i+=1) {
|
|
420
|
-
yield true;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
// Message: Missing JSDoc @yields declaration.
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
*
|
|
427
|
-
*/
|
|
428
|
-
function * quux () {
|
|
429
|
-
while(true) {
|
|
430
|
-
yield true
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
// Message: Missing JSDoc @yields declaration.
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
*
|
|
437
|
-
*/
|
|
438
|
-
function * quux () {
|
|
439
|
-
do {
|
|
440
|
-
yield true
|
|
441
|
-
}
|
|
442
|
-
while(true)
|
|
443
|
-
}
|
|
444
|
-
// Message: Missing JSDoc @yields declaration.
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
*
|
|
448
|
-
*/
|
|
449
|
-
function * quux () {
|
|
450
|
-
if (true) {
|
|
451
|
-
yield;
|
|
452
|
-
}
|
|
453
|
-
yield true;
|
|
454
|
-
}
|
|
455
|
-
// Message: Missing JSDoc @yields declaration.
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
*
|
|
459
|
-
*/
|
|
460
|
-
function * quux () {
|
|
461
|
-
if (true) {
|
|
462
|
-
yield true;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
// Message: Missing JSDoc @yields declaration.
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
*
|
|
469
|
-
*/
|
|
470
|
-
function * quux () {
|
|
471
|
-
var a = {};
|
|
472
|
-
with (a) {
|
|
473
|
-
yield true;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
// Message: Missing JSDoc @yields declaration.
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
*
|
|
480
|
-
*/
|
|
481
|
-
function * quux () {
|
|
482
|
-
if (true) {
|
|
483
|
-
yield;
|
|
484
|
-
} else {
|
|
485
|
-
yield true;
|
|
486
|
-
}
|
|
487
|
-
yield;
|
|
488
|
-
}
|
|
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
|
-
|
|
531
|
-
/**
|
|
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
|
-
* @next {void}
|
|
631
|
-
*/
|
|
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
|
-
function * quux (foo) {
|
|
768
|
-
|
|
769
|
-
const a = yield foo;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
/**
|
|
773
|
-
* @yields
|
|
774
|
-
* @next
|
|
775
|
-
*/
|
|
776
|
-
function * quux (foo) {
|
|
777
|
-
let a = yield;
|
|
778
|
-
}
|
|
779
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
* @yields
|
|
783
|
-
* @next
|
|
784
|
-
*/
|
|
785
|
-
function * quux (foo) {
|
|
786
|
-
const a = yield foo;
|
|
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;
|
|
811
|
-
}
|
|
812
|
-
// "jsdoc/require-yields": ["error"|"warn", {"next":true}]
|
|
813
|
-
|
|
814
|
-
/**
|
|
815
|
-
*
|
|
816
|
-
*/
|
|
817
|
-
function * quux (foo) {
|
|
818
|
-
const a = function * bar () {
|
|
819
|
-
yield foo;
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
````
|
|
823
|
-
|