eslint-plugin-jsdoc 60.4.1 → 60.6.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 +4 -0
- package/dist/cjs/iterateJsdoc.d.ts +5 -0
- package/dist/cjs/jsdocUtils.d.ts +19 -2
- package/dist/cjs/rules/escapeInlineTags.d.ts +2 -0
- package/dist/generateDocs.cjs +5 -6
- package/dist/generateDocs.cjs.map +1 -1
- package/dist/index-cjs.cjs +14 -1
- package/dist/index-cjs.cjs.map +1 -1
- package/dist/index-esm.cjs +0 -2
- package/dist/index-esm.cjs.map +1 -1
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/iterateJsdoc.cjs +12 -0
- package/dist/iterateJsdoc.cjs.map +1 -1
- package/dist/iterateJsdoc.d.ts +5 -0
- package/dist/jsdocUtils.cjs +21 -17
- package/dist/jsdocUtils.cjs.map +1 -1
- package/dist/jsdocUtils.d.ts +19 -2
- package/dist/rules/checkLineAlignment.cjs +1 -2
- package/dist/rules/checkLineAlignment.cjs.map +1 -1
- package/dist/rules/checkTagNames.cjs +16 -0
- package/dist/rules/checkTagNames.cjs.map +1 -1
- package/dist/rules/convertToJsdocComments.cjs +2 -4
- package/dist/rules/convertToJsdocComments.cjs.map +1 -1
- package/dist/rules/emptyTags.cjs +1 -2
- package/dist/rules/emptyTags.cjs.map +1 -1
- package/dist/rules/escapeInlineTags.cjs +149 -0
- package/dist/rules/escapeInlineTags.cjs.map +1 -0
- package/dist/rules/escapeInlineTags.d.ts +3 -0
- package/dist/rules/informativeDocs.cjs +3 -6
- package/dist/rules/informativeDocs.cjs.map +1 -1
- package/dist/rules/linesBeforeBlock.cjs +4 -8
- package/dist/rules/linesBeforeBlock.cjs.map +1 -1
- package/dist/rules/matchDescription.cjs +2 -4
- package/dist/rules/matchDescription.cjs.map +1 -1
- package/dist/rules/matchName.cjs +1 -2
- package/dist/rules/matchName.cjs.map +1 -1
- package/dist/rules/multilineBlocks.cjs +3 -6
- package/dist/rules/multilineBlocks.cjs.map +1 -1
- package/dist/rules/noBadBlocks.cjs +1 -2
- package/dist/rules/noBadBlocks.cjs.map +1 -1
- package/dist/rules/noTypes.cjs +1 -2
- package/dist/rules/noTypes.cjs.map +1 -1
- package/dist/rules/noUndefinedTypes.cjs +1 -1
- package/dist/rules/noUndefinedTypes.cjs.map +1 -1
- package/dist/rules/requireAsteriskPrefix.cjs +1 -2
- package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.cjs +1 -2
- package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
- package/dist/rules/requireFileOverview.cjs +1 -3
- package/dist/rules/requireFileOverview.cjs.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.cjs +1 -2
- package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
- package/dist/rules/requireJsdoc.cjs +3 -6
- package/dist/rules/requireJsdoc.cjs.map +1 -1
- package/dist/rules/requireParam.cjs +6 -12
- package/dist/rules/requireParam.cjs.map +1 -1
- package/dist/rules/requireParamName.cjs +1 -2
- package/dist/rules/requireParamName.cjs.map +1 -1
- package/dist/rules/requireReturns.cjs +1 -2
- package/dist/rules/requireReturns.cjs.map +1 -1
- package/dist/rules/requireTemplate.cjs +1 -2
- package/dist/rules/requireTemplate.cjs.map +1 -1
- package/dist/rules/sortTags.cjs +1 -2
- package/dist/rules/sortTags.cjs.map +1 -1
- package/dist/rules.d.ts +34 -37
- package/package.json +11 -11
- package/src/index-cjs.js +16 -0
- package/src/index-esm.js +0 -2
- package/src/index.js +16 -2
- package/src/iterateJsdoc.js +13 -0
- package/src/jsdocUtils.js +22 -17
- package/src/rules/checkLineAlignment.js +1 -2
- package/src/rules/checkTagNames.js +19 -0
- package/src/rules/convertToJsdocComments.js +2 -4
- package/src/rules/emptyTags.js +1 -2
- package/src/rules/escapeInlineTags.js +189 -0
- package/src/rules/informativeDocs.js +3 -6
- package/src/rules/linesBeforeBlock.js +4 -8
- package/src/rules/matchDescription.js +2 -4
- package/src/rules/matchName.js +1 -2
- package/src/rules/multilineBlocks.js +3 -6
- package/src/rules/noBadBlocks.js +1 -2
- package/src/rules/noTypes.js +1 -2
- package/src/rules/noUndefinedTypes.js +7 -1
- package/src/rules/requireAsteriskPrefix.js +1 -2
- package/src/rules/requireDescriptionCompleteSentence.js +1 -2
- package/src/rules/requireFileOverview.js +1 -3
- package/src/rules/requireHyphenBeforeParamDescription.js +1 -2
- package/src/rules/requireJsdoc.js +3 -6
- package/src/rules/requireParam.js +6 -12
- package/src/rules/requireParamName.js +1 -2
- package/src/rules/requireReturns.js +1 -2
- package/src/rules/requireTemplate.js +1 -2
- package/src/rules/sortTags.js +1 -2
- package/src/rules.d.ts +34 -37
package/dist/rules.d.ts
CHANGED
|
@@ -82,7 +82,6 @@ export interface Rules {
|
|
|
82
82
|
/**
|
|
83
83
|
* An object with any of the following spacing keys set to an integer.
|
|
84
84
|
* If a spacing is not defined, it defaults to one.
|
|
85
|
-
*
|
|
86
85
|
*/
|
|
87
86
|
customSpacings?: {
|
|
88
87
|
/**
|
|
@@ -261,6 +260,12 @@ export interface Rules {
|
|
|
261
260
|
* Set to `false` to disable auto-removal of types that are redundant with the [`typed` option](#typed).
|
|
262
261
|
*/
|
|
263
262
|
enableFixer?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* List of tags to allow inline.
|
|
265
|
+
*
|
|
266
|
+
* Defaults to array of `'link', 'linkcode', 'linkplain', 'tutorial'`
|
|
267
|
+
*/
|
|
268
|
+
inlineTags?: string[];
|
|
264
269
|
/**
|
|
265
270
|
* If this is set to `true`, all of the following tags used to control JSX output are allowed:
|
|
266
271
|
*
|
|
@@ -431,7 +436,6 @@ export interface Rules {
|
|
|
431
436
|
*
|
|
432
437
|
* Defaults to `ArrowFunctionExpression`, `FunctionDeclaration`,
|
|
433
438
|
* `FunctionExpression`, `TSDeclareFunction`.
|
|
434
|
-
*
|
|
435
439
|
*/
|
|
436
440
|
contexts?: (
|
|
437
441
|
| string
|
|
@@ -490,7 +494,6 @@ export interface Rules {
|
|
|
490
494
|
* ```
|
|
491
495
|
*
|
|
492
496
|
* Defaults to `multi`.
|
|
493
|
-
*
|
|
494
497
|
*/
|
|
495
498
|
enforceJsdocLineStyle?: "multi" | "single";
|
|
496
499
|
/**
|
|
@@ -520,12 +523,36 @@ export interface Rules {
|
|
|
520
523
|
* 'jsdoc/empty-tags': ['error', {tags: ['event']}]
|
|
521
524
|
* }
|
|
522
525
|
* ```
|
|
523
|
-
*
|
|
524
526
|
*/
|
|
525
527
|
tags?: string[];
|
|
526
528
|
}
|
|
527
529
|
];
|
|
528
530
|
|
|
531
|
+
/** Reports use of JSDoc tags in non-tag positions (in the default "typescript" mode). */
|
|
532
|
+
"jsdoc/escape-inline-tags":
|
|
533
|
+
| []
|
|
534
|
+
| [
|
|
535
|
+
{
|
|
536
|
+
/**
|
|
537
|
+
* A listing of tags you wish to allow unescaped. Defaults to an empty array.
|
|
538
|
+
*/
|
|
539
|
+
allowedInlineTags?: string[];
|
|
540
|
+
/**
|
|
541
|
+
* Whether to enable the fixer. Defaults to `false`.
|
|
542
|
+
*/
|
|
543
|
+
enableFixer?: boolean;
|
|
544
|
+
/**
|
|
545
|
+
* How to escape the inline tag.
|
|
546
|
+
*
|
|
547
|
+
* May be "backticks" to enclose tags in backticks (treating as code segments), or
|
|
548
|
+
* "backslash" to escape tags with a backslash, i.e., `\@`
|
|
549
|
+
*
|
|
550
|
+
* Defaults to "backslash".
|
|
551
|
+
*/
|
|
552
|
+
fixType?: "backticks" | "backslash";
|
|
553
|
+
}
|
|
554
|
+
];
|
|
555
|
+
|
|
529
556
|
/** Prohibits use of `@implements` on non-constructor functions (to enforce the tag only being used on classes/constructors). */
|
|
530
557
|
"jsdoc/implements-on-classes":
|
|
531
558
|
| []
|
|
@@ -582,7 +609,6 @@ export interface Rules {
|
|
|
582
609
|
* "a": ["an", "our"]
|
|
583
610
|
* }
|
|
584
611
|
* ```
|
|
585
|
-
*
|
|
586
612
|
*/
|
|
587
613
|
aliases?: {
|
|
588
614
|
/**
|
|
@@ -604,7 +630,6 @@ export interface Rules {
|
|
|
604
630
|
* ```
|
|
605
631
|
*
|
|
606
632
|
* No tags are excluded by default.
|
|
607
|
-
*
|
|
608
633
|
*/
|
|
609
634
|
excludedTags?: string[];
|
|
610
635
|
/**
|
|
@@ -622,7 +647,6 @@ export interface Rules {
|
|
|
622
647
|
* ```json
|
|
623
648
|
* ["a", "an", "i", "in", "of", "s", "the"]
|
|
624
649
|
* ```
|
|
625
|
-
*
|
|
626
650
|
*/
|
|
627
651
|
uselessWords?: string[];
|
|
628
652
|
}
|
|
@@ -636,26 +660,22 @@ export interface Rules {
|
|
|
636
660
|
/**
|
|
637
661
|
* Whether to additionally check the start of blocks, such as classes or functions.
|
|
638
662
|
* Defaults to `false`.
|
|
639
|
-
*
|
|
640
663
|
*/
|
|
641
664
|
checkBlockStarts?: boolean;
|
|
642
665
|
/**
|
|
643
666
|
* An array of tags whose presence in the JSDoc block will prevent the
|
|
644
667
|
* application of the rule. Defaults to `['type']` (i.e., if `@type` is present,
|
|
645
668
|
* lines before the block will not be added).
|
|
646
|
-
*
|
|
647
669
|
*/
|
|
648
670
|
excludedTags?: string[];
|
|
649
671
|
/**
|
|
650
672
|
* This option excludes cases where the JSDoc block occurs on the same line as a
|
|
651
673
|
* preceding code or comment. Defaults to `true`.
|
|
652
|
-
*
|
|
653
674
|
*/
|
|
654
675
|
ignoreSameLine?: boolean;
|
|
655
676
|
/**
|
|
656
677
|
* This option excludes cases where the JSDoc block is only one line long.
|
|
657
678
|
* Defaults to `true`.
|
|
658
|
-
*
|
|
659
679
|
*/
|
|
660
680
|
ignoreSingleLines?: boolean;
|
|
661
681
|
/**
|
|
@@ -683,7 +703,6 @@ export interface Rules {
|
|
|
683
703
|
*
|
|
684
704
|
* See the ["AST and Selectors"](../#advanced-ast-and-selectors)
|
|
685
705
|
* section of our Advanced docs for more on the expected format.
|
|
686
|
-
*
|
|
687
706
|
*/
|
|
688
707
|
contexts?: (
|
|
689
708
|
| string
|
|
@@ -765,7 +784,6 @@ export interface Rules {
|
|
|
765
784
|
*
|
|
766
785
|
* This can be overridden per tag or for the main block description by setting
|
|
767
786
|
* `message` within `tags` or `mainDescription`, respectively.
|
|
768
|
-
*
|
|
769
787
|
*/
|
|
770
788
|
message?: string;
|
|
771
789
|
/**
|
|
@@ -863,7 +881,6 @@ export interface Rules {
|
|
|
863
881
|
* tag of the desired tag and/or name and no `disallowName` (or `allowName`) is
|
|
864
882
|
* supplied. In such a case, only one error will be reported, but no fixer will
|
|
865
883
|
* be applied, however.
|
|
866
|
-
*
|
|
867
884
|
*/
|
|
868
885
|
match: {
|
|
869
886
|
/**
|
|
@@ -952,7 +969,6 @@ export interface Rules {
|
|
|
952
969
|
* lines.
|
|
953
970
|
*
|
|
954
971
|
* Defaults to `['*']`.
|
|
955
|
-
*
|
|
956
972
|
*/
|
|
957
973
|
multilineTags?: "*" | string[];
|
|
958
974
|
/**
|
|
@@ -977,7 +993,6 @@ export interface Rules {
|
|
|
977
993
|
* are whitelisted in `singleLineTags`.
|
|
978
994
|
*
|
|
979
995
|
* Defaults to `false`.
|
|
980
|
-
*
|
|
981
996
|
*/
|
|
982
997
|
noSingleLineBlocks?: boolean;
|
|
983
998
|
/**
|
|
@@ -998,7 +1013,6 @@ export interface Rules {
|
|
|
998
1013
|
* descriptions.
|
|
999
1014
|
*
|
|
1000
1015
|
* Defaults to `null`.
|
|
1001
|
-
*
|
|
1002
1016
|
*/
|
|
1003
1017
|
requireSingleLineUnderCount?: number;
|
|
1004
1018
|
/**
|
|
@@ -1025,7 +1039,6 @@ export interface Rules {
|
|
|
1025
1039
|
*
|
|
1026
1040
|
* Defaults to `['ts-check', 'ts-expect-error', 'ts-ignore', 'ts-nocheck']`
|
|
1027
1041
|
* (some directives [used by TypeScript](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check)).
|
|
1028
|
-
*
|
|
1029
1042
|
*/
|
|
1030
1043
|
ignore?: string[];
|
|
1031
1044
|
/**
|
|
@@ -1233,7 +1246,6 @@ export interface Rules {
|
|
|
1233
1246
|
*
|
|
1234
1247
|
* See the ["AST and Selectors"](../#advanced-ast-and-selectors)
|
|
1235
1248
|
* section of our Advanced docs for more on the expected format.
|
|
1236
|
-
*
|
|
1237
1249
|
*/
|
|
1238
1250
|
contexts?: (
|
|
1239
1251
|
| string
|
|
@@ -1326,7 +1338,6 @@ export interface Rules {
|
|
|
1326
1338
|
* }]
|
|
1327
1339
|
* }
|
|
1328
1340
|
* ```
|
|
1329
|
-
*
|
|
1330
1341
|
*/
|
|
1331
1342
|
tags?: {
|
|
1332
1343
|
/**
|
|
@@ -1446,7 +1457,6 @@ export interface Rules {
|
|
|
1446
1457
|
* its "description" (e.g., for `@returns {someType} some description`, the
|
|
1447
1458
|
* description is `some description` while for `@some-tag xyz`, the description
|
|
1448
1459
|
* is `xyz`).
|
|
1449
|
-
*
|
|
1450
1460
|
*/
|
|
1451
1461
|
tags?: string[];
|
|
1452
1462
|
}
|
|
@@ -1577,8 +1587,6 @@ export interface Rules {
|
|
|
1577
1587
|
* in this configuration object regardless of whether you have configured
|
|
1578
1588
|
* `fileoverview` instead of `file` on `tagNamePreference` (i.e., `fileoverview`
|
|
1579
1589
|
* will be checked, but you must use `file` on the configuration object).
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1582
1590
|
*/
|
|
1583
1591
|
tags?: {
|
|
1584
1592
|
/**
|
|
@@ -1609,7 +1617,6 @@ export interface Rules {
|
|
|
1609
1617
|
* `'*': 'always'` to apply hyphen checking to any tag (besides the preferred
|
|
1610
1618
|
* `@param` tag which follows the main string option setting and besides any
|
|
1611
1619
|
* other `tags` entries).
|
|
1612
|
-
*
|
|
1613
1620
|
*/
|
|
1614
1621
|
tags?:
|
|
1615
1622
|
| {
|
|
@@ -1640,7 +1647,6 @@ export interface Rules {
|
|
|
1640
1647
|
* getters should be checked but only when there is no setter. This may be useful
|
|
1641
1648
|
* if one only wishes documentation on one of the two accessors. Defaults to
|
|
1642
1649
|
* `false`.
|
|
1643
|
-
*
|
|
1644
1650
|
*/
|
|
1645
1651
|
checkGetters?: boolean | "no-setter";
|
|
1646
1652
|
/**
|
|
@@ -1695,7 +1701,6 @@ export interface Rules {
|
|
|
1695
1701
|
* function/method names are sufficient for themselves as documentation).
|
|
1696
1702
|
*
|
|
1697
1703
|
* Defaults to `false`.
|
|
1698
|
-
*
|
|
1699
1704
|
*/
|
|
1700
1705
|
exemptEmptyFunctions?: boolean;
|
|
1701
1706
|
/**
|
|
@@ -1728,7 +1733,6 @@ export interface Rules {
|
|
|
1728
1733
|
* - `esm` - ESM exports are checked for JSDoc comments (Defaults to `true`)
|
|
1729
1734
|
* - `cjs` - CommonJS exports are checked for JSDoc comments (Defaults to `true`)
|
|
1730
1735
|
* - `window` - Window global exports are checked for JSDoc comments
|
|
1731
|
-
*
|
|
1732
1736
|
*/
|
|
1733
1737
|
publicOnly?:
|
|
1734
1738
|
| boolean
|
|
@@ -1795,13 +1799,11 @@ export interface Rules {
|
|
|
1795
1799
|
/**
|
|
1796
1800
|
* Numeric to indicate the number at which to begin auto-incrementing roots.
|
|
1797
1801
|
* Defaults to `0`.
|
|
1798
|
-
*
|
|
1799
1802
|
*/
|
|
1800
1803
|
autoIncrementBase?: number;
|
|
1801
1804
|
/**
|
|
1802
1805
|
* A value indicating whether `constructor`s should be checked. Defaults to
|
|
1803
1806
|
* `true`.
|
|
1804
|
-
*
|
|
1805
1807
|
*/
|
|
1806
1808
|
checkConstructors?: boolean;
|
|
1807
1809
|
/**
|
|
@@ -1818,7 +1820,6 @@ export interface Rules {
|
|
|
1818
1820
|
* implied to be `false` (i.e., the inside of the roots will not be checked
|
|
1819
1821
|
* either, e.g., it will also not complain if `a` or `b` do not have their own
|
|
1820
1822
|
* documentation). Defaults to `true`.
|
|
1821
|
-
*
|
|
1822
1823
|
*/
|
|
1823
1824
|
checkDestructuredRoots?: boolean;
|
|
1824
1825
|
/**
|
|
@@ -1876,7 +1877,6 @@ export interface Rules {
|
|
|
1876
1877
|
* function quux ({num, ...extra}) {
|
|
1877
1878
|
* }
|
|
1878
1879
|
* ```
|
|
1879
|
-
*
|
|
1880
1880
|
*/
|
|
1881
1881
|
checkRestProperty?: boolean;
|
|
1882
1882
|
/**
|
|
@@ -1930,7 +1930,6 @@ export interface Rules {
|
|
|
1930
1930
|
*
|
|
1931
1931
|
* See the ["AST and Selectors"](../#advanced-ast-and-selectors)
|
|
1932
1932
|
* section of our Advanced docs for more on the expected format.
|
|
1933
|
-
*
|
|
1934
1933
|
*/
|
|
1935
1934
|
contexts?: (
|
|
1936
1935
|
| string
|
|
@@ -1977,7 +1976,6 @@ export interface Rules {
|
|
|
1977
1976
|
* type to use.
|
|
1978
1977
|
*
|
|
1979
1978
|
* Defaults to `true`.
|
|
1980
|
-
*
|
|
1981
1979
|
*/
|
|
1982
1980
|
enableRestElementFixer?: boolean;
|
|
1983
1981
|
/**
|
|
@@ -2128,7 +2126,6 @@ export interface Rules {
|
|
|
2128
2126
|
*
|
|
2129
2127
|
* See the ["AST and Selectors"](../#advanced-ast-and-selectors)
|
|
2130
2128
|
* section of our Advanced docs for more on the expected format.
|
|
2131
|
-
*
|
|
2132
2129
|
*/
|
|
2133
2130
|
contexts?: (
|
|
2134
2131
|
| string
|
|
@@ -2281,7 +2278,6 @@ export interface Rules {
|
|
|
2281
2278
|
* - `esm` - ESM exports are checked for `@returns` JSDoc comments (Defaults to `true`)
|
|
2282
2279
|
* - `cjs` - CommonJS exports are checked for `@returns` JSDoc comments (Defaults to `true`)
|
|
2283
2280
|
* - `window` - Window global exports are checked for `@returns` JSDoc comments
|
|
2284
|
-
*
|
|
2285
2281
|
*/
|
|
2286
2282
|
publicOnly?:
|
|
2287
2283
|
| boolean
|
|
@@ -2438,12 +2434,14 @@ export interface Rules {
|
|
|
2438
2434
|
* ```
|
|
2439
2435
|
*
|
|
2440
2436
|
* Defaults to `false`.
|
|
2441
|
-
*
|
|
2442
2437
|
*/
|
|
2443
2438
|
requireSeparateTemplates?: boolean;
|
|
2444
2439
|
}
|
|
2445
2440
|
];
|
|
2446
2441
|
|
|
2442
|
+
/** Requires a description for `@template` tags */
|
|
2443
|
+
"jsdoc/require-template-description": [];
|
|
2444
|
+
|
|
2447
2445
|
/** Requires that throw statements are documented with `@throws` tags. */
|
|
2448
2446
|
"jsdoc/require-throws":
|
|
2449
2447
|
| []
|
|
@@ -2839,7 +2837,6 @@ export interface Rules {
|
|
|
2839
2837
|
* 'todo',
|
|
2840
2838
|
* ]}];
|
|
2841
2839
|
* ```
|
|
2842
|
-
*
|
|
2843
2840
|
*/
|
|
2844
2841
|
tagSequence?: {
|
|
2845
2842
|
/**
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "http://gajus.com"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@es-joy/jsdoccomment": "~0.
|
|
8
|
+
"@es-joy/jsdoccomment": "~0.64.0",
|
|
9
9
|
"are-docs-informative": "^0.0.2",
|
|
10
10
|
"comment-parser": "1.4.1",
|
|
11
11
|
"debug": "^4.4.3",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@babel/plugin-syntax-class-properties": "^7.12.13",
|
|
28
28
|
"@babel/plugin-transform-flow-strip-types": "^7.27.1",
|
|
29
29
|
"@babel/preset-env": "^7.28.3",
|
|
30
|
-
"@es-joy/escodegen": "^
|
|
31
|
-
"@es-joy/jsdoc-eslint-parser": "^0.
|
|
30
|
+
"@es-joy/escodegen": "^4.0.3",
|
|
31
|
+
"@es-joy/jsdoc-eslint-parser": "^0.24.0",
|
|
32
32
|
"@eslint/core": "^0.16.0",
|
|
33
33
|
"@hkdobrev/run-if-changed": "^0.6.3",
|
|
34
34
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"@types/estree": "^1.0.8",
|
|
42
42
|
"@types/json-schema": "^7.0.15",
|
|
43
43
|
"@types/mocha": "^10.0.10",
|
|
44
|
-
"@types/node": "^24.
|
|
44
|
+
"@types/node": "^24.6.0",
|
|
45
45
|
"@types/semver": "^7.7.1",
|
|
46
46
|
"@types/spdx-expression-parse": "^3.0.5",
|
|
47
|
-
"@typescript-eslint/types": "^8.
|
|
47
|
+
"@typescript-eslint/types": "^8.45.0",
|
|
48
48
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
49
49
|
"babel-plugin-istanbul": "^7.0.1",
|
|
50
50
|
"babel-plugin-transform-import-meta": "^2.3.3",
|
|
51
51
|
"c8": "^10.1.3",
|
|
52
52
|
"camelcase": "^8.0.0",
|
|
53
|
-
"chai": "^6.0
|
|
53
|
+
"chai": "^6.2.0",
|
|
54
54
|
"decamelize": "^6.0.1",
|
|
55
55
|
"eslint": "9.36.0",
|
|
56
56
|
"eslint-config-canonical": "^45.0.0",
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
"glob": "^11.0.3",
|
|
59
59
|
"globals": "^16.4.0",
|
|
60
60
|
"husky": "^9.1.7",
|
|
61
|
-
"jsdoc-type-pratt-parser": "^
|
|
61
|
+
"jsdoc-type-pratt-parser": "^6.0.1",
|
|
62
62
|
"json-schema": "^0.4.0",
|
|
63
63
|
"json-schema-to-typescript": "^15.0.4",
|
|
64
|
-
"lint-staged": "^16.2.
|
|
65
|
-
"mocha": "^11.7.
|
|
64
|
+
"lint-staged": "^16.2.3",
|
|
65
|
+
"mocha": "^11.7.3",
|
|
66
66
|
"open-editor": "^5.1.0",
|
|
67
67
|
"replace": "^1.2.2",
|
|
68
68
|
"rimraf": "^6.0.1",
|
|
69
69
|
"semantic-release": "^24.2.9",
|
|
70
70
|
"typescript": "5.9.2",
|
|
71
|
-
"typescript-eslint": "^8.
|
|
71
|
+
"typescript-eslint": "^8.45.0"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=20.11.0"
|
|
@@ -178,5 +178,5 @@
|
|
|
178
178
|
"test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
|
|
179
179
|
"test-index": "pnpm run test-no-cov test/rules/index.js"
|
|
180
180
|
},
|
|
181
|
-
"version": "60.
|
|
181
|
+
"version": "60.6.0"
|
|
182
182
|
}
|
package/src/index-cjs.js
CHANGED
|
@@ -21,6 +21,7 @@ import checkTypes from './rules/checkTypes.js';
|
|
|
21
21
|
import checkValues from './rules/checkValues.js';
|
|
22
22
|
import convertToJsdocComments from './rules/convertToJsdocComments.js';
|
|
23
23
|
import emptyTags from './rules/emptyTags.js';
|
|
24
|
+
import escapeInlineTags from './rules/escapeInlineTags.js';
|
|
24
25
|
import implementsOnClasses from './rules/implementsOnClasses.js';
|
|
25
26
|
import importsAsDependencies from './rules/importsAsDependencies.js';
|
|
26
27
|
import informativeDocs from './rules/informativeDocs.js';
|
|
@@ -101,6 +102,7 @@ index.rules = {
|
|
|
101
102
|
'check-values': checkValues,
|
|
102
103
|
'convert-to-jsdoc-comments': convertToJsdocComments,
|
|
103
104
|
'empty-tags': emptyTags,
|
|
105
|
+
'escape-inline-tags': escapeInlineTags,
|
|
104
106
|
'implements-on-classes': implementsOnClasses,
|
|
105
107
|
'imports-as-dependencies': importsAsDependencies,
|
|
106
108
|
'informative-docs': informativeDocs,
|
|
@@ -188,6 +190,17 @@ index.rules = {
|
|
|
188
190
|
'require-returns-type': requireReturnsType,
|
|
189
191
|
'require-tags': requireTags,
|
|
190
192
|
'require-template': requireTemplate,
|
|
193
|
+
'require-template-description': buildForbidRuleDefinition({
|
|
194
|
+
contexts: [
|
|
195
|
+
{
|
|
196
|
+
comment: 'JsdocBlock:has(JsdocTag[tag=template]:not([description!=""]))',
|
|
197
|
+
context: 'any',
|
|
198
|
+
message: '@template should have a description',
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
description: 'Requires a description for `@template` tags',
|
|
202
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template-description.md#repos-sticky-header',
|
|
203
|
+
}),
|
|
191
204
|
'require-throws': requireThrows,
|
|
192
205
|
'require-throws-description': buildForbidRuleDefinition({
|
|
193
206
|
contexts: [
|
|
@@ -274,6 +287,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
274
287
|
'jsdoc/check-values': warnOrError,
|
|
275
288
|
'jsdoc/convert-to-jsdoc-comments': 'off',
|
|
276
289
|
'jsdoc/empty-tags': warnOrError,
|
|
290
|
+
'jsdoc/escape-inline-tags': warnOrError,
|
|
277
291
|
'jsdoc/implements-on-classes': warnOrError,
|
|
278
292
|
'jsdoc/imports-as-dependencies': 'off',
|
|
279
293
|
'jsdoc/informative-docs': 'off',
|
|
@@ -316,6 +330,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
316
330
|
'jsdoc/require-returns-type': warnOrError,
|
|
317
331
|
'jsdoc/require-tags': 'off',
|
|
318
332
|
'jsdoc/require-template': 'off',
|
|
333
|
+
'jsdoc/require-template-description': 'off',
|
|
319
334
|
'jsdoc/require-throws': 'off',
|
|
320
335
|
'jsdoc/require-throws-description': 'off',
|
|
321
336
|
'jsdoc/require-throws-type': warnOrError,
|
|
@@ -439,6 +454,7 @@ const logicalRules = [
|
|
|
439
454
|
'jsdoc/check-types',
|
|
440
455
|
'jsdoc/check-values',
|
|
441
456
|
'jsdoc/empty-tags',
|
|
457
|
+
'jsdoc/escape-inline-tags',
|
|
442
458
|
'jsdoc/implements-on-classes',
|
|
443
459
|
'jsdoc/require-returns-check',
|
|
444
460
|
'jsdoc/require-yields-check',
|
package/src/index-esm.js
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
export default index;
|
|
17
17
|
// END REPLACE
|
|
18
18
|
|
|
19
|
-
/* eslint-disable jsdoc/valid-types -- Bug */
|
|
20
19
|
/**
|
|
21
20
|
* @type {((
|
|
22
21
|
* cfg?: import('eslint').Linter.Config & {
|
|
@@ -54,7 +53,6 @@ export default index;
|
|
|
54
53
|
* ) => import('eslint').Linter.Config)}
|
|
55
54
|
*/
|
|
56
55
|
export const jsdoc = function (cfg) {
|
|
57
|
-
/* eslint-enable jsdoc/valid-types -- Bug */
|
|
58
56
|
/** @type {import('eslint').Linter.Config} */
|
|
59
57
|
let outputConfig = {
|
|
60
58
|
plugins: {
|
package/src/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import checkTypes from './rules/checkTypes.js';
|
|
|
27
27
|
import checkValues from './rules/checkValues.js';
|
|
28
28
|
import convertToJsdocComments from './rules/convertToJsdocComments.js';
|
|
29
29
|
import emptyTags from './rules/emptyTags.js';
|
|
30
|
+
import escapeInlineTags from './rules/escapeInlineTags.js';
|
|
30
31
|
import implementsOnClasses from './rules/implementsOnClasses.js';
|
|
31
32
|
import importsAsDependencies from './rules/importsAsDependencies.js';
|
|
32
33
|
import informativeDocs from './rules/informativeDocs.js';
|
|
@@ -107,6 +108,7 @@ index.rules = {
|
|
|
107
108
|
'check-values': checkValues,
|
|
108
109
|
'convert-to-jsdoc-comments': convertToJsdocComments,
|
|
109
110
|
'empty-tags': emptyTags,
|
|
111
|
+
'escape-inline-tags': escapeInlineTags,
|
|
110
112
|
'implements-on-classes': implementsOnClasses,
|
|
111
113
|
'imports-as-dependencies': importsAsDependencies,
|
|
112
114
|
'informative-docs': informativeDocs,
|
|
@@ -194,6 +196,17 @@ index.rules = {
|
|
|
194
196
|
'require-returns-type': requireReturnsType,
|
|
195
197
|
'require-tags': requireTags,
|
|
196
198
|
'require-template': requireTemplate,
|
|
199
|
+
'require-template-description': buildForbidRuleDefinition({
|
|
200
|
+
contexts: [
|
|
201
|
+
{
|
|
202
|
+
comment: 'JsdocBlock:has(JsdocTag[tag=template]:not([description!=""]))',
|
|
203
|
+
context: 'any',
|
|
204
|
+
message: '@template should have a description',
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
description: 'Requires a description for `@template` tags',
|
|
208
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template-description.md#repos-sticky-header',
|
|
209
|
+
}),
|
|
197
210
|
'require-throws': requireThrows,
|
|
198
211
|
'require-throws-description': buildForbidRuleDefinition({
|
|
199
212
|
contexts: [
|
|
@@ -280,6 +293,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
280
293
|
'jsdoc/check-values': warnOrError,
|
|
281
294
|
'jsdoc/convert-to-jsdoc-comments': 'off',
|
|
282
295
|
'jsdoc/empty-tags': warnOrError,
|
|
296
|
+
'jsdoc/escape-inline-tags': warnOrError,
|
|
283
297
|
'jsdoc/implements-on-classes': warnOrError,
|
|
284
298
|
'jsdoc/imports-as-dependencies': 'off',
|
|
285
299
|
'jsdoc/informative-docs': 'off',
|
|
@@ -322,6 +336,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
|
|
|
322
336
|
'jsdoc/require-returns-type': warnOrError,
|
|
323
337
|
'jsdoc/require-tags': 'off',
|
|
324
338
|
'jsdoc/require-template': 'off',
|
|
339
|
+
'jsdoc/require-template-description': 'off',
|
|
325
340
|
'jsdoc/require-throws': 'off',
|
|
326
341
|
'jsdoc/require-throws-description': 'off',
|
|
327
342
|
'jsdoc/require-throws-type': warnOrError,
|
|
@@ -445,6 +460,7 @@ const logicalRules = [
|
|
|
445
460
|
'jsdoc/check-types',
|
|
446
461
|
'jsdoc/check-values',
|
|
447
462
|
'jsdoc/empty-tags',
|
|
463
|
+
'jsdoc/escape-inline-tags',
|
|
448
464
|
'jsdoc/implements-on-classes',
|
|
449
465
|
'jsdoc/require-returns-check',
|
|
450
466
|
'jsdoc/require-yields-check',
|
|
@@ -694,7 +710,6 @@ index.configs['flat/recommended-mixed'] = [
|
|
|
694
710
|
|
|
695
711
|
export default index;
|
|
696
712
|
|
|
697
|
-
/* eslint-disable jsdoc/valid-types -- Bug */
|
|
698
713
|
/**
|
|
699
714
|
* @type {((
|
|
700
715
|
* cfg?: import('eslint').Linter.Config & {
|
|
@@ -732,7 +747,6 @@ export default index;
|
|
|
732
747
|
* ) => import('eslint').Linter.Config)}
|
|
733
748
|
*/
|
|
734
749
|
export const jsdoc = function (cfg) {
|
|
735
|
-
/* eslint-enable jsdoc/valid-types -- Bug */
|
|
736
750
|
/** @type {import('eslint').Linter.Config} */
|
|
737
751
|
let outputConfig = {
|
|
738
752
|
plugins: {
|
package/src/iterateJsdoc.js
CHANGED
|
@@ -436,6 +436,14 @@ import esquery from 'esquery';
|
|
|
436
436
|
* import('@es-joy/jsdoccomment').JsdocInlineTagNoType)[]}
|
|
437
437
|
*/
|
|
438
438
|
|
|
439
|
+
/**
|
|
440
|
+
* @callback getInlineTags
|
|
441
|
+
* @returns {(import('comment-parser').Spec|
|
|
442
|
+
* import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {
|
|
443
|
+
* line?: number | undefined; column?: number | undefined;
|
|
444
|
+
* })[]}
|
|
445
|
+
*/
|
|
446
|
+
|
|
439
447
|
/**
|
|
440
448
|
* @callback GetTagsByType
|
|
441
449
|
* @param {import('comment-parser').Spec[]} tags
|
|
@@ -533,6 +541,7 @@ import esquery from 'esquery';
|
|
|
533
541
|
* getPresentTags: GetPresentTags,
|
|
534
542
|
* filterTags: FilterTags,
|
|
535
543
|
* filterAllTags: FilterAllTags,
|
|
544
|
+
* getInlineTags: getInlineTags,
|
|
536
545
|
* getTagsByType: GetTagsByType,
|
|
537
546
|
* hasOptionTag: HasOptionTag,
|
|
538
547
|
* getClassNode: GetClassNode,
|
|
@@ -1641,6 +1650,10 @@ const getUtils = (
|
|
|
1641
1650
|
});
|
|
1642
1651
|
};
|
|
1643
1652
|
|
|
1653
|
+
utils.getInlineTags = () => {
|
|
1654
|
+
return jsdocUtils.getInlineTags(jsdoc);
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1644
1657
|
/** @type {GetTagsByType} */
|
|
1645
1658
|
utils.getTagsByType = (tags) => {
|
|
1646
1659
|
return jsdocUtils.getTagsByType(context, mode, tags);
|
package/src/jsdocUtils.js
CHANGED
|
@@ -836,14 +836,15 @@ const forEachPreferredTag = (
|
|
|
836
836
|
};
|
|
837
837
|
|
|
838
838
|
/**
|
|
839
|
-
* Get all
|
|
839
|
+
* Get all inline tags and inline tags in tags
|
|
840
840
|
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
841
841
|
* @returns {(import('comment-parser').Spec|
|
|
842
|
-
* import('@es-joy/jsdoccomment').JsdocInlineTagNoType
|
|
842
|
+
* import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {
|
|
843
|
+
* line?: number | undefined; column?: number | undefined;
|
|
844
|
+
* })[]}
|
|
843
845
|
*/
|
|
844
|
-
const
|
|
846
|
+
const getInlineTags = (jsdoc) => {
|
|
845
847
|
return [
|
|
846
|
-
...jsdoc.tags,
|
|
847
848
|
...jsdoc.inlineTags.map((inlineTag) => {
|
|
848
849
|
// Tags don't have source or line numbers, so add before returning
|
|
849
850
|
let line = -1;
|
|
@@ -863,18 +864,6 @@ const getAllTags = (jsdoc) => {
|
|
|
863
864
|
return inlineTag;
|
|
864
865
|
}),
|
|
865
866
|
...jsdoc.tags.flatMap((tag) => {
|
|
866
|
-
let tagBegins = -1;
|
|
867
|
-
for (const {
|
|
868
|
-
tokens: {
|
|
869
|
-
tag: tg,
|
|
870
|
-
},
|
|
871
|
-
} of jsdoc.source) {
|
|
872
|
-
tagBegins++;
|
|
873
|
-
if (tg) {
|
|
874
|
-
break;
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
|
|
878
867
|
for (const inlineTag of tag.inlineTags) {
|
|
879
868
|
/** @type {import('./iterateJsdoc.js').Integer} */
|
|
880
869
|
let line = 0;
|
|
@@ -890,7 +879,7 @@ const getAllTags = (jsdoc) => {
|
|
|
890
879
|
}
|
|
891
880
|
}
|
|
892
881
|
|
|
893
|
-
inlineTag.line =
|
|
882
|
+
inlineTag.line = line;
|
|
894
883
|
}
|
|
895
884
|
|
|
896
885
|
return (
|
|
@@ -906,6 +895,21 @@ const getAllTags = (jsdoc) => {
|
|
|
906
895
|
];
|
|
907
896
|
};
|
|
908
897
|
|
|
898
|
+
/**
|
|
899
|
+
* Get all tags, inline tags and inline tags in tags
|
|
900
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
901
|
+
* @returns {(import('comment-parser').Spec|
|
|
902
|
+
* import('@es-joy/jsdoccomment').JsdocInlineTagNoType & {
|
|
903
|
+
* line?: number | undefined; column?: number | undefined;
|
|
904
|
+
* })[]}
|
|
905
|
+
*/
|
|
906
|
+
const getAllTags = (jsdoc) => {
|
|
907
|
+
return [
|
|
908
|
+
...jsdoc.tags,
|
|
909
|
+
...getInlineTags(jsdoc),
|
|
910
|
+
];
|
|
911
|
+
};
|
|
912
|
+
|
|
909
913
|
/**
|
|
910
914
|
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
911
915
|
* @param {string[]} targetTagNames
|
|
@@ -1853,6 +1857,7 @@ export {
|
|
|
1853
1857
|
getContextObject,
|
|
1854
1858
|
getFunctionParameterNames,
|
|
1855
1859
|
getIndent,
|
|
1860
|
+
getInlineTags,
|
|
1856
1861
|
getJsdocTagsDeep,
|
|
1857
1862
|
getPreferredTagName,
|
|
1858
1863
|
getPreferredTagNameSimple,
|
|
@@ -338,8 +338,7 @@ ensure that at least one space is present after the asterisk delimiter.`,
|
|
|
338
338
|
customSpacings: {
|
|
339
339
|
additionalProperties: false,
|
|
340
340
|
description: `An object with any of the following spacing keys set to an integer.
|
|
341
|
-
If a spacing is not defined, it defaults to one
|
|
342
|
-
`,
|
|
341
|
+
If a spacing is not defined, it defaults to one.`,
|
|
343
342
|
properties: {
|
|
344
343
|
postDelimiter: {
|
|
345
344
|
description: 'Affects spacing after the asterisk (e.g., `* @param`)',
|