eslint-plugin-jsdoc 58.1.1 → 59.0.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.
- package/README.md +66 -62
- package/dist/buildForbidRuleDefinition.cjs +0 -1
- package/dist/buildForbidRuleDefinition.cjs.map +1 -1
- package/dist/buildRejectOrPreferRuleDefinition.cjs +7 -2
- package/dist/buildRejectOrPreferRuleDefinition.cjs.map +1 -1
- package/dist/cjs/rules/convertToJsdocComments.d.ts +7 -0
- package/dist/generateDocs.cjs +129 -3
- package/dist/generateDocs.cjs.map +1 -1
- package/dist/generateRule.cjs +3 -1
- package/dist/generateRule.cjs.map +1 -1
- package/dist/generateRuleTypes.cjs +5 -5
- package/dist/generateRuleTypes.cjs.map +1 -1
- package/dist/index-cjs.cjs +30 -0
- package/dist/index-cjs.cjs.map +1 -1
- package/dist/index.cjs +30 -0
- package/dist/index.cjs.map +1 -1
- package/dist/rules/checkAccess.cjs +1 -1
- package/dist/rules/checkAccess.cjs.map +1 -1
- package/dist/rules/checkAlignment.cjs +4 -1
- package/dist/rules/checkAlignment.cjs.map +1 -1
- package/dist/rules/checkExamples.cjs +1 -1
- package/dist/rules/checkExamples.cjs.map +1 -1
- package/dist/rules/checkIndentation.cjs +19 -0
- package/dist/rules/checkIndentation.cjs.map +1 -1
- package/dist/rules/checkLineAlignment.cjs +25 -1
- package/dist/rules/checkLineAlignment.cjs.map +1 -1
- package/dist/rules/checkParamNames.cjs +62 -1
- package/dist/rules/checkParamNames.cjs.map +1 -1
- package/dist/rules/checkPropertyNames.cjs +6 -0
- package/dist/rules/checkPropertyNames.cjs.map +1 -1
- package/dist/rules/checkTagNames.cjs +71 -0
- package/dist/rules/checkTagNames.cjs.map +1 -1
- package/dist/rules/checkTypes.cjs +16 -1
- package/dist/rules/checkTypes.cjs.map +1 -1
- package/dist/rules/checkValues.cjs +17 -1
- package/dist/rules/checkValues.cjs.map +1 -1
- package/dist/rules/convertToJsdocComments.cjs +48 -0
- package/dist/rules/convertToJsdocComments.cjs.map +1 -1
- package/dist/rules/convertToJsdocComments.d.ts +7 -0
- package/dist/rules/emptyTags.cjs +10 -1
- package/dist/rules/emptyTags.cjs.map +1 -1
- package/dist/rules/implementsOnClasses.cjs +15 -1
- package/dist/rules/implementsOnClasses.cjs.map +1 -1
- package/dist/rules/informativeDocs.cjs +45 -0
- package/dist/rules/informativeDocs.cjs.map +1 -1
- package/dist/rules/linesBeforeBlock.cjs +14 -0
- package/dist/rules/linesBeforeBlock.cjs.map +1 -1
- package/dist/rules/matchDescription.cjs +129 -0
- package/dist/rules/matchDescription.cjs.map +1 -1
- package/dist/rules/matchName.cjs +30 -0
- package/dist/rules/matchName.cjs.map +1 -1
- package/dist/rules/multilineBlocks.cjs +78 -6
- package/dist/rules/multilineBlocks.cjs.map +1 -1
- package/dist/rules/noBadBlocks.cjs +11 -2
- package/dist/rules/noBadBlocks.cjs.map +1 -1
- package/dist/rules/noBlankBlockDescriptions.cjs +1 -1
- package/dist/rules/noBlankBlockDescriptions.cjs.map +1 -1
- package/dist/rules/noBlankBlocks.cjs +3 -1
- package/dist/rules/noBlankBlocks.cjs.map +1 -1
- package/dist/rules/noDefaults.cjs +19 -0
- package/dist/rules/noDefaults.cjs.map +1 -1
- package/dist/rules/noMissingSyntax.cjs +22 -2
- package/dist/rules/noMissingSyntax.cjs.map +1 -1
- package/dist/rules/noMultiAsterisks.cjs +29 -0
- package/dist/rules/noMultiAsterisks.cjs.map +1 -1
- package/dist/rules/noRestrictedSyntax.cjs +17 -1
- package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
- package/dist/rules/noTypes.cjs +17 -1
- package/dist/rules/noTypes.cjs.map +1 -1
- package/dist/rules/noUndefinedTypes.cjs +11 -1
- package/dist/rules/noUndefinedTypes.cjs.map +1 -1
- package/dist/rules/requireAsteriskPrefix.cjs +28 -0
- package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
- package/dist/rules/requireDescription.cjs +30 -1
- package/dist/rules/requireDescription.cjs.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.cjs +27 -0
- package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
- package/dist/rules/requireExample.cjs +26 -1
- package/dist/rules/requireExample.cjs.map +1 -1
- package/dist/rules/requireFileOverview.cjs +61 -0
- package/dist/rules/requireFileOverview.cjs.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.cjs +20 -2
- package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
- package/dist/rules/requireJsdoc.cjs +82 -3
- package/dist/rules/requireJsdoc.cjs.map +1 -1
- package/dist/rules/requireParam.cjs +213 -1
- package/dist/rules/requireParam.cjs.map +1 -1
- package/dist/rules/requireParamDescription.cjs +21 -0
- package/dist/rules/requireParamDescription.cjs.map +1 -1
- package/dist/rules/requireParamName.cjs +16 -1
- package/dist/rules/requireParamName.cjs.map +1 -1
- package/dist/rules/requireParamType.cjs +21 -1
- package/dist/rules/requireParamType.cjs.map +1 -1
- package/dist/rules/requirePropertyName.cjs +1 -1
- package/dist/rules/requirePropertyName.cjs.map +1 -1
- package/dist/rules/requirePropertyType.cjs +1 -1
- package/dist/rules/requirePropertyType.cjs.map +1 -1
- package/dist/rules/requireReturns.cjs +54 -1
- package/dist/rules/requireReturns.cjs.map +1 -1
- package/dist/rules/requireReturnsCheck.cjs +22 -1
- package/dist/rules/requireReturnsCheck.cjs.map +1 -1
- package/dist/rules/requireReturnsDescription.cjs +15 -1
- package/dist/rules/requireReturnsDescription.cjs.map +1 -1
- package/dist/rules/requireReturnsType.cjs +15 -1
- package/dist/rules/requireReturnsType.cjs.map +1 -1
- package/dist/rules/requireTemplate.cjs +17 -1
- package/dist/rules/requireTemplate.cjs.map +1 -1
- package/dist/rules/requireThrows.cjs +18 -1
- package/dist/rules/requireThrows.cjs.map +1 -1
- package/dist/rules/requireYields.cjs +50 -1
- package/dist/rules/requireYields.cjs.map +1 -1
- package/dist/rules/requireYieldsCheck.cjs +25 -7
- package/dist/rules/requireYieldsCheck.cjs.map +1 -1
- package/dist/rules/sortTags.cjs +200 -1
- package/dist/rules/sortTags.cjs.map +1 -1
- package/dist/rules/tagLines.cjs +32 -2
- package/dist/rules/tagLines.cjs.map +1 -1
- package/dist/rules/textEscaping.cjs +5 -1
- package/dist/rules/textEscaping.cjs.map +1 -1
- package/dist/rules/typeFormatting.cjs +47 -10
- package/dist/rules/typeFormatting.cjs.map +1 -1
- package/dist/rules/validTypes.cjs +8 -1
- package/dist/rules/validTypes.cjs.map +1 -1
- package/dist/rules.d.ts +2130 -32
- package/package.json +1 -1
- package/src/buildForbidRuleDefinition.js +0 -1
- package/src/buildRejectOrPreferRuleDefinition.js +12 -2
- package/src/index-cjs.js +36 -0
- package/src/index.js +36 -0
- package/src/rules/checkAccess.js +1 -1
- package/src/rules/checkAlignment.js +3 -0
- package/src/rules/checkExamples.js +1 -1
- package/src/rules/checkIndentation.js +19 -0
- package/src/rules/checkLineAlignment.js +24 -0
- package/src/rules/checkParamNames.js +62 -1
- package/src/rules/checkPropertyNames.js +6 -0
- package/src/rules/checkTagNames.js +71 -0
- package/src/rules/checkTypes.js +16 -1
- package/src/rules/checkValues.js +16 -0
- package/src/rules/convertToJsdocComments.js +48 -0
- package/src/rules/emptyTags.js +10 -1
- package/src/rules/implementsOnClasses.js +15 -1
- package/src/rules/informativeDocs.js +45 -0
- package/src/rules/linesBeforeBlock.js +14 -0
- package/src/rules/matchDescription.js +129 -0
- package/src/rules/matchName.js +30 -0
- package/src/rules/multilineBlocks.js +77 -5
- package/src/rules/noBadBlocks.js +11 -2
- package/src/rules/noBlankBlockDescriptions.js +1 -1
- package/src/rules/noBlankBlocks.js +2 -0
- package/src/rules/noDefaults.js +19 -0
- package/src/rules/noMissingSyntax.js +22 -2
- package/src/rules/noMultiAsterisks.js +29 -0
- package/src/rules/noRestrictedSyntax.js +17 -1
- package/src/rules/noTypes.js +17 -1
- package/src/rules/noUndefinedTypes.js +11 -1
- package/src/rules/requireAsteriskPrefix.js +28 -0
- package/src/rules/requireDescription.js +30 -1
- package/src/rules/requireDescriptionCompleteSentence.js +27 -0
- package/src/rules/requireExample.js +26 -1
- package/src/rules/requireFileOverview.js +61 -0
- package/src/rules/requireHyphenBeforeParamDescription.js +19 -1
- package/src/rules/requireJsdoc.js +80 -1
- package/src/rules/requireParam.js +213 -1
- package/src/rules/requireParamDescription.js +21 -0
- package/src/rules/requireParamName.js +16 -1
- package/src/rules/requireParamType.js +21 -1
- package/src/rules/requirePropertyName.js +1 -1
- package/src/rules/requirePropertyType.js +1 -1
- package/src/rules/requireReturns.js +54 -1
- package/src/rules/requireReturnsCheck.js +22 -1
- package/src/rules/requireReturnsDescription.js +15 -1
- package/src/rules/requireReturnsType.js +15 -1
- package/src/rules/requireTemplate.js +17 -1
- package/src/rules/requireThrows.js +18 -1
- package/src/rules/requireYields.js +50 -1
- package/src/rules/requireYieldsCheck.js +25 -7
- package/src/rules/sortTags.js +200 -1
- package/src/rules/tagLines.js +30 -0
- package/src/rules/textEscaping.js +5 -1
- package/src/rules/typeFormatting.js +44 -7
- package/src/rules/validTypes.js +8 -1
- package/src/rules.d.ts +2130 -32
- package/typings/gitdown.d.ts +4 -0
package/src/rules/tagLines.js
CHANGED
|
@@ -296,6 +296,11 @@ export default iterateJsdoc(({
|
|
|
296
296
|
fixable: 'code',
|
|
297
297
|
schema: [
|
|
298
298
|
{
|
|
299
|
+
description: `Defaults to "never". "any" is only useful with \`tags\` (allowing non-enforcement of lines except
|
|
300
|
+
for particular tags) or with \`startLines\` or \`endLines\`. It is also
|
|
301
|
+
necessary if using the linebreak-setting options of the \`sort-tags\` rule
|
|
302
|
+
so that the two rules won't conflict in both attempting to set lines
|
|
303
|
+
between tags.`,
|
|
299
304
|
enum: [
|
|
300
305
|
'always', 'any', 'never',
|
|
301
306
|
],
|
|
@@ -305,9 +310,16 @@ export default iterateJsdoc(({
|
|
|
305
310
|
additionalProperties: false,
|
|
306
311
|
properties: {
|
|
307
312
|
applyToEndTag: {
|
|
313
|
+
description: `Set to \`false\` and use with "always" to indicate the normal lines to be
|
|
314
|
+
added after tags should not be added after the final tag.
|
|
315
|
+
|
|
316
|
+
Defaults to \`true\`.`,
|
|
308
317
|
type: 'boolean',
|
|
309
318
|
},
|
|
310
319
|
count: {
|
|
320
|
+
description: `Use with "always" to indicate the number of lines to require be present.
|
|
321
|
+
|
|
322
|
+
Defaults to 1.`,
|
|
311
323
|
type: 'integer',
|
|
312
324
|
},
|
|
313
325
|
endLines: {
|
|
@@ -319,6 +331,10 @@ export default iterateJsdoc(({
|
|
|
319
331
|
type: 'null',
|
|
320
332
|
},
|
|
321
333
|
],
|
|
334
|
+
description: `If not set to \`null\`, will enforce end lines to the given count on the
|
|
335
|
+
final tag only.
|
|
336
|
+
|
|
337
|
+
Defaults to \`0\`.`,
|
|
322
338
|
},
|
|
323
339
|
startLines: {
|
|
324
340
|
anyOf: [
|
|
@@ -329,8 +345,22 @@ export default iterateJsdoc(({
|
|
|
329
345
|
type: 'null',
|
|
330
346
|
},
|
|
331
347
|
],
|
|
348
|
+
description: `If not set to \`null\`, will enforce end lines to the given count before the
|
|
349
|
+
first tag only, unless there is only whitespace content, in which case,
|
|
350
|
+
a line count will not be enforced.
|
|
351
|
+
|
|
352
|
+
Defaults to \`0\`.`,
|
|
332
353
|
},
|
|
333
354
|
tags: {
|
|
355
|
+
description: `Overrides the default behavior depending on specific tags.
|
|
356
|
+
|
|
357
|
+
An object whose keys are tag names and whose values are objects with the
|
|
358
|
+
following keys:
|
|
359
|
+
|
|
360
|
+
1. \`lines\` - Set to \`always\`, \`never\`, or \`any\` to override.
|
|
361
|
+
2. \`count\` - Overrides main \`count\` (for "always")
|
|
362
|
+
|
|
363
|
+
Defaults to empty object.`,
|
|
334
364
|
patternProperties: {
|
|
335
365
|
'.*': {
|
|
336
366
|
additionalProperties: false,
|
|
@@ -138,11 +138,15 @@ export default iterateJsdoc(({
|
|
|
138
138
|
{
|
|
139
139
|
additionalProperties: false,
|
|
140
140
|
properties: {
|
|
141
|
-
// Option properties here (or remove the object)
|
|
142
141
|
escapeHTML: {
|
|
142
|
+
description: `This option escapes all \`<\` and \`&\` characters (except those followed by
|
|
143
|
+
whitespace which are treated as literals by Visual Studio Code). Defaults to
|
|
144
|
+
\`false\`.`,
|
|
143
145
|
type: 'boolean',
|
|
144
146
|
},
|
|
145
147
|
escapeMarkdown: {
|
|
148
|
+
description: `This option escapes the first backtick (\`\` \` \`\`) in a paired sequence.
|
|
149
|
+
Defaults to \`false\`.`,
|
|
146
150
|
type: 'boolean',
|
|
147
151
|
},
|
|
148
152
|
},
|
|
@@ -370,21 +370,31 @@ export default iterateJsdoc(({
|
|
|
370
370
|
additionalProperties: false,
|
|
371
371
|
properties: {
|
|
372
372
|
arrayBrackets: {
|
|
373
|
+
description: 'Determines how array generics are represented. Set to `angle` for the style `Array<type>` or `square` for the style `type[]`. Defaults to "square".',
|
|
373
374
|
enum: [
|
|
374
375
|
'angle',
|
|
375
376
|
'square',
|
|
376
377
|
],
|
|
378
|
+
type: 'string',
|
|
377
379
|
},
|
|
378
380
|
enableFixer: {
|
|
381
|
+
description: 'Whether to enable the fixer. Defaults to `true`.',
|
|
379
382
|
type: 'boolean',
|
|
380
383
|
},
|
|
381
384
|
genericDot: {
|
|
385
|
+
description: 'Boolean value of whether to use a dot before the angled brackets of a generic (e.g., `SomeType.<AnotherType>`). Defaults to `false`.',
|
|
382
386
|
type: 'boolean',
|
|
383
387
|
},
|
|
384
388
|
objectFieldIndent: {
|
|
389
|
+
description: `A string indicating the whitespace to be added on each line preceding an
|
|
390
|
+
object property-value field. Defaults to the empty string.`,
|
|
385
391
|
type: 'string',
|
|
386
392
|
},
|
|
387
393
|
objectFieldQuote: {
|
|
394
|
+
description: `Whether and how object field properties should be quoted (e.g., \`{"a": string}\`).
|
|
395
|
+
Set to \`single\`, \`double\`, or \`null\`. Defaults to \`null\` (no quotes unless
|
|
396
|
+
required due to special characters within the field). Digits will be kept as is,
|
|
397
|
+
regardless of setting (they can either represent a digit or a string digit).`,
|
|
388
398
|
enum: [
|
|
389
399
|
'double',
|
|
390
400
|
'single',
|
|
@@ -392,6 +402,11 @@ export default iterateJsdoc(({
|
|
|
392
402
|
],
|
|
393
403
|
},
|
|
394
404
|
objectFieldSeparator: {
|
|
405
|
+
description: `For object properties, specify whether a "semicolon", "comma", "linebreak",
|
|
406
|
+
"semicolon-and-linebreak", or "comma-and-linebreak" should be used after
|
|
407
|
+
each object property-value pair.
|
|
408
|
+
|
|
409
|
+
Defaults to \`"comma"\`.`,
|
|
395
410
|
enum: [
|
|
396
411
|
'comma',
|
|
397
412
|
'comma-and-linebreak',
|
|
@@ -399,33 +414,55 @@ export default iterateJsdoc(({
|
|
|
399
414
|
'semicolon',
|
|
400
415
|
'semicolon-and-linebreak',
|
|
401
416
|
],
|
|
417
|
+
type: 'string',
|
|
402
418
|
},
|
|
403
419
|
objectFieldSeparatorOptionalLinebreak: {
|
|
420
|
+
description: `Whether \`objectFieldSeparator\` set to \`"semicolon-and-linebreak"\` or
|
|
421
|
+
\`"comma-and-linebreak"\` should be allowed to optionally drop the linebreak.
|
|
422
|
+
|
|
423
|
+
Defaults to \`true\`.`,
|
|
404
424
|
type: 'boolean',
|
|
405
425
|
},
|
|
406
426
|
objectFieldSeparatorTrailingPunctuation: {
|
|
427
|
+
description: `If \`separatorForSingleObjectField\` is not in effect (i.e., if it is \`false\`
|
|
428
|
+
or there are multiple property-value object fields present), this property
|
|
429
|
+
will determine whether to add punctuation corresponding to the
|
|
430
|
+
\`objectFieldSeparator\` (e.g., a semicolon) to the final object field.
|
|
431
|
+
Defaults to \`false\`.`,
|
|
407
432
|
type: 'boolean',
|
|
408
433
|
},
|
|
409
|
-
//
|
|
410
|
-
//
|
|
411
|
-
//
|
|
412
|
-
//
|
|
413
|
-
//
|
|
414
|
-
//
|
|
415
|
-
//
|
|
434
|
+
// propertyQuotes: {
|
|
435
|
+
// description: `Whether and how namepath properties should be quoted (e.g., \`ab."cd"."ef"\`).
|
|
436
|
+
// Set to \`single\`, \`double\`, or \`null\`. Defaults to \`null\` (no quotes unless
|
|
437
|
+
// required due to whitespace within the property).`,
|
|
438
|
+
// enum: [
|
|
439
|
+
// 'double',
|
|
440
|
+
// 'single',
|
|
441
|
+
// null,
|
|
442
|
+
// ],
|
|
443
|
+
// },
|
|
416
444
|
separatorForSingleObjectField: {
|
|
445
|
+
description: `Whether to apply the \`objectFieldSeparator\` (e.g., a semicolon) when there
|
|
446
|
+
is only one property-value object field present. Defaults to \`false\`.`,
|
|
417
447
|
type: 'boolean',
|
|
418
448
|
},
|
|
419
449
|
stringQuotes: {
|
|
450
|
+
description: `How string literals should be quoted (e.g., \`"abc"\`). Set to \`single\`
|
|
451
|
+
or \`double\`. Defaults to 'single'.`,
|
|
420
452
|
enum: [
|
|
421
453
|
'double',
|
|
422
454
|
'single',
|
|
423
455
|
],
|
|
456
|
+
type: 'string',
|
|
424
457
|
},
|
|
425
458
|
typeBracketSpacing: {
|
|
459
|
+
description: `A string of spaces that will be added immediately after the type's initial
|
|
460
|
+
curly bracket and immediately before its ending curly bracket. Defaults
|
|
461
|
+
to the empty string.`,
|
|
426
462
|
type: 'string',
|
|
427
463
|
},
|
|
428
464
|
unionSpacing: {
|
|
465
|
+
description: 'Determines the spacing to add to unions (`|`). Defaults to a single space (`" "`).',
|
|
429
466
|
type: 'string',
|
|
430
467
|
},
|
|
431
468
|
},
|
package/src/rules/validTypes.js
CHANGED
|
@@ -392,7 +392,7 @@ export default iterateJsdoc(({
|
|
|
392
392
|
iterateAllJsdocs: true,
|
|
393
393
|
meta: {
|
|
394
394
|
docs: {
|
|
395
|
-
description: 'Requires all types to be valid JSDoc
|
|
395
|
+
description: 'Requires all types/namepaths to be valid JSDoc, Closure compiler, or TypeScript types (configurable in settings).',
|
|
396
396
|
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/valid-types.md#repos-sticky-header',
|
|
397
397
|
},
|
|
398
398
|
schema: [
|
|
@@ -401,6 +401,13 @@ export default iterateJsdoc(({
|
|
|
401
401
|
properties: {
|
|
402
402
|
allowEmptyNamepaths: {
|
|
403
403
|
default: false,
|
|
404
|
+
description: `Set to \`false\` to bulk disallow
|
|
405
|
+
empty name paths with namepath groups 2 and 4 (these might often be
|
|
406
|
+
expected to have an accompanying name path, though they have some
|
|
407
|
+
indicative value without one; these may also allow names to be defined
|
|
408
|
+
in another manner elsewhere in the block); you can use
|
|
409
|
+
\`settings.jsdoc.structuredTags\` with the \`required\` key set to "name" if you
|
|
410
|
+
wish to require name paths on a tag-by-tag basis. Defaults to \`true\`.`,
|
|
404
411
|
type: 'boolean',
|
|
405
412
|
},
|
|
406
413
|
},
|