eslint-plugin-jsdoc 46.4.6 → 46.5.0

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.
Files changed (187) hide show
  1. package/README.md +31 -0
  2. package/dist/index.js +21 -10
  3. package/dist/index.js.map +1 -1
  4. package/package.json +14 -12
  5. package/dist/WarnSettings.d.ts +0 -17
  6. package/dist/WarnSettings.d.ts.map +0 -1
  7. package/dist/alignTransform.d.ts +0 -32
  8. package/dist/alignTransform.d.ts.map +0 -1
  9. package/dist/defaultTagOrder.d.ts +0 -5
  10. package/dist/defaultTagOrder.d.ts.map +0 -1
  11. package/dist/exportParser.d.ts +0 -41
  12. package/dist/exportParser.d.ts.map +0 -1
  13. package/dist/getDefaultTagStructureForMode.d.ts +0 -11
  14. package/dist/getDefaultTagStructureForMode.d.ts.map +0 -1
  15. package/dist/index.d.ts +0 -10
  16. package/dist/index.d.ts.map +0 -1
  17. package/dist/iterateJsdoc.d.ts +0 -460
  18. package/dist/iterateJsdoc.d.ts.map +0 -1
  19. package/dist/jsdocUtils.d.ts +0 -421
  20. package/dist/jsdocUtils.d.ts.map +0 -1
  21. package/dist/rules/checkAccess.d.ts +0 -3
  22. package/dist/rules/checkAccess.d.ts.map +0 -1
  23. package/dist/rules/checkAlignment.d.ts +0 -3
  24. package/dist/rules/checkAlignment.d.ts.map +0 -1
  25. package/dist/rules/checkExamples.d.ts +0 -4
  26. package/dist/rules/checkExamples.d.ts.map +0 -1
  27. package/dist/rules/checkIndentation.d.ts +0 -3
  28. package/dist/rules/checkIndentation.d.ts.map +0 -1
  29. package/dist/rules/checkLineAlignment.d.ts +0 -10
  30. package/dist/rules/checkLineAlignment.d.ts.map +0 -1
  31. package/dist/rules/checkParamNames.d.ts +0 -3
  32. package/dist/rules/checkParamNames.d.ts.map +0 -1
  33. package/dist/rules/checkPropertyNames.d.ts +0 -3
  34. package/dist/rules/checkPropertyNames.d.ts.map +0 -1
  35. package/dist/rules/checkSyntax.d.ts +0 -3
  36. package/dist/rules/checkSyntax.d.ts.map +0 -1
  37. package/dist/rules/checkTagNames.d.ts +0 -3
  38. package/dist/rules/checkTagNames.d.ts.map +0 -1
  39. package/dist/rules/checkTypes.d.ts +0 -3
  40. package/dist/rules/checkTypes.d.ts.map +0 -1
  41. package/dist/rules/checkValues.d.ts +0 -3
  42. package/dist/rules/checkValues.d.ts.map +0 -1
  43. package/dist/rules/emptyTags.d.ts +0 -3
  44. package/dist/rules/emptyTags.d.ts.map +0 -1
  45. package/dist/rules/implementsOnClasses.d.ts +0 -3
  46. package/dist/rules/implementsOnClasses.d.ts.map +0 -1
  47. package/dist/rules/importsAsDependencies.d.ts +0 -3
  48. package/dist/rules/importsAsDependencies.d.ts.map +0 -1
  49. package/dist/rules/informativeDocs.d.ts +0 -3
  50. package/dist/rules/informativeDocs.d.ts.map +0 -1
  51. package/dist/rules/matchDescription.d.ts +0 -3
  52. package/dist/rules/matchDescription.d.ts.map +0 -1
  53. package/dist/rules/matchName.d.ts +0 -3
  54. package/dist/rules/matchName.d.ts.map +0 -1
  55. package/dist/rules/multilineBlocks.d.ts +0 -3
  56. package/dist/rules/multilineBlocks.d.ts.map +0 -1
  57. package/dist/rules/noBadBlocks.d.ts +0 -3
  58. package/dist/rules/noBadBlocks.d.ts.map +0 -1
  59. package/dist/rules/noBlankBlockDescriptions.d.ts +0 -3
  60. package/dist/rules/noBlankBlockDescriptions.d.ts.map +0 -1
  61. package/dist/rules/noBlankBlocks.d.ts +0 -3
  62. package/dist/rules/noBlankBlocks.d.ts.map +0 -1
  63. package/dist/rules/noDefaults.d.ts +0 -3
  64. package/dist/rules/noDefaults.d.ts.map +0 -1
  65. package/dist/rules/noMissingSyntax.d.ts +0 -10
  66. package/dist/rules/noMissingSyntax.d.ts.map +0 -1
  67. package/dist/rules/noMultiAsterisks.d.ts +0 -3
  68. package/dist/rules/noMultiAsterisks.d.ts.map +0 -1
  69. package/dist/rules/noRestrictedSyntax.d.ts +0 -3
  70. package/dist/rules/noRestrictedSyntax.d.ts.map +0 -1
  71. package/dist/rules/noTypes.d.ts +0 -3
  72. package/dist/rules/noTypes.d.ts.map +0 -1
  73. package/dist/rules/noUndefinedTypes.d.ts +0 -3
  74. package/dist/rules/noUndefinedTypes.d.ts.map +0 -1
  75. package/dist/rules/requireAsteriskPrefix.d.ts +0 -3
  76. package/dist/rules/requireAsteriskPrefix.d.ts.map +0 -1
  77. package/dist/rules/requireDescription.d.ts +0 -3
  78. package/dist/rules/requireDescription.d.ts.map +0 -1
  79. package/dist/rules/requireDescriptionCompleteSentence.d.ts +0 -3
  80. package/dist/rules/requireDescriptionCompleteSentence.d.ts.map +0 -1
  81. package/dist/rules/requireExample.d.ts +0 -3
  82. package/dist/rules/requireExample.d.ts.map +0 -1
  83. package/dist/rules/requireFileOverview.d.ts +0 -3
  84. package/dist/rules/requireFileOverview.d.ts.map +0 -1
  85. package/dist/rules/requireHyphenBeforeParamDescription.d.ts +0 -3
  86. package/dist/rules/requireHyphenBeforeParamDescription.d.ts.map +0 -1
  87. package/dist/rules/requireJsdoc.d.ts +0 -9
  88. package/dist/rules/requireJsdoc.d.ts.map +0 -1
  89. package/dist/rules/requireParam.d.ts +0 -4
  90. package/dist/rules/requireParam.d.ts.map +0 -1
  91. package/dist/rules/requireParamDescription.d.ts +0 -3
  92. package/dist/rules/requireParamDescription.d.ts.map +0 -1
  93. package/dist/rules/requireParamName.d.ts +0 -3
  94. package/dist/rules/requireParamName.d.ts.map +0 -1
  95. package/dist/rules/requireParamType.d.ts +0 -3
  96. package/dist/rules/requireParamType.d.ts.map +0 -1
  97. package/dist/rules/requireProperty.d.ts +0 -3
  98. package/dist/rules/requireProperty.d.ts.map +0 -1
  99. package/dist/rules/requirePropertyDescription.d.ts +0 -3
  100. package/dist/rules/requirePropertyDescription.d.ts.map +0 -1
  101. package/dist/rules/requirePropertyName.d.ts +0 -3
  102. package/dist/rules/requirePropertyName.d.ts.map +0 -1
  103. package/dist/rules/requirePropertyType.d.ts +0 -3
  104. package/dist/rules/requirePropertyType.d.ts.map +0 -1
  105. package/dist/rules/requireReturns.d.ts +0 -3
  106. package/dist/rules/requireReturns.d.ts.map +0 -1
  107. package/dist/rules/requireReturnsCheck.d.ts +0 -3
  108. package/dist/rules/requireReturnsCheck.d.ts.map +0 -1
  109. package/dist/rules/requireReturnsDescription.d.ts +0 -3
  110. package/dist/rules/requireReturnsDescription.d.ts.map +0 -1
  111. package/dist/rules/requireReturnsType.d.ts +0 -3
  112. package/dist/rules/requireReturnsType.d.ts.map +0 -1
  113. package/dist/rules/requireThrows.d.ts +0 -3
  114. package/dist/rules/requireThrows.d.ts.map +0 -1
  115. package/dist/rules/requireYields.d.ts +0 -3
  116. package/dist/rules/requireYields.d.ts.map +0 -1
  117. package/dist/rules/requireYieldsCheck.d.ts +0 -3
  118. package/dist/rules/requireYieldsCheck.d.ts.map +0 -1
  119. package/dist/rules/sortTags.d.ts +0 -3
  120. package/dist/rules/sortTags.d.ts.map +0 -1
  121. package/dist/rules/tagLines.d.ts +0 -3
  122. package/dist/rules/tagLines.d.ts.map +0 -1
  123. package/dist/rules/textEscaping.d.ts +0 -3
  124. package/dist/rules/textEscaping.d.ts.map +0 -1
  125. package/dist/rules/validTypes.d.ts +0 -3
  126. package/dist/rules/validTypes.d.ts.map +0 -1
  127. package/dist/tagNames.d.ts +0 -16
  128. package/dist/tagNames.d.ts.map +0 -1
  129. package/dist/utils/hasReturnValue.d.ts +0 -20
  130. package/dist/utils/hasReturnValue.d.ts.map +0 -1
  131. package/docs/advanced.md +0 -102
  132. package/docs/rules/check-access.md +0 -193
  133. package/docs/rules/check-alignment.md +0 -169
  134. package/docs/rules/check-examples.md +0 -784
  135. package/docs/rules/check-indentation.md +0 -296
  136. package/docs/rules/check-line-alignment.md +0 -1002
  137. package/docs/rules/check-param-names.md +0 -1035
  138. package/docs/rules/check-property-names.md +0 -244
  139. package/docs/rules/check-syntax.md +0 -80
  140. package/docs/rules/check-tag-names.md +0 -1132
  141. package/docs/rules/check-types.md +0 -1198
  142. package/docs/rules/check-values.md +0 -409
  143. package/docs/rules/empty-tags.md +0 -220
  144. package/docs/rules/implements-on-classes.md +0 -219
  145. package/docs/rules/imports-as-dependencies.md +0 -99
  146. package/docs/rules/informative-docs.md +0 -400
  147. package/docs/rules/match-description.md +0 -1008
  148. package/docs/rules/match-name.md +0 -249
  149. package/docs/rules/multiline-blocks.md +0 -398
  150. package/docs/rules/no-bad-blocks.md +0 -174
  151. package/docs/rules/no-blank-block-descriptions.md +0 -91
  152. package/docs/rules/no-blank-blocks.md +0 -98
  153. package/docs/rules/no-defaults.md +0 -207
  154. package/docs/rules/no-missing-syntax.md +0 -275
  155. package/docs/rules/no-multi-asterisks.md +0 -278
  156. package/docs/rules/no-restricted-syntax.md +0 -383
  157. package/docs/rules/no-types.md +0 -168
  158. package/docs/rules/no-undefined-types.md +0 -789
  159. package/docs/rules/require-asterisk-prefix.md +0 -297
  160. package/docs/rules/require-description-complete-sentence.md +0 -820
  161. package/docs/rules/require-description.md +0 -585
  162. package/docs/rules/require-example.md +0 -390
  163. package/docs/rules/require-file-overview.md +0 -324
  164. package/docs/rules/require-hyphen-before-param-description.md +0 -281
  165. package/docs/rules/require-jsdoc.md +0 -1857
  166. package/docs/rules/require-param-description.md +0 -238
  167. package/docs/rules/require-param-name.md +0 -163
  168. package/docs/rules/require-param-type.md +0 -227
  169. package/docs/rules/require-param.md +0 -1820
  170. package/docs/rules/require-property-description.md +0 -88
  171. package/docs/rules/require-property-name.md +0 -79
  172. package/docs/rules/require-property-type.md +0 -79
  173. package/docs/rules/require-property.md +0 -128
  174. package/docs/rules/require-returns-check.md +0 -1053
  175. package/docs/rules/require-returns-description.md +0 -181
  176. package/docs/rules/require-returns-type.md +0 -144
  177. package/docs/rules/require-returns.md +0 -1191
  178. package/docs/rules/require-throws.md +0 -326
  179. package/docs/rules/require-yields-check.md +0 -544
  180. package/docs/rules/require-yields.md +0 -823
  181. package/docs/rules/sort-tags.md +0 -635
  182. package/docs/rules/tag-lines.md +0 -551
  183. package/docs/rules/text-escaping.md +0 -177
  184. package/docs/rules/valid-types.md +0 -881
  185. package/docs/settings.md +0 -362
  186. package/tsconfig-prod.json +0 -20
  187. package/tsconfig.json +0 -21
@@ -1,249 +0,0 @@
1
- <a name="user-content-match-name"></a>
2
- <a name="match-name"></a>
3
- ### <code>match-name</code>
4
-
5
-
6
-
7
- Reports the name portion of a JSDoc tag if matching or not matching
8
- a given regular expression.
9
-
10
- Note that some tags do not possess names and anything appearing to be a
11
- name will actually be part of the description (e.g., for
12
- `@returns {type} notAName`). If you are defining your own tags, see the
13
- `structuredTags` setting (if `name: false`, this rule will not apply to
14
- that tag).
15
-
16
- <a name="user-content-fixer"></a>
17
- <a name="fixer"></a>
18
- ## Fixer
19
-
20
- Will replace `disallowName` with `replacement` if these are provided.
21
-
22
- <a name="user-content-options"></a>
23
- <a name="options"></a>
24
- ## Options
25
-
26
- A single options object with the following properties:
27
-
28
- <a name="user-content-options-match"></a>
29
- <a name="options-match"></a>
30
- ### <code>match</code>
31
-
32
- `match` is a required option containing an array of objects which determine
33
- the conditions whereby a name is reported as being problematic.
34
-
35
- These objects can have any combination of the following groups of optional
36
- properties, all of which act to confine one another:
37
-
38
- - `tags` - This array should include tag names or `*` to indicate the
39
- match will apply for all tags (except as confined by any context
40
- properties). If `*` is not used, then these rules will only apply to
41
- the specified tags. If `tags` is omitted, then `*` is assumed.
42
-
43
- - `allowName` - Indicates which names are allowed for the given tag (or `*`).
44
- Accepts a string regular expression (optionally wrapped between two
45
- `/` delimiters followed by optional flags) used to match the name.
46
- - `disallowName` - As with `allowName` but indicates names that are not
47
- allowed.
48
- - `replacement` - If `disallowName` is supplied and this value is present, it
49
- will replace the matched `disallowName` text.
50
-
51
- - `context` - AST to confine the allowing or disallowing to jsdoc blocks
52
- associated with a particular context. See the
53
- ["AST and Selectors"](#user-content-eslint-plugin-jsdoc-advanced-ast-and-selectors)
54
- section of our README for more on the expected format.
55
- - `comment` - As with `context` but AST for the JSDoc block comment and types
56
-
57
- - `message` - An optional custom message to use when there is a match.
58
-
59
- Note that `comment`, even if targeting a specific tag, is used to match the
60
- whole block. So if a `comment` finds its specific tag, it may still apply
61
- fixes found by the likes of `disallowName` even when a different tag has the
62
- disallowed name. An alternative is to ensure that `comment` finds the specific
63
- tag of the desired tag and/or name and no `disallowName` (or `allowName`) is
64
- supplied. In such a case, only one error will be reported, but no fixer will
65
- be applied, however.
66
-
67
- <a name="user-content-context-and-settings"></a>
68
- <a name="context-and-settings"></a>
69
- ## Context and settings
70
-
71
- |||
72
- |---|---|
73
- |Context|everywhere|
74
- |Tags|(The tags specified by `tags`, including any tag if `*` is set)|
75
- |Recommended|false|
76
- |Settings|`structuredTags`|
77
- |Options|`match`|
78
-
79
- <a name="user-content-failing-examples"></a>
80
- <a name="failing-examples"></a>
81
- ## Failing examples
82
-
83
- The following patterns are considered problems:
84
-
85
- ````js
86
- /**
87
- * @param opt_a
88
- * @param opt_b
89
- */
90
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^opt_/i"}]}]
91
- // Message: Only allowing names not matching `/^opt_/i` but found "opt_a".
92
-
93
- /**
94
- * @param opt_a
95
- * @param opt_b
96
- */
97
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^opt_/i","replacement":""}]}]
98
- // Message: Only allowing names not matching `/^opt_/i` but found "opt_a".
99
-
100
- /**
101
- * @param a
102
- * @param opt_b
103
- */
104
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"allowName":"/^[a-z]+$/i"}]}]
105
- // Message: Only allowing names matching `/^[a-z]+$/i` but found "opt_b".
106
-
107
- /**
108
- * @param arg
109
- * @param opt_b
110
- */
111
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"allowName":"/^[a-z]+$/i","disallowName":"/^arg/i"}]}]
112
- // Message: Only allowing names not matching `/^arg/i` but found "arg".
113
-
114
- /**
115
- * @param opt_a
116
- * @param arg
117
- */
118
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^arg$/i"},{"disallowName":"/^opt_/i"}]}]
119
- // Message: Only allowing names not matching `/^opt_/i` but found "opt_a".
120
-
121
- /**
122
- * @property opt_a
123
- * @param opt_b
124
- */
125
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^opt_/i","tags":["param"]}]}]
126
- // Message: Only allowing names not matching `/^opt_/i` but found "opt_b".
127
-
128
- /**
129
- * @someTag opt_a
130
- * @param opt_b
131
- */
132
- // Settings: {"jsdoc":{"structuredTags":{"someTag":{"name":"namepath-defining"}}}}
133
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^opt_/i","tags":["param"]}]}]
134
- // Message: Only allowing names not matching `/^opt_/i` but found "opt_b".
135
-
136
- /**
137
- * @property opt_a
138
- * @param opt_b
139
- */
140
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^opt_/i","tags":["*"]}]}]
141
- // Message: Only allowing names not matching `/^opt_/i` but found "opt_a".
142
-
143
- /**
144
- * @param opt_a
145
- * @param opt_b
146
- */
147
- function quux () {
148
- }
149
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"context":"FunctionDeclaration","disallowName":"/^opt_/i"}]}]
150
- // Message: Only allowing names not matching `/^opt_/i` but found "opt_a".
151
-
152
- /**
153
- * @property opt_a
154
- * @param {Bar|Foo} opt_b
155
- */
156
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"comment":"JsdocBlock:has(JsdocTag[tag=\"param\"][name=/opt_/] > JsdocTypeUnion:has(JsdocTypeName[value=\"Bar\"]:nth-child(1)))"}]}]
157
- // Message: Prohibited context for "opt_a".
158
-
159
- /**
160
- * @property opt_a
161
- * @param {Bar|Foo} opt_b
162
- */
163
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"comment":"JsdocBlock:has(JsdocTag[tag=\"param\"][name=/opt_/] > JsdocTypeUnion:has(JsdocTypeName[value=\"Bar\"]:nth-child(1)))","message":"Don't use `opt_` prefixes with Bar|..."}]}]
164
- // Message: Don't use `opt_` prefixes with Bar|...
165
-
166
- /**
167
- * @param opt_a
168
- * @param opt_b
169
- */
170
- function quux () {}
171
- // "jsdoc/match-name": ["error"|"warn", ]
172
- // Message: Rule `no-restricted-syntax` is missing a `match` option.
173
-
174
- /**
175
- * @param {
176
- * someType
177
- * } opt_a
178
- */
179
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^opt_/i","replacement":""}]}]
180
- // Message: Only allowing names not matching `/^opt_/i` but found "opt_a".
181
-
182
- /**
183
- * @template
184
- */
185
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^$/","tags":["template"]}]}]
186
- // Message: Only allowing names not matching `/^$/u` but found "".
187
- ````
188
-
189
-
190
-
191
- <a name="user-content-passing-examples"></a>
192
- <a name="passing-examples"></a>
193
- ## Passing examples
194
-
195
- The following patterns are not considered problems:
196
-
197
- ````js
198
- /**
199
- * @param opt_a
200
- * @param opt_b
201
- */
202
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^arg/i"}]}]
203
-
204
- /**
205
- * @param a
206
- * @param opt_b
207
- */
208
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"allowName":"/^[a-z_]+$/i"}]}]
209
-
210
- /**
211
- * @param someArg
212
- * @param anotherArg
213
- */
214
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"allowName":"/^[a-z]+$/i","disallowName":"/^arg/i"}]}]
215
-
216
- /**
217
- * @param elem1
218
- * @param elem2
219
- */
220
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^arg$/i"},{"disallowName":"/^opt_/i"}]}]
221
-
222
- /**
223
- * @someTag opt_a
224
- * @param opt_b
225
- */
226
- // Settings: {"jsdoc":{"structuredTags":{"someTag":{"name":"namepath-defining"}}}}
227
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^opt_/i","tags":["property"]}]}]
228
-
229
- /**
230
- * @property opt_a
231
- * @param opt_b
232
- */
233
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"disallowName":"/^arg/i","tags":["*"]}]}]
234
-
235
- /**
236
- * @param opt_a
237
- * @param opt_b
238
- */
239
- class A {
240
- }
241
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"context":"FunctionDeclaration","disallowName":"/^opt_/i"}]}]
242
-
243
- /**
244
- * @property opt_a
245
- * @param {Foo|Bar} opt_b
246
- */
247
- // "jsdoc/match-name": ["error"|"warn", {"match":[{"comment":"JsdocBlock:has(JsdocTag[tag=\"param\"]:has(JsdocTypeUnion:has(JsdocTypeName[value=\"Bar\"]:nth-child(1))))","disallowName":"/^opt_/i"}]}]
248
- ````
249
-
@@ -1,398 +0,0 @@
1
- <a name="user-content-multiline-blocks"></a>
2
- <a name="multiline-blocks"></a>
3
- ### <code>multiline-blocks</code>
4
-
5
-
6
-
7
- Controls how and whether jsdoc blocks can be expressed as single or multiple
8
- line blocks.
9
-
10
- Note that if you set `noSingleLineBlocks` and `noMultilineBlocks` to `true`
11
- and configure them in a certain manner, you might effectively be prohibiting
12
- all jsdoc blocks!
13
-
14
- Also allows for preventing text at the very beginning or very end of blocks.
15
-
16
- <a name="user-content-fixer"></a>
17
- <a name="fixer"></a>
18
- ## Fixer
19
-
20
- (TODO)
21
-
22
- <a name="user-content-options"></a>
23
- <a name="options"></a>
24
- ## Options
25
-
26
- A single options object with the following properties.
27
-
28
- <a name="user-content-options-nozerolinetext-defaults-to-true"></a>
29
- <a name="options-nozerolinetext-defaults-to-true"></a>
30
- ### <code>noZeroLineText</code> (defaults to <code>true</code>)
31
-
32
- For multiline blocks, any non-whitespace text immediately after the `/**` and
33
- space will be reported. (Text after a newline is not reported.)
34
-
35
- `noMultilineBlocks` will have priority over this rule if it applies.
36
-
37
- <a name="user-content-options-nofinallinetext-defaults-to-true"></a>
38
- <a name="options-nofinallinetext-defaults-to-true"></a>
39
- ### <code>noFinalLineText</code> (defaults to <code>true</code>)
40
-
41
- For multiline blocks, any non-whitespace text preceding the `*/` on the final
42
- line will be reported. (Text preceding a newline is not reported.)
43
-
44
- `noMultilineBlocks` will have priority over this rule if it applies.
45
-
46
- <a name="user-content-options-nosinglelineblocks-defaults-to-false"></a>
47
- <a name="options-nosinglelineblocks-defaults-to-false"></a>
48
- ### <code>noSingleLineBlocks</code> (defaults to <code>false</code>)
49
-
50
- If this is `true`, any single line blocks will be reported, except those which
51
- are whitelisted in `singleLineTags`.
52
-
53
- <a name="user-content-options-singlelinetags-defaults-to-lends-type"></a>
54
- <a name="options-singlelinetags-defaults-to-lends-type"></a>
55
- ### <code>singleLineTags</code> (defaults to <code>[&#39;lends&#39;, &#39;type&#39;]</code>)
56
-
57
- An array of tags which can nevertheless be allowed as single line blocks when
58
- `noSingleLineBlocks` is set. You may set this to a empty array to
59
- cause all single line blocks to be reported. If `'*'` is present, then
60
- the presence of a tag will allow single line blocks (but not if a tag is
61
- missing).
62
-
63
- <a name="user-content-options-nomultilineblocks-defaults-to-false"></a>
64
- <a name="options-nomultilineblocks-defaults-to-false"></a>
65
- ### <code>noMultilineBlocks</code> (defaults to <code>false</code>)
66
-
67
- Requires that jsdoc blocks are restricted to single lines only unless impacted
68
- by the options `minimumLengthForMultiline`, `multilineTags`, or
69
- `allowMultipleTags`.
70
-
71
- <a name="user-content-options-minimumlengthformultiline-defaults-to-not-being-in-effect"></a>
72
- <a name="options-minimumlengthformultiline-defaults-to-not-being-in-effect"></a>
73
- ### <code>minimumLengthForMultiline</code> (defaults to not being in effect)
74
-
75
- If `noMultilineBlocks` is set with this numeric option, multiline blocks will
76
- be permitted if containing at least the given amount of text.
77
-
78
- If not set, multiline blocks will not be permitted regardless of length unless
79
- a relevant tag is present and `multilineTags` is set.
80
-
81
- <a name="user-content-options-multilinetags-defaults-to"></a>
82
- <a name="options-multilinetags-defaults-to"></a>
83
- ### <code>multilineTags</code> (defaults to <code>[&#39;*&#39;]</code>)
84
-
85
- If `noMultilineBlocks` is set with this option, multiline blocks may be allowed
86
- regardless of length as long as a tag or a tag of a certain type is present.
87
-
88
- If `*` is included in the array, the presence of a tags will allow for
89
- multiline blocks (but not when without any tags unless the amount of text is
90
- over an amount specified by `minimumLengthForMultiline`).
91
-
92
- If the array does not include `*` but lists certain tags, the presence of
93
- such a tag will cause multiline blocks to be allowed.
94
-
95
- You may set this to an empty array to prevent any tag from permitting multiple
96
- lines.
97
-
98
- <a name="user-content-options-allowmultipletags-defaults-to-true"></a>
99
- <a name="options-allowmultipletags-defaults-to-true"></a>
100
- ### <code>allowMultipleTags</code> (defaults to <code>true</code>)
101
-
102
- If `noMultilineBlocks` is set to `true` with this option and multiple tags are
103
- found in a block, an error will not be reported.
104
-
105
- Since multiple-tagged lines cannot be collapsed into a single line, this option
106
- prevents them from being reported. Set to `false` if you really want to report
107
- any blocks.
108
-
109
- This option will also be applied when there is a block description and a single
110
- tag (since a description cannot precede a tag on a single line, and also
111
- cannot be reliably added after the tag either).
112
-
113
- <a name="user-content-context-and-settings"></a>
114
- <a name="context-and-settings"></a>
115
- ## Context and settings
116
-
117
- |||
118
- |---|---|
119
- |Context|everywhere|
120
- |Tags|Any (though `singleLineTags` and `multilineTags` control the application)|
121
- |Recommended|true|
122
- |Settings||
123
- |Options|`allowMultipleTags`, `minimumLengthForMultiline`, `multilineTags`, `noFinalLineText`, `noMultilineBlocks`, `noSingleLineBlocks`, `noZeroLineText`, `singleLineTags`|
124
-
125
- <a name="user-content-failing-examples"></a>
126
- <a name="failing-examples"></a>
127
- ## Failing examples
128
-
129
- The following patterns are considered problems:
130
-
131
- ````js
132
- /** Reported up here
133
- * because the rest is multiline
134
- */
135
- // Message: Should have no text on the "0th" line (after the `/**`).
136
-
137
- /** Reported up here
138
- * because the rest is multiline
139
- */
140
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noZeroLineText":true}]
141
- // Message: Should have no text on the "0th" line (after the `/**`).
142
-
143
- /** @abc {aType} aName Reported up here
144
- * because the rest is multiline
145
- */
146
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noZeroLineText":true}]
147
- // Message: Should have no text on the "0th" line (after the `/**`).
148
-
149
- /** @tag */
150
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noSingleLineBlocks":true}]
151
- // Message: Single line blocks are not permitted by your configuration.
152
-
153
- /** @tag {someType} */
154
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noSingleLineBlocks":true}]
155
- // Message: Single line blocks are not permitted by your configuration.
156
-
157
- /** @tag {someType} aName */
158
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noSingleLineBlocks":true}]
159
- // Message: Single line blocks are not permitted by your configuration.
160
-
161
- /** @tag */
162
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noSingleLineBlocks":true,"singleLineTags":["someOtherTag"]}]
163
- // Message: Single line blocks are not permitted by your configuration.
164
-
165
- /** desc */
166
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noSingleLineBlocks":true,"singleLineTags":["*"]}]
167
- // Message: Single line blocks are not permitted by your configuration.
168
-
169
- /**
170
- * Desc.
171
- */
172
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noMultilineBlocks":true}]
173
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
174
-
175
- /** desc
176
- *
177
- */
178
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noMultilineBlocks":true}]
179
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
180
-
181
- /** desc
182
- *
183
- */
184
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noMultilineBlocks":true,"noSingleLineBlocks":true}]
185
- // Message: Multiline jsdoc blocks are prohibited by your configuration but fixing would result in a single line block which you have prohibited with `noSingleLineBlocks`.
186
-
187
- /**
188
- *
189
- */
190
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noMultilineBlocks":true}]
191
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
192
-
193
- /**
194
- * This is not long enough to be permitted.
195
- */
196
- // "jsdoc/multiline-blocks": ["error"|"warn", {"minimumLengthForMultiline":100,"noMultilineBlocks":true}]
197
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
198
-
199
- /**
200
- * This is not long enough to be permitted.
201
- */
202
- // "jsdoc/multiline-blocks": ["error"|"warn", {"allowMultipleTags":true,"minimumLengthForMultiline":100,"noMultilineBlocks":true}]
203
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
204
-
205
- /**
206
- * This has the wrong tags so is not permitted.
207
- * @notTheRightTag
208
- */
209
- // "jsdoc/multiline-blocks": ["error"|"warn", {"allowMultipleTags":false,"multilineTags":["onlyThisIsExempted"],"noMultilineBlocks":true}]
210
- // Message: Multiline jsdoc blocks are prohibited by your configuration but the block has a description with a tag.
211
-
212
- /**
213
- * This has too many tags so cannot be fixed ot a single line.
214
- * @oneTag
215
- * @anotherTag
216
- */
217
- // "jsdoc/multiline-blocks": ["error"|"warn", {"allowMultipleTags":false,"multilineTags":[],"noMultilineBlocks":true}]
218
- // Message: Multiline jsdoc blocks are prohibited by your configuration but the block has multiple tags.
219
-
220
- /**
221
- * This has a tag and description so cannot be fixed ot a single line.
222
- * @oneTag
223
- */
224
- // "jsdoc/multiline-blocks": ["error"|"warn", {"allowMultipleTags":false,"multilineTags":[],"noMultilineBlocks":true}]
225
- // Message: Multiline jsdoc blocks are prohibited by your configuration but the block has a description with a tag.
226
-
227
- /**
228
- * This has no tags so is not permitted.
229
- */
230
- // "jsdoc/multiline-blocks": ["error"|"warn", {"multilineTags":["*"],"noMultilineBlocks":true}]
231
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
232
-
233
- /**
234
- * This has the wrong tags so is not permitted.
235
- * @notTheRightTag
236
- */
237
- // "jsdoc/multiline-blocks": ["error"|"warn", {"allowMultipleTags":false,"minimumLengthForMultiline":500,"multilineTags":["onlyThisIsExempted"],"noMultilineBlocks":true}]
238
- // Message: Multiline jsdoc blocks are prohibited by your configuration but the block has a description with a tag.
239
-
240
- /**
241
- * @lends This can be safely fixed to a single line.
242
- */
243
- // "jsdoc/multiline-blocks": ["error"|"warn", {"multilineTags":[],"noMultilineBlocks":true,"noSingleLineBlocks":true}]
244
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
245
-
246
- /**
247
- * @type {aType} This can be safely fixed to a single line.
248
- */
249
- // "jsdoc/multiline-blocks": ["error"|"warn", {"multilineTags":[],"noMultilineBlocks":true,"noSingleLineBlocks":true}]
250
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
251
-
252
- /**
253
- * @aTag
254
- */
255
- // "jsdoc/multiline-blocks": ["error"|"warn", {"multilineTags":[],"noMultilineBlocks":true}]
256
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
257
-
258
- /**
259
- * This is a problem when single and multiline are blocked.
260
- */
261
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noMultilineBlocks":true,"noSingleLineBlocks":true}]
262
- // Message: Multiline jsdoc blocks are prohibited by your configuration but fixing would result in a single line block which you have prohibited with `noSingleLineBlocks`.
263
-
264
- /** This comment is bad
265
- * It should not have text on line zero
266
- */
267
- // "jsdoc/multiline-blocks": ["error"|"warn", {"minimumLengthForMultiline":50,"noMultilineBlocks":true,"noZeroLineText":true}]
268
- // Message: Should have no text on the "0th" line (after the `/**`).
269
-
270
- /**
271
- * @lends This can be safely fixed
272
- * to a single
273
- * line. */
274
- // "jsdoc/multiline-blocks": ["error"|"warn", {"multilineTags":[],"noMultilineBlocks":true}]
275
- // Message: Multiline jsdoc blocks are prohibited by your configuration.
276
-
277
- /**
278
- * @someTag {aType} with Description */
279
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noFinalLineText":true}]
280
- // Message: Should have no text on the final line (before the `*/`).
281
-
282
- /**
283
- * Description */
284
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noFinalLineText":true}]
285
- // Message: Should have no text on the final line (before the `*/`).
286
- ````
287
-
288
-
289
-
290
- <a name="user-content-passing-examples"></a>
291
- <a name="passing-examples"></a>
292
- ## Passing examples
293
-
294
- The following patterns are not considered problems:
295
-
296
- ````js
297
- /** Not reported */
298
-
299
- /**
300
- * Not reported
301
- */
302
-
303
- /** Reported up here
304
- * because the rest is multiline
305
- */
306
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noZeroLineText":false}]
307
-
308
- /** @tag */
309
-
310
- /** @lends */
311
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noSingleLineBlocks":true}]
312
-
313
- /** @tag */
314
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noSingleLineBlocks":true,"singleLineTags":["tag"]}]
315
-
316
- /** @tag */
317
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noSingleLineBlocks":true,"singleLineTags":["*"]}]
318
-
319
- /**
320
- *
321
- */
322
-
323
- /**
324
- *
325
- */
326
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noMultilineBlocks":false}]
327
-
328
- /** Test */
329
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noMultilineBlocks":true}]
330
-
331
- /**
332
- * This is long enough to be permitted by our config.
333
- */
334
- // "jsdoc/multiline-blocks": ["error"|"warn", {"minimumLengthForMultiline":25,"noMultilineBlocks":true}]
335
-
336
- /**
337
- * This is long enough to be permitted by our config.
338
- */
339
- // "jsdoc/multiline-blocks": ["error"|"warn", {"minimumLengthForMultiline":50,"noMultilineBlocks":true}]
340
-
341
- /**
342
- * This has the right tag so is permitted.
343
- * @theRightTag
344
- */
345
- // "jsdoc/multiline-blocks": ["error"|"warn", {"multilineTags":["theRightTag"],"noMultilineBlocks":true}]
346
-
347
- /** This has no tags but is single line so is not permitted. */
348
- // "jsdoc/multiline-blocks": ["error"|"warn", {"multilineTags":["*"],"noMultilineBlocks":true}]
349
-
350
- /**
351
- * This has the wrong tags so is not permitted.
352
- * @notTheRightTag
353
- */
354
- // "jsdoc/multiline-blocks": ["error"|"warn", {"minimumLengthForMultiline":10,"multilineTags":["onlyThisIsExempted"],"noMultilineBlocks":true}]
355
-
356
- /**
357
- * This has the wrong tags so is not permitted.
358
- * @theRightTag
359
- */
360
- // "jsdoc/multiline-blocks": ["error"|"warn", {"minimumLengthForMultiline":500,"multilineTags":["theRightTag"],"noMultilineBlocks":true}]
361
-
362
- /** tag */
363
-
364
- /**
365
- * @lends This is ok per multiline
366
- */
367
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noMultilineBlocks":true,"noSingleLineBlocks":true}]
368
-
369
- /**
370
- * This has too many tags so cannot be fixed ot a single line.
371
- * @oneTag
372
- * @anotherTag
373
- */
374
- // "jsdoc/multiline-blocks": ["error"|"warn", {"multilineTags":[],"noMultilineBlocks":true}]
375
-
376
- /**
377
- * This has too many tags so cannot be fixed ot a single line.
378
- * @oneTag
379
- * @anotherTag
380
- */
381
- // "jsdoc/multiline-blocks": ["error"|"warn", {"allowMultipleTags":true,"multilineTags":[],"noMultilineBlocks":true}]
382
-
383
- /**
384
- * This has a tag and description so cannot be fixed ot a single line.
385
- * @oneTag
386
- */
387
- // "jsdoc/multiline-blocks": ["error"|"warn", {"allowMultipleTags":true,"multilineTags":[],"noMultilineBlocks":true}]
388
-
389
- /**
390
- * This has a tag and description so cannot be fixed ot a single line.
391
- * @oneTag
392
- */
393
- // "jsdoc/multiline-blocks": ["error"|"warn", {"allowMultipleTags":false,"multilineTags":["oneTag"],"noMultilineBlocks":true}]
394
-
395
- /** @someTag with Description */
396
- // "jsdoc/multiline-blocks": ["error"|"warn", {"noFinalLineText":true}]
397
- ````
398
-