eslint-plugin-jsdoc 46.4.5 → 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 (66) hide show
  1. package/README.md +31 -0
  2. package/dist/alignTransform.js +5 -5
  3. package/dist/alignTransform.js.map +1 -1
  4. package/dist/index.js +21 -10
  5. package/dist/index.js.map +1 -1
  6. package/dist/iterateJsdoc.js +1 -1
  7. package/dist/iterateJsdoc.js.map +1 -1
  8. package/dist/rules/checkExamples.js +12 -6
  9. package/dist/rules/checkExamples.js.map +1 -1
  10. package/package.json +19 -15
  11. package/docs/advanced.md +0 -102
  12. package/docs/rules/check-access.md +0 -193
  13. package/docs/rules/check-alignment.md +0 -169
  14. package/docs/rules/check-examples.md +0 -784
  15. package/docs/rules/check-indentation.md +0 -296
  16. package/docs/rules/check-line-alignment.md +0 -1002
  17. package/docs/rules/check-param-names.md +0 -1035
  18. package/docs/rules/check-property-names.md +0 -244
  19. package/docs/rules/check-syntax.md +0 -80
  20. package/docs/rules/check-tag-names.md +0 -1132
  21. package/docs/rules/check-types.md +0 -1198
  22. package/docs/rules/check-values.md +0 -409
  23. package/docs/rules/empty-tags.md +0 -220
  24. package/docs/rules/implements-on-classes.md +0 -219
  25. package/docs/rules/imports-as-dependencies.md +0 -99
  26. package/docs/rules/informative-docs.md +0 -400
  27. package/docs/rules/match-description.md +0 -1008
  28. package/docs/rules/match-name.md +0 -249
  29. package/docs/rules/multiline-blocks.md +0 -398
  30. package/docs/rules/no-bad-blocks.md +0 -174
  31. package/docs/rules/no-blank-block-descriptions.md +0 -91
  32. package/docs/rules/no-blank-blocks.md +0 -98
  33. package/docs/rules/no-defaults.md +0 -207
  34. package/docs/rules/no-missing-syntax.md +0 -275
  35. package/docs/rules/no-multi-asterisks.md +0 -278
  36. package/docs/rules/no-restricted-syntax.md +0 -383
  37. package/docs/rules/no-types.md +0 -168
  38. package/docs/rules/no-undefined-types.md +0 -789
  39. package/docs/rules/require-asterisk-prefix.md +0 -297
  40. package/docs/rules/require-description-complete-sentence.md +0 -820
  41. package/docs/rules/require-description.md +0 -585
  42. package/docs/rules/require-example.md +0 -390
  43. package/docs/rules/require-file-overview.md +0 -324
  44. package/docs/rules/require-hyphen-before-param-description.md +0 -281
  45. package/docs/rules/require-jsdoc.md +0 -1857
  46. package/docs/rules/require-param-description.md +0 -238
  47. package/docs/rules/require-param-name.md +0 -163
  48. package/docs/rules/require-param-type.md +0 -227
  49. package/docs/rules/require-param.md +0 -1820
  50. package/docs/rules/require-property-description.md +0 -88
  51. package/docs/rules/require-property-name.md +0 -79
  52. package/docs/rules/require-property-type.md +0 -79
  53. package/docs/rules/require-property.md +0 -128
  54. package/docs/rules/require-returns-check.md +0 -1053
  55. package/docs/rules/require-returns-description.md +0 -181
  56. package/docs/rules/require-returns-type.md +0 -144
  57. package/docs/rules/require-returns.md +0 -1191
  58. package/docs/rules/require-throws.md +0 -326
  59. package/docs/rules/require-yields-check.md +0 -544
  60. package/docs/rules/require-yields.md +0 -823
  61. package/docs/rules/sort-tags.md +0 -635
  62. package/docs/rules/tag-lines.md +0 -551
  63. package/docs/rules/text-escaping.md +0 -177
  64. package/docs/rules/valid-types.md +0 -881
  65. package/docs/settings.md +0 -362
  66. package/tsconfig.json +0 -22
@@ -1,409 +0,0 @@
1
- <a name="user-content-check-values"></a>
2
- <a name="check-values"></a>
3
- # <code>check-values</code>
4
-
5
- * [Options](#user-content-check-values-options)
6
- * [`allowedAuthors`](#user-content-check-values-options-allowedauthors)
7
- * [`allowedLicenses`](#user-content-check-values-options-allowedlicenses)
8
- * [`licensePattern`](#user-content-check-values-options-licensepattern)
9
- * [`numericOnlyVariation`](#user-content-check-values-options-numericonlyvariation)
10
- * [Context and settings](#user-content-check-values-context-and-settings)
11
- * [Failing examples](#user-content-check-values-failing-examples)
12
- * [Passing examples](#user-content-check-values-passing-examples)
13
-
14
-
15
- This rule checks the values for a handful of tags:
16
-
17
- 1. `@version` - Checks that there is a present and valid
18
- [semver](https://semver.org/) version value.
19
- 2. `@since` - As with `@version`
20
- 3. `@license` - Checks that there is a present and valid SPDX identifier
21
- or is present within an `allowedLicenses` option.
22
- 4. `@author` - Checks that there is a value present, and if the option
23
- `allowedAuthors` is present, ensure that the author value is one
24
- of these array items.
25
- 5. `@variation` - If `numericOnlyVariation` is set, will checks that there
26
- is a value present, and that it is an integer (otherwise, jsdoc allows any
27
- value).
28
- 6. `@kind` - Insists that it be one of the allowed values: 'class',
29
- 'constant', 'event', 'external', 'file', 'function', 'member', 'mixin',
30
- 'module', 'namespace', 'typedef',
31
-
32
- <a name="user-content-check-values-options"></a>
33
- <a name="check-values-options"></a>
34
- ## Options
35
-
36
- <a name="user-content-check-values-options-allowedauthors"></a>
37
- <a name="check-values-options-allowedauthors"></a>
38
- ### <code>allowedAuthors</code>
39
-
40
- An array of allowable author values. If absent, only non-whitespace will
41
- be checked for.
42
-
43
- <a name="user-content-check-values-options-allowedlicenses"></a>
44
- <a name="check-values-options-allowedlicenses"></a>
45
- ### <code>allowedLicenses</code>
46
-
47
- An array of allowable license values or `true` to allow any license text.
48
- If present as an array, will be used in place of SPDX identifiers.
49
-
50
- <a name="user-content-check-values-options-licensepattern"></a>
51
- <a name="check-values-options-licensepattern"></a>
52
- ### <code>licensePattern</code>
53
-
54
- A string to be converted into a `RegExp` (with `u` flag) and whose first
55
- parenthetical grouping, if present, will match the portion of the license
56
- description to check (if no grouping is present, then the whole portion
57
- matched will be used). Defaults to `/([^\n\r]*)/gu`, i.e., the SPDX expression
58
- is expected before any line breaks.
59
-
60
- Note that the `/` delimiters are optional, but necessary to add flags.
61
-
62
- Defaults to using the `u` flag, so to add your own flags, encapsulate
63
- your expression as a string, but like a literal, e.g., `/^mit$/ui`.
64
-
65
- <a name="user-content-check-values-options-numericonlyvariation"></a>
66
- <a name="check-values-options-numericonlyvariation"></a>
67
- ### <code>numericOnlyVariation</code>
68
-
69
- Whether to enable validation that `@variation` must be a number. Defaults to
70
- `false`.
71
-
72
- <a name="user-content-check-values-context-and-settings"></a>
73
- <a name="check-values-context-and-settings"></a>
74
- ## Context and settings
75
-
76
- |||
77
- |---|---|
78
- |Context|everywhere|
79
- |Tags|`@version`, `@since`, `@kind`, `@license`, `@author`, `@variation`|
80
- |Recommended|true|
81
- |Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`, `numericOnlyVariation`|
82
- |Settings|`tagNamePreference`|
83
-
84
- <a name="user-content-check-values-failing-examples"></a>
85
- <a name="check-values-failing-examples"></a>
86
- ## Failing examples
87
-
88
- The following patterns are considered problems:
89
-
90
- ````js
91
- /**
92
- * @version
93
- */
94
- function quux (foo) {
95
-
96
- }
97
- // Message: Missing JSDoc @version value.
98
-
99
- /**
100
- * @version 3.1
101
- */
102
- function quux (foo) {
103
-
104
- }
105
- // Message: Invalid JSDoc @version: "3.1".
106
-
107
- /**
108
- * @kind
109
- */
110
- function quux (foo) {
111
-
112
- }
113
- // Message: Missing JSDoc @kind value.
114
-
115
- /**
116
- * @kind -3
117
- */
118
- function quux (foo) {
119
-
120
- }
121
- // Message: Invalid JSDoc @kind: "-3"; must be one of: class, constant, event, external, file, function, member, mixin, module, namespace, typedef.
122
-
123
- /**
124
- * @variation -3
125
- */
126
- function quux (foo) {
127
-
128
- }
129
- // "jsdoc/check-values": ["error"|"warn", {"numericOnlyVariation":true}]
130
- // Message: Invalid JSDoc @variation: "-3".
131
-
132
- /**
133
- * @since
134
- */
135
- function quux (foo) {
136
-
137
- }
138
- // Message: Missing JSDoc @since value.
139
-
140
- /**
141
- * @since 3.1
142
- */
143
- function quux (foo) {
144
-
145
- }
146
- // Message: Invalid JSDoc @since: "3.1".
147
-
148
- /**
149
- * @license
150
- */
151
- function quux (foo) {
152
-
153
- }
154
- // Message: Missing JSDoc @license value.
155
-
156
- /**
157
- * @license FOO
158
- */
159
- function quux (foo) {
160
-
161
- }
162
- // Message: Invalid JSDoc @license: "FOO"; expected SPDX expression: https://spdx.org/licenses/.
163
-
164
- /**
165
- * @license FOO
166
- */
167
- function quux (foo) {
168
-
169
- }
170
- // "jsdoc/check-values": ["error"|"warn", {"allowedLicenses":["BAR","BAX"]}]
171
- // Message: Invalid JSDoc @license: "FOO"; expected one of BAR, BAX.
172
-
173
- /**
174
- * @license MIT-7
175
- * Some extra text...
176
- */
177
- function quux (foo) {
178
-
179
- }
180
- // Message: Invalid JSDoc @license: "MIT-7"; expected SPDX expression: https://spdx.org/licenses/.
181
-
182
- /**
183
- * @license (MIT OR GPL-2.5)
184
- */
185
- function quux (foo) {
186
-
187
- }
188
- // Message: Invalid JSDoc @license: "(MIT OR GPL-2.5)"; expected SPDX expression: https://spdx.org/licenses/.
189
-
190
- /**
191
- * @license MIT
192
- * Some extra text
193
- */
194
- function quux (foo) {
195
-
196
- }
197
- // "jsdoc/check-values": ["error"|"warn", {"licensePattern":"[\\s\\S]*"}]
198
- // Message: Invalid JSDoc @license: "MIT
199
- Some extra text"; expected SPDX expression: https://spdx.org/licenses/.
200
-
201
- /**
202
- * @author
203
- */
204
- function quux (foo) {
205
-
206
- }
207
- // Message: Missing JSDoc @author value.
208
-
209
- /**
210
- * @author Brett Zamir
211
- */
212
- function quux (foo) {
213
-
214
- }
215
- // "jsdoc/check-values": ["error"|"warn", {"allowedAuthors":["Gajus Kuizinas","golopot"]}]
216
- // Message: Invalid JSDoc @author: "Brett Zamir"; expected one of Gajus Kuizinas, golopot.
217
-
218
- /**
219
- * @variation
220
- */
221
- function quux (foo) {
222
-
223
- }
224
- // "jsdoc/check-values": ["error"|"warn", {"numericOnlyVariation":true}]
225
- // Message: Missing JSDoc @variation value.
226
-
227
- /**
228
- * @variation 5.2
229
- */
230
- function quux (foo) {
231
-
232
- }
233
- // "jsdoc/check-values": ["error"|"warn", {"numericOnlyVariation":true}]
234
- // Message: Invalid JSDoc @variation: "5.2".
235
-
236
- /**
237
- * @license license-prefix Oops
238
- */
239
- function quux (foo) {
240
-
241
- }
242
- // "jsdoc/check-values": ["error"|"warn", {"licensePattern":"(?<=license-prefix ).*"}]
243
- // Message: Invalid JSDoc @license: "Oops"; expected SPDX expression: https://spdx.org/licenses/.
244
-
245
- /**
246
- * @license Oops
247
- * Copyright 2022
248
- */
249
- function quux (foo) {
250
-
251
- }
252
- // "jsdoc/check-values": ["error"|"warn", {"licensePattern":"^([^\n]+)\nCopyright"}]
253
- // Message: Invalid JSDoc @license: "Oops"; expected SPDX expression: https://spdx.org/licenses/.
254
- ````
255
-
256
-
257
-
258
- <a name="user-content-check-values-passing-examples"></a>
259
- <a name="check-values-passing-examples"></a>
260
- ## Passing examples
261
-
262
- The following patterns are not considered problems:
263
-
264
- ````js
265
- /**
266
- * @version 3.4.1
267
- */
268
- function quux (foo) {
269
-
270
- }
271
-
272
- /**
273
- * @version 3.4.1
274
- */
275
- function quux (foo) {
276
-
277
- }
278
-
279
- /**
280
- * @since 3.4.1
281
- */
282
- function quux (foo) {
283
-
284
- }
285
-
286
- /**
287
- * @since 3.4.1
288
- */
289
- function quux (foo) {
290
-
291
- }
292
-
293
- /**
294
- * @license MIT
295
- */
296
- function quux (foo) {
297
-
298
- }
299
-
300
- /**
301
- * @license MIT
302
- * Some extra text...
303
- */
304
- function quux (foo) {
305
-
306
- }
307
-
308
- /**
309
- * @license (MIT OR GPL-2.0)
310
- */
311
- function quux (foo) {
312
-
313
- }
314
-
315
- /**
316
- * @license FOO
317
- */
318
- function quux (foo) {
319
-
320
- }
321
- // "jsdoc/check-values": ["error"|"warn", {"allowedLicenses":["FOO","BAR","BAX"]}]
322
-
323
- /**
324
- * @license FOO
325
- */
326
- function quux (foo) {
327
-
328
- }
329
- // "jsdoc/check-values": ["error"|"warn", {"allowedLicenses":true}]
330
-
331
- /**
332
- * @license MIT
333
- * Some extra text
334
- */
335
- function quux (foo) {
336
-
337
- }
338
- // "jsdoc/check-values": ["error"|"warn", {"licensePattern":"[^\n]*"}]
339
-
340
- /**
341
- * @author Gajus Kuizinas
342
- */
343
- function quux (foo) {
344
-
345
- }
346
-
347
- /**
348
- * @author Brett Zamir
349
- */
350
- function quux (foo) {
351
-
352
- }
353
- // "jsdoc/check-values": ["error"|"warn", {"allowedAuthors":["Gajus Kuizinas","golopot","Brett Zamir"]}]
354
-
355
- /**
356
- * @variation 3
357
- */
358
- function quux (foo) {
359
-
360
- }
361
- // "jsdoc/check-values": ["error"|"warn", {"numericOnlyVariation":true}]
362
-
363
- /**
364
- * @variation abc
365
- */
366
- function quux (foo) {
367
-
368
- }
369
-
370
- /**
371
- * @module test
372
- * @license MIT\r
373
- */
374
- 'use strict';
375
-
376
- /**
377
- * @kind function
378
- */
379
- function quux (foo) {
380
-
381
- }
382
-
383
- /**
384
- * @license license-prefix MIT
385
- */
386
- function quux (foo) {
387
-
388
- }
389
- // "jsdoc/check-values": ["error"|"warn", {"licensePattern":"(?<=license-prefix )MIT|GPL3.0"}]
390
-
391
- /**
392
- * @license
393
- * Copyright 2022
394
- */
395
- function quux (foo) {
396
-
397
- }
398
- // "jsdoc/check-values": ["error"|"warn", {"licensePattern":"^([^\n]+)(?!\nCopyright)"}]
399
-
400
- /**
401
- * @license MIT
402
- * Copyright 2022
403
- */
404
- function quux (foo) {
405
-
406
- }
407
- // "jsdoc/check-values": ["error"|"warn", {"licensePattern":"^([^\n]+)\nCopyright"}]
408
- ````
409
-
@@ -1,220 +0,0 @@
1
- <a name="user-content-empty-tags"></a>
2
- <a name="empty-tags"></a>
3
- ### <code>empty-tags</code>
4
-
5
-
6
-
7
- Expects the following tags to be empty of any content:
8
-
9
- - `@abstract`
10
- - `@async`
11
- - `@generator`
12
- - `@global`
13
- - `@hideconstructor`
14
- - `@ignore`
15
- - `@inheritdoc`
16
- - `@inner`
17
- - `@instance`
18
- - `@internal` (used by TypeScript)
19
- - `@override`
20
- - `@readonly`
21
-
22
- The following will also be expected to be empty unless `settings.jsdoc.mode`
23
- is set to "closure" (which allows types).
24
-
25
- - `@package`
26
- - `@private`
27
- - `@protected`
28
- - `@public`
29
- - `@static`
30
-
31
- Note that `@private` will still be checked for content by this rule even with
32
- `settings.jsdoc.ignorePrivate` set to `true` (a setting which normally
33
- causes rules not to take effect).
34
-
35
- Similarly, `@internal` will still be checked for content by this rule even with
36
- `settings.jsdoc.ignoreInternal` set to `true`.
37
-
38
- <a name="user-content-fixer"></a>
39
- <a name="fixer"></a>
40
- ## Fixer
41
-
42
- (Todo)
43
-
44
- <a name="user-content-options"></a>
45
- <a name="options"></a>
46
- ## Options
47
-
48
- <a name="user-content-options-tags"></a>
49
- <a name="options-tags"></a>
50
- ### <code>tags</code>
51
-
52
- If you want additional tags to be checked for their descriptions, you may
53
- add them within this option.
54
-
55
- ```js
56
- {
57
- 'jsdoc/empty-tags': ['error', {tags: ['event']}]
58
- }
59
- ```
60
-
61
- <a name="user-content-context-and-settings"></a>
62
- <a name="context-and-settings"></a>
63
- ## Context and settings
64
-
65
- |||
66
- |---|---|
67
- |Context|everywhere|
68
- |Tags| `abstract`, `async`, `generator`, `global`, `hideconstructor`, `ignore`, `inheritdoc`, `inner`, `instance`, `internal`, `override`, `readonly`, `package`, `private`, `protected`, `public`, `static` and others added by `tags`|
69
- |Recommended|true|
70
- |Options|`tags`|
71
-
72
- <a name="user-content-failing-examples"></a>
73
- <a name="failing-examples"></a>
74
- ## Failing examples
75
-
76
- The following patterns are considered problems:
77
-
78
- ````js
79
- /**
80
- * @abstract extra text
81
- */
82
- function quux () {
83
-
84
- }
85
- // Message: @abstract should be empty.
86
-
87
- /**
88
- * @interface extra text
89
- */
90
- // Settings: {"jsdoc":{"mode":"closure"}}
91
- // Message: @interface should be empty.
92
-
93
- class Test {
94
- /**
95
- * @abstract extra text
96
- */
97
- quux () {
98
-
99
- }
100
- }
101
- // Message: @abstract should be empty.
102
-
103
- /**
104
- * @abstract extra text
105
- * @inheritdoc
106
- * @async out of place
107
- */
108
- function quux () {
109
-
110
- }
111
- // Message: @abstract should be empty.
112
-
113
- /**
114
- * @event anEvent
115
- */
116
- function quux () {
117
-
118
- }
119
- // "jsdoc/empty-tags": ["error"|"warn", {"tags":["event"]}]
120
- // Message: @event should be empty.
121
-
122
- /**
123
- * @private {someType}
124
- */
125
- function quux () {
126
-
127
- }
128
- // Message: @private should be empty.
129
-
130
- /**
131
- * @internal {someType}
132
- */
133
- function quux () {
134
-
135
- }
136
- // Message: @internal should be empty.
137
-
138
- /**
139
- * @private {someType}
140
- */
141
- function quux () {
142
-
143
- }
144
- // Settings: {"jsdoc":{"ignorePrivate":true}}
145
- // Message: @private should be empty.
146
- ````
147
-
148
-
149
-
150
- <a name="user-content-passing-examples"></a>
151
- <a name="passing-examples"></a>
152
- ## Passing examples
153
-
154
- The following patterns are not considered problems:
155
-
156
- ````js
157
- /**
158
- * @abstract
159
- */
160
- function quux () {
161
-
162
- }
163
-
164
- /**
165
- *
166
- */
167
- function quux () {
168
-
169
- }
170
-
171
- /**
172
- * @param aName
173
- */
174
- function quux () {
175
-
176
- }
177
-
178
- /**
179
- * @abstract
180
- * @inheritdoc
181
- * @async
182
- */
183
- function quux () {
184
-
185
- }
186
-
187
- /**
188
- * @private {someType}
189
- */
190
- function quux () {
191
-
192
- }
193
- // Settings: {"jsdoc":{"mode":"closure"}}
194
-
195
- /**
196
- * @private
197
- */
198
- function quux () {
199
-
200
- }
201
-
202
- /**
203
- * @internal
204
- */
205
- function quux () {
206
-
207
- }
208
-
209
- /**
210
- * Create an array.
211
- *
212
- * @private
213
- *
214
- * @param {string[]} [elem] - Elements to make an array of.
215
- * @param {boolean} [clone] - Optionally clone nodes.
216
- * @returns {string[]} The array of nodes.
217
- */
218
- function quux () {}
219
- ````
220
-