eslint-plugin-jsdoc 44.2.3 → 44.2.5

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 (120) hide show
  1. package/dist/WarnSettings.js +0 -1
  2. package/dist/WarnSettings.js.map +1 -1
  3. package/dist/alignTransform.js +87 -5
  4. package/dist/alignTransform.js.map +1 -1
  5. package/dist/bin/generateRule.js +4 -3
  6. package/dist/bin/generateRule.js.map +1 -1
  7. package/dist/exportParser.js +272 -71
  8. package/dist/exportParser.js.map +1 -1
  9. package/dist/generateRule.js +4 -3
  10. package/dist/generateRule.js.map +1 -1
  11. package/dist/iterateJsdoc.js +921 -357
  12. package/dist/iterateJsdoc.js.map +1 -1
  13. package/dist/jsdocUtils.js +270 -168
  14. package/dist/jsdocUtils.js.map +1 -1
  15. package/dist/rules/checkAlignment.js +6 -0
  16. package/dist/rules/checkAlignment.js.map +1 -1
  17. package/dist/rules/checkExamples.js +73 -9
  18. package/dist/rules/checkExamples.js.map +1 -1
  19. package/dist/rules/checkIndentation.js +12 -2
  20. package/dist/rules/checkIndentation.js.map +1 -1
  21. package/dist/rules/checkLineAlignment.js +71 -7
  22. package/dist/rules/checkLineAlignment.js.map +1 -1
  23. package/dist/rules/checkParamNames.js +29 -11
  24. package/dist/rules/checkParamNames.js.map +1 -1
  25. package/dist/rules/checkPropertyNames.js +13 -7
  26. package/dist/rules/checkPropertyNames.js.map +1 -1
  27. package/dist/rules/checkTagNames.js +45 -9
  28. package/dist/rules/checkTagNames.js.map +1 -1
  29. package/dist/rules/checkTypes.js +98 -41
  30. package/dist/rules/checkTypes.js.map +1 -1
  31. package/dist/rules/checkValues.js +7 -7
  32. package/dist/rules/checkValues.js.map +1 -1
  33. package/dist/rules/emptyTags.js +8 -1
  34. package/dist/rules/emptyTags.js.map +1 -1
  35. package/dist/rules/informativeDocs.js +27 -8
  36. package/dist/rules/informativeDocs.js.map +1 -1
  37. package/dist/rules/matchDescription.js +18 -1
  38. package/dist/rules/matchDescription.js.map +1 -1
  39. package/dist/rules/matchName.js +2 -2
  40. package/dist/rules/matchName.js.map +1 -1
  41. package/dist/rules/multilineBlocks.js +12 -1
  42. package/dist/rules/multilineBlocks.js.map +1 -1
  43. package/dist/rules/noBadBlocks.js +4 -6
  44. package/dist/rules/noBadBlocks.js.map +1 -1
  45. package/dist/rules/noBlankBlockDescriptions.js +2 -0
  46. package/dist/rules/noBlankBlockDescriptions.js.map +1 -1
  47. package/dist/rules/noMissingSyntax.js +53 -16
  48. package/dist/rules/noMissingSyntax.js.map +1 -1
  49. package/dist/rules/noMultiAsterisks.js +1 -6
  50. package/dist/rules/noMultiAsterisks.js.map +1 -1
  51. package/dist/rules/noRestrictedSyntax.js +12 -5
  52. package/dist/rules/noRestrictedSyntax.js.map +1 -1
  53. package/dist/rules/noTypes.js +3 -0
  54. package/dist/rules/noTypes.js.map +1 -1
  55. package/dist/rules/noUndefinedTypes.js +65 -27
  56. package/dist/rules/noUndefinedTypes.js.map +1 -1
  57. package/dist/rules/requireAsteriskPrefix.js +20 -0
  58. package/dist/rules/requireAsteriskPrefix.js.map +1 -1
  59. package/dist/rules/requireDescription.js +6 -2
  60. package/dist/rules/requireDescription.js.map +1 -1
  61. package/dist/rules/requireDescriptionCompleteSentence.js +75 -12
  62. package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -1
  63. package/dist/rules/requireFileOverview.js +9 -4
  64. package/dist/rules/requireFileOverview.js.map +1 -1
  65. package/dist/rules/requireHyphenBeforeParamDescription.js +21 -7
  66. package/dist/rules/requireHyphenBeforeParamDescription.js.map +1 -1
  67. package/dist/rules/requireJsdoc.js +150 -29
  68. package/dist/rules/requireJsdoc.js.map +1 -1
  69. package/dist/rules/requireParam.js +116 -10
  70. package/dist/rules/requireParam.js.map +1 -1
  71. package/dist/rules/requireProperty.js +1 -1
  72. package/dist/rules/requireProperty.js.map +1 -1
  73. package/dist/rules/requireReturns.js +2 -3
  74. package/dist/rules/requireReturns.js.map +1 -1
  75. package/dist/rules/requireReturnsCheck.js +9 -2
  76. package/dist/rules/requireReturnsCheck.js.map +1 -1
  77. package/dist/rules/requireThrows.js +2 -3
  78. package/dist/rules/requireThrows.js.map +1 -1
  79. package/dist/rules/requireYields.js +9 -3
  80. package/dist/rules/requireYields.js.map +1 -1
  81. package/dist/rules/requireYieldsCheck.js +19 -5
  82. package/dist/rules/requireYieldsCheck.js.map +1 -1
  83. package/dist/rules/sortTags.js +67 -9
  84. package/dist/rules/sortTags.js.map +1 -1
  85. package/dist/rules/tagLines.js +22 -3
  86. package/dist/rules/tagLines.js.map +1 -1
  87. package/dist/rules/textEscaping.js +18 -4
  88. package/dist/rules/textEscaping.js.map +1 -1
  89. package/dist/rules/validTypes.js +26 -9
  90. package/dist/rules/validTypes.js.map +1 -1
  91. package/dist/tagNames.js +0 -2
  92. package/dist/tagNames.js.map +1 -1
  93. package/dist/utils/hasReturnValue.js +77 -48
  94. package/dist/utils/hasReturnValue.js.map +1 -1
  95. package/docs/rules/check-line-alignment.md +7 -0
  96. package/docs/rules/check-tag-names.md +15 -0
  97. package/docs/rules/no-missing-syntax.md +6 -0
  98. package/docs/rules/no-undefined-types.md +6 -0
  99. package/docs/rules/require-description-complete-sentence.md +525 -289
  100. package/docs/rules/require-description.md +289 -525
  101. package/docs/rules/require-file-overview.md +7 -0
  102. package/docs/rules/require-jsdoc.md +1 -1
  103. package/docs/rules/require-param-description.md +116 -1694
  104. package/docs/rules/require-param-name.md +58 -133
  105. package/docs/rules/require-param-type.md +119 -55
  106. package/docs/rules/require-param.md +1704 -111
  107. package/docs/rules/require-property-description.md +39 -79
  108. package/docs/rules/require-property-name.md +21 -30
  109. package/docs/rules/require-property-type.md +21 -21
  110. package/docs/rules/require-property.md +82 -33
  111. package/docs/rules/require-returns-check.md +636 -747
  112. package/docs/rules/require-returns-description.md +61 -933
  113. package/docs/rules/require-returns-type.md +42 -79
  114. package/docs/rules/require-returns.md +1081 -61
  115. package/docs/rules/require-yields-check.md +238 -517
  116. package/docs/rules/require-yields.md +517 -238
  117. package/docs/rules/valid-types.md +1 -1
  118. package/docs/settings.md +3 -1
  119. package/package.json +10 -9
  120. package/tsconfig.json +2 -3
@@ -1,584 +1,820 @@
1
- <a name="user-content-require-description"></a>
2
- <a name="require-description"></a>
3
- # <code>require-description</code>
1
+ <a name="user-content-require-description-complete-sentence"></a>
2
+ <a name="require-description-complete-sentence"></a>
3
+ # <code>require-description-complete-sentence</code>
4
+
5
+ * [Fixer](#user-content-require-description-complete-sentence-fixer)
6
+ * [Options](#user-content-require-description-complete-sentence-options)
7
+ * [`tags`](#user-content-require-description-complete-sentence-options-tags)
8
+ * [`abbreviations`](#user-content-require-description-complete-sentence-options-abbreviations)
9
+ * [`newlineBeforeCapsAssumesBadSentenceEnd`](#user-content-require-description-complete-sentence-options-newlinebeforecapsassumesbadsentenceend)
10
+ * [Context and settings](#user-content-require-description-complete-sentence-context-and-settings)
11
+ * [Failing examples](#user-content-require-description-complete-sentence-failing-examples)
12
+ * [Passing examples](#user-content-require-description-complete-sentence-passing-examples)
13
+
14
+
15
+ Requires that block description, explicit `@description`, and
16
+ `@param`/`@returns` tag descriptions are written in complete sentences, i.e.,
17
+
18
+ * Description must start with an uppercase alphabetical character.
19
+ * Paragraphs must start with an uppercase alphabetical character.
20
+ * Sentences must end with a period, question mark, exclamation mark, or triple backticks.
21
+ * Every line in a paragraph (except the first) which starts with an uppercase
22
+ character must be preceded by a line ending with a period.
23
+ * A colon or semi-colon followed by two line breaks is still part of the
24
+ containing paragraph (unlike normal dual line breaks).
25
+ * Text within inline tags `{...}` or within triple backticks are not checked for sentence divisions.
26
+ * Periods after items within the `abbreviations` option array are not treated
27
+ as sentence endings.
28
+
29
+ <a name="user-content-require-description-complete-sentence-fixer"></a>
30
+ <a name="require-description-complete-sentence-fixer"></a>
31
+ ## Fixer
32
+
33
+ If sentences do not end with terminal punctuation, a period will be added.
34
+
35
+ If sentences do not start with an uppercase character, the initial
36
+ letter will be capitalized.
37
+
38
+ <a name="user-content-require-description-complete-sentence-options"></a>
39
+ <a name="require-description-complete-sentence-options"></a>
40
+ ## Options
41
+
42
+ <a name="user-content-require-description-complete-sentence-options-tags"></a>
43
+ <a name="require-description-complete-sentence-options-tags"></a>
44
+ ### <code>tags</code>
4
45
 
5
- * [Options](#user-content-require-description-options)
6
- * [Context and settings](#user-content-require-description-context-and-settings)
7
- * [Failing examples](#user-content-require-description-failing-examples)
8
- * [Passing examples](#user-content-require-description-passing-examples)
46
+ If you want additional tags to be checked for their descriptions, you may
47
+ add them within this option.
9
48
 
49
+ ```js
50
+ {
51
+ 'jsdoc/require-description-complete-sentence': ['error', {
52
+ tags: ['see', 'copyright']
53
+ }]
54
+ }
55
+ ```
10
56
 
11
- Requires that all functions have a description.
57
+ The tags `@param`/`@arg`/`@argument` and `@property`/`@prop` will be properly
58
+ parsed to ensure that the checked "description" text includes only the text
59
+ after the name.
12
60
 
13
- * All functions must have an implicit description (e.g., text above tags) or
14
- have the option `descriptionStyle` set to `tag` (requiring `@description`
15
- (or `@desc` if that is set as your preferred tag name)).
16
- * Every jsdoc block description (or `@description` tag if `descriptionStyle`
17
- is `"tag"`) must have a non-empty description that explains the purpose of
18
- the method.
61
+ All other tags will treat the text following the tag name, a space, and
62
+ an optional curly-bracketed type expression (and another space) as part of
63
+ its "description" (e.g., for `@returns {someType} some description`, the
64
+ description is `some description` while for `@some-tag xyz`, the description
65
+ is `xyz`).
19
66
 
20
- <a name="user-content-require-description-options"></a>
21
- <a name="require-description-options"></a>
22
- ## Options
67
+ <a name="user-content-require-description-complete-sentence-options-abbreviations"></a>
68
+ <a name="require-description-complete-sentence-options-abbreviations"></a>
69
+ ### <code>abbreviations</code>
23
70
 
24
- An options object may have any of the following properties:
25
-
26
- - `contexts` - Set to an array of strings representing the AST context
27
- where you wish the rule to be applied (e.g., `ClassDeclaration` for ES6
28
- classes). Overrides the default contexts (see below). Set to `"any"` if
29
- you want the rule to apply to any jsdoc block throughout your files.
30
- - `exemptedBy` - Array of tags (e.g., `['type']`) whose presence on the
31
- document block avoids the need for a `@description`. Defaults to an
32
- array with `inheritdoc`. If you set this array, it will overwrite the
33
- default, so be sure to add back `inheritdoc` if you wish its presence
34
- to cause exemption of the rule.
35
- - `descriptionStyle` - Whether to accept implicit descriptions (`"body"`) or
36
- `@description` tags (`"tag"`) as satisfying the rule. Set to `"any"` to
37
- accept either style. Defaults to `"body"`.
38
- - `checkConstructors` - A value indicating whether `constructor`s should be
39
- checked. Defaults to `true`.
40
- - `checkGetters` - A value indicating whether getters should be checked.
41
- Defaults to `true`.
42
- - `checkSetters` - A value indicating whether setters should be checked.
43
- Defaults to `true`.
44
-
45
- <a name="user-content-require-description-context-and-settings"></a>
46
- <a name="require-description-context-and-settings"></a>
71
+ You can provide an `abbreviations` options array to avoid such strings of text
72
+ being treated as sentence endings when followed by dots. The `.` is not
73
+ necessary at the end of the array items.
74
+
75
+ <a name="user-content-require-description-complete-sentence-options-newlinebeforecapsassumesbadsentenceend"></a>
76
+ <a name="require-description-complete-sentence-options-newlinebeforecapsassumesbadsentenceend"></a>
77
+ ### <code>newlineBeforeCapsAssumesBadSentenceEnd</code>
78
+
79
+ When `false` (the new default), we will not assume capital letters after
80
+ newlines are an incorrect way to end the sentence (they may be proper
81
+ nouns, for example).
82
+
83
+ <a name="user-content-require-description-complete-sentence-context-and-settings"></a>
84
+ <a name="require-description-complete-sentence-context-and-settings"></a>
47
85
  ## Context and settings
48
86
 
49
- | | |
50
- | -------- | ---------------------- |
51
- | Context | `ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled |
52
- | Tags | `description` or jsdoc block |
53
- | Aliases | `desc` |
54
- | Recommended | false |
55
- | Options | `contexts`, `exemptedBy`, `descriptionStyle`, `checkConstructors`, `checkGetters`, `checkSetters` |
56
- | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
57
-
58
- <a name="user-content-require-description-failing-examples"></a>
59
- <a name="require-description-failing-examples"></a>
87
+ |||
88
+ |---|---|
89
+ |Context|everywhere|
90
+ |Tags|doc block, `param`, `returns`, `description`, `property`, `summary`, `file`, `classdesc`, `todo`, `deprecated`, `throws`, 'yields' and others added by `tags`|
91
+ |Aliases|`arg`, `argument`, `return`, `desc`, `prop`, `fileoverview`, `overview`, `exception`, `yield`|
92
+ |Recommended|false|
93
+ |Options|`tags`, `abbreviations`, `newlineBeforeCapsAssumesBadSentenceEnd`|
94
+
95
+ <a name="user-content-require-description-complete-sentence-failing-examples"></a>
96
+ <a name="require-description-complete-sentence-failing-examples"></a>
60
97
  ## Failing examples
61
98
 
62
99
  The following patterns are considered problems:
63
100
 
64
101
  ````js
65
102
  /**
66
- *
103
+ * foo.
67
104
  */
68
105
  function quux () {
69
106
 
70
107
  }
71
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
72
- // Message: Missing JSDoc @description declaration.
108
+ // Message: Sentences should start with an uppercase character.
73
109
 
74
110
  /**
75
- *
111
+ * foo?
76
112
  */
77
113
  function quux () {
78
114
 
79
115
  }
80
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"any"}]
81
- // Message: Missing JSDoc block description or @description declaration.
116
+ // Message: Sentences should start with an uppercase character.
82
117
 
83
118
  /**
84
- *
119
+ * @description foo.
85
120
  */
86
121
  function quux () {
87
122
 
88
123
  }
89
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"body"}]
90
- // Message: Missing JSDoc block description.
124
+ // Message: Sentences should start with an uppercase character.
91
125
 
92
126
  /**
93
- * @desc Not a blank description
127
+ * Foo)
94
128
  */
95
129
  function quux () {
96
130
 
97
131
  }
98
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"body"}]
99
- // Message: Remove the @desc tag to leave a plain block description or add additional description text above the @desc line.
132
+ // Message: Sentences must end with a period.
100
133
 
101
134
  /**
102
- * @description Not a blank description
135
+ * `foo` is a variable
103
136
  */
104
137
  function quux () {
105
138
 
106
139
  }
107
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"body"}]
108
- // Message: Remove the @description tag to leave a plain block description or add additional description text above the @description line.
140
+ // Message: Sentences must end with a period.
109
141
 
110
142
  /**
143
+ * Foo.
111
144
  *
145
+ * foo.
112
146
  */
113
- class quux {
147
+ function quux () {
114
148
 
115
149
  }
116
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassDeclaration"],"descriptionStyle":"tag"}]
117
- // Message: Missing JSDoc @description declaration.
150
+ // Message: Sentences should start with an uppercase character.
118
151
 
119
152
  /**
120
- *
153
+ * тест.
154
+ */
155
+ function quux () {
156
+
157
+ }
158
+ // Message: Sentences should start with an uppercase character.
159
+
160
+ /**
161
+ * Foo
121
162
  */
122
- class quux {
163
+ function quux () {
123
164
 
124
165
  }
125
- // Settings: {"jsdoc":{"contexts":["ClassDeclaration"]}}
126
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
127
- // Message: Missing JSDoc @description declaration.
166
+ // Message: Sentences must end with a period.
128
167
 
129
168
  /**
169
+ * Foo
130
170
  *
171
+ * @param x
131
172
  */
132
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["any"],"descriptionStyle":"tag"}]
133
- // Message: Missing JSDoc @description declaration.
173
+ function quux () {
174
+
175
+ }
176
+ // Message: Sentences must end with a period.
134
177
 
135
178
  /**
179
+ * Foo
180
+ * Bar.
181
+ */
182
+ function quux () {
183
+
184
+ }
185
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"newlineBeforeCapsAssumesBadSentenceEnd":true}]
186
+ // Message: A line of text is started with an uppercase character, but the preceding line does not end the sentence.
187
+
188
+ /**
189
+ * Foo.
136
190
  *
191
+ * @param foo foo.
137
192
  */
138
- class quux {
193
+ function quux (foo) {
139
194
 
140
195
  }
141
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassDeclaration"],"descriptionStyle":"tag"}]
142
- // Message: Missing JSDoc @description declaration.
196
+ // Message: Sentences should start with an uppercase character.
143
197
 
144
198
  /**
199
+ * Foo.
145
200
  *
201
+ * @param foo bar
146
202
  */
147
- class quux {
203
+ function quux (foo) {
148
204
 
149
205
  }
150
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassDeclaration"],"descriptionStyle":"tag"}]
151
- // Message: Missing JSDoc @description declaration.
206
+ // Message: Sentences should start with an uppercase character.
152
207
 
153
208
  /**
154
- * @description
209
+ * {@see Foo.bar} buz
155
210
  */
156
- function quux () {
211
+ function quux (foo) {
157
212
 
158
213
  }
159
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
160
- // Message: Missing JSDoc @description description.
214
+ // Message: Sentences should start with an uppercase character.
161
215
 
162
216
  /**
217
+ * Foo.
163
218
  *
219
+ * @returns {number} foo
164
220
  */
165
- interface quux {
221
+ function quux (foo) {
166
222
 
167
223
  }
168
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["TSInterfaceDeclaration"],"descriptionStyle":"tag"}]
169
- // Message: Missing JSDoc @description declaration.
224
+ // Message: Sentences should start with an uppercase character.
170
225
 
171
226
  /**
227
+ * Foo.
172
228
  *
229
+ * @returns foo.
173
230
  */
174
- var quux = class {
231
+ function quux (foo) {
175
232
 
176
- };
177
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassExpression"],"descriptionStyle":"tag"}]
178
- // Message: Missing JSDoc @description declaration.
233
+ }
234
+ // Message: Sentences should start with an uppercase character.
235
+
236
+ /**
237
+ * lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque elit diam,
238
+ * iaculis eu dignissim sed, ultrices sed nisi. nulla at ligula auctor, consectetur neque sed,
239
+ * tincidunt nibh. vivamus sit amet vulputate ligula. vivamus interdum elementum nisl,
240
+ * vitae rutrum tortor semper ut. morbi porta ante vitae dictum fermentum.
241
+ * proin ut nulla at quam convallis gravida in id elit. sed dolor mauris, blandit quis ante at,
242
+ * consequat auctor magna. duis pharetra purus in porttitor mollis.
243
+ */
244
+ function longDescription (foo) {
245
+
246
+ }
247
+ // Message: Sentences should start with an uppercase character.
179
248
 
180
249
  /**
250
+ * @arg {number} foo - Foo
251
+ */
252
+ function quux (foo) {
253
+
254
+ }
255
+ // Message: Sentences must end with a period.
256
+
257
+ /**
258
+ * @argument {number} foo - Foo
259
+ */
260
+ function quux (foo) {
261
+
262
+ }
263
+ // Message: Sentences must end with a period.
264
+
265
+ /**
266
+ * @return {number} foo
267
+ */
268
+ function quux (foo) {
269
+
270
+ }
271
+ // Message: Sentences should start with an uppercase character.
272
+
273
+ /**
274
+ * Returns bar.
181
275
  *
276
+ * @return {number} bar
182
277
  */
183
- var quux = {
278
+ function quux (foo) {
279
+
280
+ }
281
+ // Message: Sentences should start with an uppercase character.
184
282
 
185
- };
186
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ObjectExpression"],"descriptionStyle":"tag"}]
187
- // Message: Missing JSDoc @description declaration.
283
+ /**
284
+ * @throws {object} Hello World
285
+ * hello world
286
+ */
287
+ // Message: Sentences must end with a period.
188
288
 
189
289
  /**
190
- * @someDesc
290
+ * @summary Foo
191
291
  */
192
292
  function quux () {
193
293
 
194
294
  }
195
- // Settings: {"jsdoc":{"tagNamePreference":{"description":{"message":"Please avoid `{{tagName}}`; use `{{replacement}}` instead","replacement":"someDesc"}}}}
196
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
197
- // Message: Missing JSDoc @someDesc description.
295
+ // Message: Sentences must end with a period.
198
296
 
199
297
  /**
200
- * @description
298
+ * @throws {SomeType} Foo
201
299
  */
202
300
  function quux () {
203
301
 
204
302
  }
205
- // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
206
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
207
- // Message: Unexpected tag `@description`
303
+ // Message: Sentences must end with a period.
208
304
 
209
305
  /**
210
- * @description
306
+ * @see Foo
211
307
  */
212
308
  function quux () {
213
309
 
310
+ }
311
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"tags":["see"]}]
312
+ // Message: Sentences must end with a period.
313
+
314
+ /**
315
+ * @param foo Foo bar
316
+ */
317
+ function quux (foo) {
318
+
214
319
  }
215
320
  // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
216
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"any"}]
217
- // Message: Missing JSDoc block description or @description declaration.
321
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"tags":["param"]}]
322
+ // Message: Sentences must end with a period.
218
323
 
219
324
  /**
220
- *
325
+ * Sorry, but this isn't a complete sentence, Mr.
221
326
  */
222
327
  function quux () {
223
- }
224
- // "jsdoc/require-description": ["error"|"warn", {"exemptedBy":["notPresent"]}]
225
- // Message: Missing JSDoc block description.
226
328
 
227
- class TestClass {
228
- /**
229
- *
230
- */
231
- constructor() { }
232
329
  }
233
- // Message: Missing JSDoc block description.
330
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
331
+ // Message: Sentences must end with a period.
234
332
 
235
- class TestClass {
236
- /**
237
- *
238
- */
239
- constructor() { }
240
- }
241
- // "jsdoc/require-description": ["error"|"warn", {"checkConstructors":true}]
242
- // Message: Missing JSDoc block description.
333
+ /**
334
+ * Sorry, but this isn't a complete sentence Mr.
335
+ */
336
+ function quux () {
243
337
 
244
- class TestClass {
245
- /**
246
- *
247
- */
248
- get Test() { }
249
338
  }
250
- // Message: Missing JSDoc block description.
339
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr."]}]
340
+ // Message: Sentences must end with a period.
251
341
 
252
- class TestClass {
253
- /**
254
- *
255
- */
256
- get Test() { }
257
- }
258
- // "jsdoc/require-description": ["error"|"warn", {"checkGetters":true}]
259
- // Message: Missing JSDoc block description.
342
+ /**
343
+ * Sorry, but this isn't a complete sentence Mr.
344
+ */
345
+ function quux () {
260
346
 
261
- class TestClass {
262
- /**
263
- *
264
- */
265
- set Test(value) { }
266
347
  }
267
- // Message: Missing JSDoc block description.
348
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
349
+ // Message: Sentences must end with a period.
350
+
351
+ /**
352
+ * Sorry, but this isn't a complete sentence Mr. and Mrs.
353
+ */
354
+ function quux () {
268
355
 
269
- class TestClass {
270
- /**
271
- *
272
- */
273
- set Test(value) { }
274
356
  }
275
- // "jsdoc/require-description": ["error"|"warn", {"checkSetters":true}]
276
- // Message: Missing JSDoc block description.
357
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr","Mrs"]}]
358
+ // Message: Sentences must end with a period.
277
359
 
278
360
  /**
279
- *
361
+ * This is a complete sentence. But this isn't, Mr.
280
362
  */
281
- class Foo {
282
- /**
283
- *
284
- */
285
- constructor() {}
363
+ function quux () {
286
364
 
287
- /**
288
- *
289
- */
290
- bar() {}
291
365
  }
292
- // "jsdoc/require-description": ["error"|"warn", {"checkConstructors":false,"contexts":["MethodDefinition"]}]
293
- // Message: Missing JSDoc block description.
366
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
367
+ // Message: Sentences must end with a period.
294
368
 
295
369
  /**
296
- * @implements {Bar}
370
+ * This is a complete Mr. sentence. But this isn't, Mr.
297
371
  */
298
- class quux {
372
+ function quux () {
299
373
 
300
374
  }
301
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
302
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"Bar\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
303
- // Message: Missing JSDoc @description declaration.
375
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
376
+ // Message: Sentences must end with a period.
304
377
 
305
378
  /**
306
- * Has some
307
- * description already.
308
- * @implements {Bar}
379
+ * This is a complete Mr. sentence.
309
380
  */
310
- class quux {
381
+ function quux () {
311
382
 
312
383
  }
313
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
314
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"Bar\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
315
- // Message: Missing JSDoc @description declaration.
384
+ // Message: Sentences should start with an uppercase character.
316
385
 
317
386
  /**
318
- * @implements {Bar
319
- * | Foo}
387
+ * This is fun, i.e. enjoyable, but not superlatively so, e.g. not
388
+ * super, wonderful, etc..
320
389
  */
321
- class quux {
390
+ function quux () {
322
391
 
323
392
  }
324
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
325
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTypeUnion > JsdocTypeName[value=\"Bar\"]:nth-child(1))","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
326
- // Message: Missing JSDoc @description declaration.
393
+ // Message: Sentences should start with an uppercase character.
327
394
 
328
395
  /**
329
- * @implements {Bar}
396
+ * Do not have dynamic content; e.g. homepage. Here a simple unique id
397
+ * suffices.
330
398
  */
331
- class quux {
399
+ function quux () {
400
+
401
+ }
402
+ // Message: Sentences should start with an uppercase character.
332
403
 
404
+ /**
405
+ * Implements support for the
406
+ * Swahili voice synthesizer.
407
+ */
408
+ function speak() {
333
409
  }
334
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
335
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[tag=\"implements\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
336
- // Message: Missing JSDoc @description declaration.
410
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"newlineBeforeCapsAssumesBadSentenceEnd":true}]
411
+ // Message: A line of text is started with an uppercase character, but the preceding line does not end the sentence.
337
412
 
338
413
  /**
339
- * @implements {Bar}
414
+ * Foo.
415
+ *
416
+ * @template TempA, TempB foo.
340
417
  */
341
- class quux {
418
+ function quux (foo) {
342
419
 
343
420
  }
344
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
345
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[tag=\"implements\"])","context":"any"}],"descriptionStyle":"tag"}]
346
- // Message: Missing JSDoc @description declaration.
421
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"tags":["template"]}]
422
+ // Message: Sentences should start with an uppercase character.
423
+
424
+ /**
425
+ * Just a component.
426
+ * @param {Object} props Свойства.
427
+ * @return {ReactElement}.
428
+ */
429
+ function quux () {}
430
+ // Message: Sentences must be more than punctuation.
347
431
  ````
348
432
 
349
433
 
350
434
 
351
- <a name="user-content-require-description-passing-examples"></a>
352
- <a name="require-description-passing-examples"></a>
435
+ <a name="user-content-require-description-complete-sentence-passing-examples"></a>
436
+ <a name="require-description-complete-sentence-passing-examples"></a>
353
437
  ## Passing examples
354
438
 
355
439
  The following patterns are not considered problems:
356
440
 
357
441
  ````js
358
442
  /**
359
- *
443
+ * @param foo - Foo.
360
444
  */
445
+ function quux () {
446
+
447
+ }
361
448
 
362
449
  /**
363
- * @description
364
- * // arbitrary description content
450
+ * Foo.
365
451
  */
366
452
  function quux () {
367
453
 
368
454
  }
369
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
370
455
 
371
456
  /**
372
- * @description
373
- * quux(); // does something useful
457
+ * Foo.
458
+ * Bar.
374
459
  */
375
460
  function quux () {
376
461
 
377
462
  }
378
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
379
463
 
380
464
  /**
381
- * @description <caption>Valid usage</caption>
382
- * quux(); // does something useful
465
+ * Foo.
383
466
  *
384
- * @description <caption>Invalid usage</caption>
385
- * quux('random unwanted arg'); // results in an error
467
+ * Bar.
386
468
  */
387
469
  function quux () {
388
470
 
389
471
  }
390
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
391
472
 
392
473
  /**
393
- *
474
+ * Тест.
394
475
  */
395
- class quux {
476
+ function quux () {
396
477
 
397
478
  }
398
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
399
479
 
400
480
  /**
401
- *
481
+ * Foo
482
+ * bar.
402
483
  */
403
484
  function quux () {
404
485
 
405
486
  }
406
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassDeclaration"]}]
407
487
 
408
488
  /**
409
- * @type {MyCallback}
489
+ * @returns Foo bar.
410
490
  */
411
491
  function quux () {
412
492
 
413
493
  }
414
- // "jsdoc/require-description": ["error"|"warn", {"exemptedBy":["type"]}]
415
494
 
416
495
  /**
496
+ * Foo {@see Math.sin}.
497
+ */
498
+ function quux () {
499
+
500
+ }
501
+
502
+ /**
503
+ * Foo {@see Math.sin} bar.
504
+ */
505
+ function quux () {
506
+
507
+ }
508
+
509
+ /**
510
+ * Foo?
417
511
  *
512
+ * Bar!
513
+ *
514
+ * Baz:
515
+ * 1. Foo.
516
+ * 2. Bar.
517
+ */
518
+ function quux () {
519
+
520
+ }
521
+
522
+ /**
523
+ * Hello:
524
+ * World.
418
525
  */
419
- interface quux {
526
+ function quux () {
420
527
 
421
528
  }
422
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
423
529
 
424
- interface quux {
425
- /**
426
- * If the thing should be checked.
427
- */
428
- checked?: boolean
530
+ /**
531
+ * Hello: world.
532
+ */
533
+ function quux () {
534
+
429
535
  }
430
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["TSPropertySignature"]}]
431
536
 
432
537
  /**
433
538
  *
434
539
  */
435
- var quux = class {
540
+ function quux () {
541
+
542
+ }
543
+
544
+ /**
545
+ * @description Foo.
546
+ */
547
+ function quux () {
436
548
 
437
- };
438
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
549
+ }
439
550
 
440
551
  /**
552
+ * `foo` is a variable.
553
+ */
554
+ function quux () {
555
+
556
+ }
557
+
558
+ /**
559
+ * Foo.
441
560
  *
561
+ * `foo`.
562
+ */
563
+ function quux () {
564
+
565
+ }
566
+
567
+ /**
568
+ * @param foo - `bar`.
442
569
  */
443
- var quux = {
570
+ function quux () {
444
571
 
445
- };
446
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
572
+ }
447
573
 
448
574
  /**
449
- * Has an implicit description
575
+ * @returns {number} `foo`.
450
576
  */
451
577
  function quux () {
452
578
 
453
579
  }
454
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"body"}]
455
580
 
456
581
  /**
457
- * Has an implicit description
582
+ * Foo
583
+ * `bar`.
458
584
  */
459
585
  function quux () {
460
586
 
461
587
  }
462
588
 
463
589
  /**
464
- * Has an implicit description
590
+ * @example Foo
465
591
  */
466
592
  function quux () {
467
593
 
468
594
  }
469
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"any"}]
470
595
 
471
596
  /**
472
- * @description Has an explicit description
597
+ * @see Foo
473
598
  */
474
599
  function quux () {
475
600
 
476
601
  }
477
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"any"}]
478
602
 
479
603
  /**
604
+ * Foo.
480
605
  *
606
+ * @param foo Foo.
481
607
  */
482
- function quux () {
608
+ function quux (foo) {
609
+
610
+ }
611
+
612
+ /**
613
+ * Foo.
614
+ *
615
+ * @param foo Foo.
616
+ */
617
+ function quux (foo) {
618
+
619
+ }
620
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"tags":["param"]}]
621
+
622
+ /**
623
+ * @param foo Foo bar.
624
+ */
625
+ function quux (foo) {
483
626
 
484
627
  }
485
628
  // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
629
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"tags":["param"]}]
630
+
631
+ /**
632
+ *
633
+ */
634
+ function quux (foo) {
486
635
 
487
- class TestClass {
488
- /**
489
- * Test.
490
- */
491
- constructor() { }
492
636
  }
637
+ // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
638
+
639
+ /**
640
+ * We stop loading Items when we have loaded:
641
+ *
642
+ * 1) The main Item;
643
+ * 2) All its variants.
644
+ */
645
+
646
+ /**
647
+ * This method is working on 2 steps.
648
+ *
649
+ * | Step | Comment |
650
+ * |------|-------------|
651
+ * | 1 | do it |
652
+ * | 2 | do it again |
653
+ */
654
+
655
+ /**
656
+ * This is something that
657
+ * I want to test.
658
+ */
659
+ function quux () {
493
660
 
494
- class TestClass {
495
- /**
496
- *
497
- */
498
- constructor() { }
499
661
  }
500
- // "jsdoc/require-description": ["error"|"warn", {"checkConstructors":false}]
501
662
 
502
- class TestClass {
503
- /**
504
- * Test.
505
- */
506
- get Test() { }
663
+ /**
664
+ * When making HTTP requests, the
665
+ * URL is super important.
666
+ */
667
+ function quux () {
668
+
507
669
  }
508
670
 
509
- class TestClass {
510
- /**
511
- *
512
- */
513
- get Test() { }
671
+ /**
672
+ * Sorry, but this isn't a complete sentence, Mr.
673
+ */
674
+ function quux () {
675
+
514
676
  }
515
- // "jsdoc/require-description": ["error"|"warn", {"checkGetters":false}]
516
677
 
517
- class TestClass {
518
- /**
519
- * Test.
520
- */
521
- set Test(value) { }
678
+ /**
679
+ * Sorry, but this isn't a complete sentence Mr..
680
+ */
681
+ function quux () {
682
+
683
+ }
684
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr."]}]
685
+
686
+ /**
687
+ * Sorry, but this isn't a complete sentence Mr.
688
+ */
689
+ function quux () {
690
+
522
691
  }
523
692
 
524
- class TestClass {
525
- /**
526
- *
527
- */
528
- set Test(value) { }
693
+ /**
694
+ * Sorry, but this isn't a complete sentence Mr. and Mrs..
695
+ */
696
+ function quux () {
697
+
698
+ }
699
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr","Mrs"]}]
700
+
701
+ /**
702
+ * This is a complete sentence aMr.
703
+ */
704
+ function quux () {
705
+
706
+ }
707
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
708
+
709
+ /**
710
+ * This is a complete sentence. But this isn't, Mr.
711
+ */
712
+ function quux () {
713
+
714
+ }
715
+
716
+ /**
717
+ * This is a complete Mr. Sentence. But this isn't, Mr.
718
+ */
719
+ function quux () {
720
+
529
721
  }
530
- // "jsdoc/require-description": ["error"|"warn", {"checkSetters":false}]
531
722
 
532
723
  /**
533
- * Multi
534
- * line
724
+ * This is a complete Mr. sentence.
535
725
  */
536
726
  function quux () {
537
727
 
538
728
  }
729
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["Mr"]}]
539
730
 
540
- /** Single line */
731
+ /**
732
+ * This is fun, i.e. enjoyable, but not superlatively so, e.g. not
733
+ * super, wonderful, etc..
734
+ */
541
735
  function quux () {
542
736
 
543
737
  }
738
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["etc","e.g.","i.e."]}]
739
+
544
740
 
545
- /** @description something */
741
+ **
742
+ * Do not have dynamic content; e.g. homepage. Here a simple unique id
743
+ * suffices.
744
+ */
546
745
  function quux () {
547
746
 
548
747
  }
549
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
748
+ // "jsdoc/require-description-complete-sentence": ["error"|"warn", {"abbreviations":["etc","e.g.","i.e."]}]
550
749
 
551
750
  /**
552
- * @implements {Bar}
751
+ * Implements support for the
752
+ * Swahili voice synthesizer.
553
753
  */
554
- class quux {
754
+ function speak() {
755
+ }
555
756
 
757
+ /**
758
+ * @param foo
759
+ *
760
+ * @returns {void}
761
+ */
762
+ export default (foo) => {
763
+ foo()
556
764
  }
557
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
558
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=/\\s{4}/]:has(JsdocTag[rawType=\"class\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
765
+
766
+ /** @file To learn more,
767
+ * see: https://github.com/d3/d3-ease. */
768
+
769
+ /** To learn more,
770
+ * see: https://github.com/d3/d3-ease. */
559
771
 
560
772
  /**
561
- * Has some
562
- * description already.
773
+ * This is a complete sentence...
563
774
  */
564
- class quux {
775
+ function quux () {
565
776
 
566
777
  }
567
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
568
778
 
569
779
  /**
570
- * Has some
571
- * description already.
780
+ * He wanted a few items: a jacket and shirt...
572
781
  */
573
- class quux {
782
+ function quux () {
574
783
 
575
784
  }
576
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"any"}],"descriptionStyle":"tag"}]
577
785
 
578
786
  /**
579
- * Has some
580
- * description already.
787
+ * The code in question was...
788
+ * ```
789
+ * alert('hello');
790
+ * ```
581
791
  */
582
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"any"}],"descriptionStyle":"tag"}]
792
+ function quux () {
793
+
794
+ }
795
+
796
+ /**
797
+ * @param {number|string|Date|Object|OverType|WhateverElse} multiType -
798
+ * Nice long explanation...
799
+ */
800
+ function test (multiType) {
801
+ }
802
+
803
+ /**
804
+ * Any kind of fowl (e.g., a duck).
805
+ */
806
+ function quux () {}
807
+
808
+ /**
809
+ * The code in question was...
810
+ * ```
811
+ * do something
812
+ *
813
+ * interesting
814
+ * ```
815
+ */
816
+ function quux () {
817
+
818
+ }
583
819
  ````
584
820