eslint-plugin-jsdoc 37.8.0 → 37.9.1

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 CHANGED
@@ -1259,33 +1259,33 @@ function quux () {}
1259
1259
  // Message: @example error (semi): Missing semicolon.
1260
1260
 
1261
1261
  /**
1262
- * @example const i = 5;
1263
- * quux2()
1262
+ * @example const j = 5;
1263
+ * quux2();
1264
1264
  */
1265
1265
  function quux2 () {
1266
1266
 
1267
1267
  }
1268
1268
  // "jsdoc/check-examples": ["error"|"warn", {"matchingFileName":"../../jsdocUtils.js"}]
1269
- // Message: @example warning (id-length): Identifier name 'i' is too short (< 2).
1269
+ // Message: @example warning (id-length): Identifier name 'j' is too short (< 2).
1270
1270
 
1271
1271
  /**
1272
- * @example const i = 5;
1273
- * quux2()
1272
+ * @example const k = 5;
1273
+ * quux2();
1274
1274
  */
1275
1275
  function quux2 () {
1276
1276
 
1277
1277
  }
1278
1278
  // "jsdoc/check-examples": ["error"|"warn", {"configFile":".eslintrc.json","matchingFileName":"../../jsdocUtils.js"}]
1279
- // Message: @example warning (id-length): Identifier name 'i' is too short (< 2).
1279
+ // Message: @example warning (id-length): Identifier name 'k' is too short (< 2).
1280
1280
 
1281
1281
  /**
1282
- * @example const i = 5;
1283
- * quux2()
1282
+ * @example const m = 5;
1283
+ * quux2();
1284
1284
  */
1285
1285
  function quux2 () {
1286
1286
 
1287
1287
  }
1288
- // Message: @example warning (id-length): Identifier name 'i' is too short (< 2).
1288
+ // Message: @example warning (id-length): Identifier name 'm' is too short (< 2).
1289
1289
 
1290
1290
  /**
1291
1291
  * @example const i = 5;
@@ -5818,6 +5818,9 @@ This rule checks the values for a handful of tags:
5818
5818
  5. `@variation` - If `numericOnlyVariation` is set, will checks that there
5819
5819
  is a value present, and that it is an integer (otherwise, jsdoc allows any
5820
5820
  value).
5821
+ 6. `@kind` - Insists that it be one of the allowed values: 'class',
5822
+ 'constant', 'event', 'external', 'file', 'function', 'member', 'mixin',
5823
+ 'module', 'namespace', 'typedef',
5821
5824
 
5822
5825
  <a name="eslint-plugin-jsdoc-rules-check-values-options-8"></a>
5823
5826
  #### Options
@@ -5857,7 +5860,7 @@ Whether to enable validation that `@variation` must be a number. Defaults to
5857
5860
  |||
5858
5861
  |---|---|
5859
5862
  |Context|everywhere|
5860
- |Tags|`@version`, `@since`, `@license`, `@author`, `@variation`|
5863
+ |Tags|`@version`, `@since`, `@kind`, `@license`, `@author`, `@variation`|
5861
5864
  |Recommended|true|
5862
5865
  |Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`|
5863
5866
  |Settings|`tagNamePreference`|
@@ -5881,6 +5884,22 @@ function quux (foo) {
5881
5884
  }
5882
5885
  // Message: Invalid JSDoc @version: "3.1".
5883
5886
 
5887
+ /**
5888
+ * @kind
5889
+ */
5890
+ function quux (foo) {
5891
+
5892
+ }
5893
+ // Message: Missing JSDoc @kind value.
5894
+
5895
+ /**
5896
+ * @kind -3
5897
+ */
5898
+ function quux (foo) {
5899
+
5900
+ }
5901
+ // Message: Invalid JSDoc @kind: "-3"; must be one of: class, constant, event, external, file, function, member, mixin, module, namespace, typedef.
5902
+
5884
5903
  /**
5885
5904
  * @variation -3
5886
5905
  */
@@ -6108,6 +6127,13 @@ function quux (foo) {
6108
6127
  * @license MIT
6109
6128
  */
6110
6129
  'use strict';
6130
+
6131
+ /**
6132
+ * @kind function
6133
+ */
6134
+ function quux (foo) {
6135
+
6136
+ }
6111
6137
  ````
6112
6138
 
6113
6139
 
@@ -6177,6 +6203,12 @@ function quux () {
6177
6203
  }
6178
6204
  // Message: @abstract should be empty.
6179
6205
 
6206
+ /**
6207
+ * @interface extra text
6208
+ */
6209
+ // Settings: {"jsdoc":{"mode":"closure"}}
6210
+ // Message: @interface should be empty.
6211
+
6180
6212
  class Test {
6181
6213
  /**
6182
6214
  * @abstract extra text
@@ -21243,7 +21275,7 @@ function quux() {
21243
21275
 
21244
21276
  /**
21245
21277
  *
21246
- * @fires {module:namespace.SomeClass#event:ext_anevent}
21278
+ * @fires module:namespace.SomeClass#event:ext_anevent
21247
21279
  */
21248
21280
  function quux() {
21249
21281
 
@@ -10,6 +10,7 @@ const getDefaultTagStructureForMode = mode => {
10
10
  const isClosure = mode === 'closure';
11
11
  const isTypescript = mode === 'typescript';
12
12
  const isPermissive = mode === 'permissive';
13
+ const isJsdocOrPermissive = isJsdoc || isPermissive;
13
14
  const isJsdocOrTypescript = isJsdoc || isTypescript;
14
15
  const isTypescriptOrClosure = isTypescript || isClosure;
15
16
  const isClosureOrPermissive = isClosure || isPermissive;
@@ -53,43 +54,47 @@ const getDefaultTagStructureForMode = mode => {
53
54
  // seems to require both, and as "namepath"'s
54
55
  ['nameContents', 'namepath-referencing'], // "namepath"
55
56
  ['typeOrNameRequired', true]])], ['callback', new Map([// Seems to require a "namepath" in the signature (with no
56
- // counter-examples)
57
+ // counter-examples); TypeScript does not enforce but seems
58
+ // problematic as not attached so presumably not useable without it
57
59
  ['nameContents', 'namepath-defining'], // "namepath"
58
60
  ['nameRequired', true]])], ['class', new Map([// Allows for "name"'s in signature, but indicated as optional
59
- ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['const', new Map([// Allows for "name"'s in signature, but indicated as optional
61
+ ['nameContents', 'namepath-defining'], // Not in use, but should be this value if using to power `empty-tags`
62
+ ['nameAllowed', true], ['typeAllowed', true]])], ['const', new Map([// Allows for "name"'s in signature, but indicated as optional
60
63
  ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['constant', new Map([// Allows for "name"'s in signature, but indicated as optional
61
64
  ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['constructor', new Map([// Allows for "name"'s in signature, but indicated as optional
62
- ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['define', new Map([['typeRequired', isClosure]])], ['emits', new Map([// Signature seems to require a "name" (of an event) and no counter-examples
63
- ['nameContents', 'namepath-referencing']])], ['enum', new Map([// Has example showing curly brackets but not in doc signature
65
+ ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['constructs', new Map([// Allows for "name"'s in signature, but indicated as optional
66
+ ['nameContents', 'namepath-defining'], ['nameRequired', false], ['typeAllowed', false]])], ['define', new Map([['typeRequired', isClosure]])], ['emits', new Map([// Signature seems to require a "name" (of an event) and no counter-examples
67
+ ['nameContents', 'namepath-referencing'], ['nameRequired', true], ['typeAllowed', false]])], ['enum', new Map([// Has example showing curly brackets but not in doc signature
64
68
  ['typeAllowed', true]])], ['event', new Map([// The doc signature of `event` seems to require a "name"
65
69
  ['nameRequired', true], // Appears to require a "name" in its signature, albeit somewhat
66
70
  // different from other "name"'s (including as described
67
71
  // at https://jsdoc.app/about-namepaths.html )
68
72
  ['nameContents', 'namepath-defining']])], ['exception', new Map([// Shows curly brackets in the signature and in the examples
69
- ['typeAllowed', true]])], ['export', new Map([['typeAllowed', isClosureOrPermissive]])], ['extends', new Map([// Signature seems to require a "namepath" (and no counter-examples)
73
+ ['typeAllowed', true]])], // Closure
74
+ ['export', new Map([['typeAllowed', isClosureOrPermissive]])], ['exports', new Map([['nameContents', 'namepath-defining'], ['nameRequired', isJsdoc], ['typeAllowed', isClosureOrPermissive]])], ['extends', new Map([// Signature seems to require a "namepath" (and no counter-examples)
70
75
  ['nameContents', 'namepath-referencing'], // Does not show curly brackets in either the signature or examples
71
76
  ['typeAllowed', isTypescriptOrClosure || isPermissive], ['nameRequired', isJsdoc], // "namepath"
72
77
  ['typeOrNameRequired', isTypescriptOrClosure || isPermissive]])], ['external', new Map([// Appears to require a "name" in its signature, albeit somewhat
73
78
  // different from other "name"'s (including as described
74
79
  // at https://jsdoc.app/about-namepaths.html )
75
80
  ['nameContents', 'namepath-defining'], // "name" (and a special syntax for the `external` name)
76
- ['nameRequired', true]])], ['fires', new Map([// Signature seems to require a "name" (of an event) and no
81
+ ['nameRequired', true], ['typeAllowed', false]])], ['fires', new Map([// Signature seems to require a "name" (of an event) and no
77
82
  // counter-examples
78
- ['nameContents', 'namepath-referencing']])], ['function', new Map([// Allows for "name"'s in signature, but indicated as optional
79
- ['nameContents', 'namepath-defining']])], ['func', new Map([// Allows for "name"'s in signature, but indicated as optional
83
+ ['nameContents', 'namepath-referencing'], ['nameRequired', true], ['typeAllowed', false]])], ['function', new Map([// Allows for "name"'s in signature, but indicated as optional
84
+ ['nameContents', 'namepath-defining'], ['nameRequired', false], ['typeAllowed', false]])], ['func', new Map([// Allows for "name"'s in signature, but indicated as optional
80
85
  ['nameContents', 'namepath-defining']])], ['host', new Map([// Appears to require a "name" in its signature, albeit somewhat
81
86
  // different from other "name"'s (including as described
82
87
  // at https://jsdoc.app/about-namepaths.html )
83
88
  ['nameContents', 'namepath-defining'], // See `external`
84
- ['nameRequired', true], // "namepath"
85
- ['typeOrNameRequired', true]])], ['interface', new Map([// Allows for "name" in signature, but indicates as optional
86
- ['nameContents', isJsdocTypescriptOrPermissive ? 'namepath-defining' : false]])], ['implements', new Map([// Shows curly brackets in the doc signature and examples
89
+ ['nameRequired', true], ['typeAllowed', false]])], ['interface', new Map([// Allows for "name" in signature, but indicates as optional
90
+ ['nameContents', isJsdocTypescriptOrPermissive ? 'namepath-defining' : false], // Not in use, but should be this value if using to power `empty-tags`
91
+ ['nameAllowed', isClosure], ['typeAllowed', false]])], ['implements', new Map([// Shows curly brackets in the doc signature and examples
87
92
  // "typeExpression"
88
93
  ['typeRequired', true]])], ['lends', new Map([// Signature seems to require a "namepath" (and no counter-examples)
89
94
  ['nameContents', 'namepath-referencing'], // "namepath"
90
95
  ['typeOrNameRequired', true]])], ['listens', new Map([// Signature seems to require a "name" (of an event) and no
91
96
  // counter-examples
92
- ['nameContents', 'namepath-referencing']])], ['member', new Map([// Allows for "name"'s in signature, but indicated as optional
97
+ ['nameContents', 'namepath-referencing'], ['nameRequired', true], ['typeAllowed', false]])], ['member', new Map([// Allows for "name"'s in signature, but indicated as optional
93
98
  ['nameContents', 'namepath-defining'], // Has example showing curly brackets but not in doc signature
94
99
  ['typeAllowed', true]])], ['memberof', new Map([// Signature seems to require a "namepath" (and no counter-examples),
95
100
  // though it allows an incomplete namepath ending with connecting symbol
@@ -102,7 +107,7 @@ const getDefaultTagStructureForMode = mode => {
102
107
  // counter-examples
103
108
  ['nameContents', 'namepath-referencing'], // "OtherObjectPath"
104
109
  ['typeOrNameRequired', true]])], ['mixin', new Map([// Allows for "name"'s in signature, but indicated as optional
105
- ['nameContents', 'namepath-defining']])], ['modifies', new Map([// Has no documentation, but test example has curly brackets, and
110
+ ['nameContents', 'namepath-defining'], ['nameRequired', false], ['typeAllowed', false]])], ['modifies', new Map([// Has no documentation, but test example has curly brackets, and
106
111
  // "name" would be suggested rather than "namepath" based on example;
107
112
  // not sure if name is required
108
113
  ['typeAllowed', true]])], ['module', new Map([// Optional "name" and no curly brackets
@@ -135,7 +140,8 @@ const getDefaultTagStructureForMode = mode => {
135
140
  ['typeAllowed', true]])], ['protected', new Map([// Shows the signature with curly brackets but not in the example
136
141
  // "typeExpression"
137
142
  ['typeAllowed', isClosureOrPermissive]])], ['public', new Map([// Does not show a signature nor show curly brackets in the example
138
- ['typeAllowed', isClosureOrPermissive]])], ['returns', new Map([// Shows curly brackets in the signature and in the examples
143
+ ['typeAllowed', isClosureOrPermissive]])], ['requires', new Map([// <someModuleName>
144
+ ['nameRequired', true], ['typeAllowed', false]])], ['returns', new Map([// Shows curly brackets in the signature and in the examples
139
145
  ['typeAllowed', true]])], ['return', new Map([// Shows curly brackets in the signature and in the examples
140
146
  ['typeAllowed', true]])], ['see', new Map([// Signature allows for "namepath" or text, so user must configure to
141
147
  // 'namepath-referencing' to enforce checks
@@ -147,14 +153,20 @@ const getDefaultTagStructureForMode = mode => {
147
153
  // Not used with namepath in Closure/TypeScript, however
148
154
  ['nameContents', isJsdoc ? 'namepath-referencing' : false], ['typeRequired', isTypescriptOrClosure], // namepath
149
155
  ['typeOrNameRequired', isJsdoc]])], ['throws', new Map([// Shows curly brackets in the signature and in the examples
150
- ['typeAllowed', true]])], ['type', new Map([// Shows curly brackets in the doc signature and examples
156
+ ['typeAllowed', true]])], ['tutorial', new Map([// (a tutorial ID)
157
+ ['nameRequired', true], ['typeAllowed', false]])], ['type', new Map([// Shows curly brackets in the doc signature and examples
151
158
  // "typeName"
152
159
  ['typeRequired', true]])], ['typedef', new Map([// Seems to require a "namepath" in the signature (with no
153
160
  // counter-examples)
154
- ['nameContents', 'namepath-defining'], // "namepath"
155
- ['nameRequired', isJsdocTypescriptOrPermissive], // Has example showing curly brackets but not in doc signature
156
- ['typeAllowed', true], // "namepath"
157
- ['typeOrNameRequired', true]])], ['var', new Map([// Allows for "name"'s in signature, but indicated as optional
161
+ ['nameContents', 'namepath-defining'], // TypeScript may allow it to be dropped if followed by @property or @member;
162
+ // also shown as missing in Closure
163
+ // "namepath"
164
+ ['nameRequired', isJsdocOrPermissive], // Is not `typeRequired` for TypeScript because it gives an error:
165
+ // JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags.
166
+ // Has example showing curly brackets but not in doc signature
167
+ ['typeAllowed', true], // TypeScript may allow it to be dropped if followed by @property or @member
168
+ // "namepath"
169
+ ['typeOrNameRequired', !isTypescript]])], ['var', new Map([// Allows for "name"'s in signature, but indicated as optional
158
170
  ['nameContents', 'namepath-defining'], // Has example showing curly brackets but not in doc signature
159
171
  ['typeAllowed', true]])], ['yields', new Map([// Shows curly brackets in the signature and in the examples
160
172
  ['typeAllowed', true]])], ['yield', new Map([// Shows curly brackets in the signature and in the examples
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/getDefaultTagStructureForMode.js"],"names":["getDefaultTagStructureForMode","mode","isJsdoc","isClosure","isTypescript","isPermissive","isJsdocOrTypescript","isTypescriptOrClosure","isClosureOrPermissive","isJsdocTypescriptOrPermissive","Map"],"mappings":";;;;;;;AAAA,MAAMA,6BAA6B,GAAIC,IAAD,IAAU;AAC9C,QAAMC,OAAO,GAAGD,IAAI,KAAK,OAAzB;AACA,QAAME,SAAS,GAAGF,IAAI,KAAK,SAA3B;AACA,QAAMG,YAAY,GAAGH,IAAI,KAAK,YAA9B;AACA,QAAMI,YAAY,GAAGJ,IAAI,KAAK,YAA9B;AAEA,QAAMK,mBAAmB,GAAGJ,OAAO,IAAIE,YAAvC;AACA,QAAMG,qBAAqB,GAAGH,YAAY,IAAID,SAA9C;AACA,QAAMK,qBAAqB,GAAGL,SAAS,IAAIE,YAA3C;AACA,QAAMI,6BAA6B,GAAGH,mBAAmB,IAAID,YAA7D,CAT8C,CAW9C;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAO,IAAIK,GAAJ,CAAQ,CACb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACjB;AACE,GACE,cADF,EACkB,sBADlB,CAFe,EAMf;AACA,GACE,oBADF,EACwB,IADxB,CAPe,CAAR,CADX,CADa,EAeb,CACE,KADF,EACS,IAAIA,GAAJ,CAAQ,CACb,CACE,cADF,EACkB,mBADlB,CADa,EAKb;AACA,GACE,cADF,EACkB,IADlB,CANa,EAUb;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZa,CAAR,CADT,CAfa,EAkCb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,mBADlB,CADkB,EAKlB;AACA,GACE,cADF,EACkB,IADlB,CANkB,EAUlB;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZkB,CAAR,CADd,CAlCa,EAqDb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CACpB;AACE,GACE,cADF,EACkB,sBADlB,CAFkB,EAMlB;AACA,GACE,aADF,EACiB,IADjB,CAPkB,EAWlB;AACA,GACE,oBADF,EACwB,IADxB,CAZkB,CAAR,CADd,CArDa,EAwEb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACE,GACE,cADF,EACkB,sBADlB,CAHiB,EAOjB;AACA,GACE,oBADF,EACwB,IADxB,CARiB,CAAR,CADb,CAxEa,EAuFb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CACpB;AACA;AACE,GACE,cADF,EACkB,mBADlB,CAHkB,EAOlB;AACA,GACE,cADF,EACkB,IADlB,CARkB,CAAR,CADd,CAvFa,EAsGb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACjB;AACE,GACE,cADF,EACkB,mBADlB,CAFe,EAMf,CACE,aADF,EACiB,IADjB,CANe,CAAR,CADX,CAtGa,EAmHb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACjB;AACE,GACE,cADF,EACkB,mBADlB,CAFe,EAMf,CACE,aADF,EACiB,IADjB,CANe,CAAR,CADX,CAnHa,EA+Hb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CACpB;AACE,GACE,cADF,EACkB,mBADlB,CAFkB,EAMlB,CACE,aADF,EACiB,IADjB,CANkB,CAAR,CADd,CA/Ha,EA2Ib,CACE,aADF,EACiB,IAAIA,GAAJ,CAAQ,CACvB;AACE,GACE,cADF,EACkB,mBADlB,CAFqB,EAMrB,CACE,aADF,EACiB,IADjB,CANqB,CAAR,CADjB,CA3Ia,EAwJb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB,CACE,cADF,EACkBP,SADlB,CADgB,CAAR,CADZ,CAxJa,EAgKb,CACE,OADF,EACW,IAAIO,GAAJ,CAAQ,CACjB;AACE,GACE,cADF,EACkB,sBADlB,CAFe,CAAR,CADX,CAhKa,EAyKb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CAChB;AACE,GACE,aADF,EACiB,IADjB,CAFc,CAAR,CADV,CAzKa,EAkLb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACjB;AACE,GACE,cADF,EACkB,IADlB,CAFe,EAMf;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CATe,CAAR,CADX,CAlLa,EAkMb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACrB;AACE,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Q,CACtB;AACA;AACE,GACE,cADF,EACkB,IADlB,CAHoB,CAAR,CADhB,CApTa,EA8Tb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACjB;AACE,GACE,cADF,EACkB,sBADlB,CAFe,EAMf;AACA,GACE,oBADF,EACwB,IADxB,CAPe,CAAR,CADX,CA9Ta,EA4Ub,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACE,GACE,cADF,EACkB,sBADlB,CAHiB,CAAR,CADb,CA5Ua,EAsVb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAClB;AACE,GACE,cADF,EACkB,mBADlB,CAFgB,EAMhB;AACA,GACE,aADF,EACiB,IADjB,CAPgB,CAAR,CADZ,CAtVa,EAoWb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CACpB;AACA;AACE,GACE,cADF,EACkB,sBADlB,CAHkB,EAOlB;AACA,GACE,oBADF,EACwB,IADxB,CARkB,CAAR,CADd,CApWa,EAkXb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACrB;AACA;AACE,GACE,cADF,EACkB,sBADlB,CAHmB,EAOnB;AACA,GACE,oBADF,EACwB,IADxB,CARmB,CAAR,CADf,CAlXa,EAiYb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAClB;AACE,GACE,cADF,EACkB,mBADlB,CAFgB,CAAR,CADZ,CAjYa,EAyYb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACE,GACE,cADF,EACkB,sBADlB,CAHe,EAOf;AACA,GACE,oBADF,EACwB,IADxB,CARe,CAAR,CADX,CAzYa,EAwZb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACjB;AACE,GACE,cADF,EACkB,mBADlB,CAFe,CAAR,CADX,CAxZa,EAiab,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CACpB;AACA;AACA;AACE,GACE,aADF,EACiB,IADjB,CAJkB,CAAR,CADd,CAjaa,EA4ab,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA;AACE,GACE,cADF,EACkBR,OAAO,GAAG,mBAAH,GAAyB,MADlD,CAJgB,EAQhB;AACA,GACE,aADF,EACiB,IADjB,CATgB,CAAR,CADZ,CA5aa,EA4bb,CACE,MADF,EACU,IAAIQ,GAAJ,CAAQ,CAChB;AACA;AACE,GACE,cADF,EACkB,mBADlB,CAHc,EAOd;AACA,GACE,cADF,EACkB,IADlB,CARc,EAYd;AACA,GACE,oBADF,EACwB,IADxB,CAbc,CAAR,CADV,CA5ba,EAgdb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACrB;AACE,GACE,cADF,EACkB,mBADlB,CAFmB,EAMnB;AACA,GACE,aADF,EACiB,IADjB,CAPmB,CAAR,CADf,CAhda,EA6db,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACE,GACE,aADF,EACiBF,qBADjB,CAHiB,CAAR,CADb,CA7da,EAueb,CACE,OADF,EACW,IAAIE,GAAJ,CAAQ,CACf,CACE,cADF,EACkB,mBADlB,CADe,EAKf;AACA;AACA;AACA;AACA,GACE,cADF,EACkB,IADlB,CATe,EAaf;AACA;AACA,GACE,aADF,EACiB,IADjB,CAfe,CAAR,CADX,CAvea,EA6fb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACE,GACE,aADF,EACiBF,qBADjB,CAHiB,CAAR,CADb,CA7fa,EAugBb,CACE,MADF,EACU,IAAIE,GAAJ,CAAQ,CACd,CACE,cADF,EACkB,mBADlB,CADc,EAKd;AACA,GACE,cADF,EACkB,IADlB,CANc,EAUd;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZc,CAAR,CADV,CAvgBa,EA0hBb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,mBADlB,CADkB,EAKlB;AACA;AACA,GACE,cADF,EACkB,IADlB,CAPkB,EAWlB;AACA;AACA,GACE,aADF,EACiB,IADjB,CA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GAAJ,CAAQ,CAClB;AACE,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CAlpBa,EA2pBb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CAChB;AACA;AACE,GACE,cADF,EACkB,IADlB,CAHc,CAAR,CADV,CA3pBa,EAqqBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACE,GACE,cADF,EACkB,mBADlB,CAHiB,EAOjB;AACA,GACE,cADF,EACkBD,6BADlB,CARiB,EAYjB;AACA,GACE,aADF,EACiB,IADjB,CAbiB,EAiBjB;AACA,GACE,oBADF,EACwB,IADxB,CAlBiB,CAAR,CADb,CArqBa,EA8rBb,CACE,KADF,EACS,IAAIC,GAAJ,CAAQ,CACf;AACE,GACE,cADF,EACkB,mBADlB,CAFa,EAMb;AACA,GACE,aADF,EACiB,IADjB,CAPa,CAAR,CADT,CA9rBa,EA4sBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAClB;AACE,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CA5sBa,EAotBb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACjB;AACE,GACE,aADF,EACiB,IADjB,CAFe,CAAR,CADX,CAptBa,CAAR,CAAP;AA6tBD,CAtwBD;;eAwwBeV,6B","sourcesContent":["const getDefaultTagStructureForMode = (mode) => {\n const isJsdoc = mode === 'jsdoc';\n const isClosure = mode === 'closure';\n const isTypescript = mode === 'typescript';\n const isPermissive = mode === 'permissive';\n\n const isJsdocOrTypescript = isJsdoc || isTypescript;\n const isTypescriptOrClosure = isTypescript || isClosure;\n const isClosureOrPermissive = isClosure || isPermissive;\n const isJsdocTypescriptOrPermissive = isJsdocOrTypescript || isPermissive;\n\n // Properties:\n // `nameContents` - 'namepath-referencing'|'namepath-defining'|'text'|false\n // `typeAllowed` - boolean\n // `nameRequired` - boolean\n // `typeRequired` - boolean\n // `typeOrNameRequired` - boolean\n\n // All of `typeAllowed` have a signature with \"type\" except for\n // `augments`/`extends` (\"namepath\")\n // `param`/`arg`/`argument` (no signature)\n // `property`/`prop` (no signature)\n // `modifies` (undocumented)\n\n // None of the `nameContents: 'namepath-defining'` show as having curly\n // brackets for their name/namepath\n\n // Among `namepath-defining` and `namepath-referencing`, these do not seem\n // to allow curly brackets in their doc signature or examples (`modifies`\n // references namepaths within its type brackets and `param` is\n // name-defining but not namepath-defining, so not part of these groups)\n\n // Todo: Should support special processing for \"name\" as distinct from\n // \"namepath\" (e.g., param can't define a namepath)\n\n // Once checking inline tags:\n // Todo: Re: `typeOrNameRequired`, `@link` (or @linkcode/@linkplain) seems\n // to require a namepath OR URL and might be checked as such.\n // Todo: Should support a `tutorialID` type (for `@tutorial` block and\n // inline)\n\n return new Map([\n [\n 'alias', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'arg', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'argument', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'augments', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'borrows', new Map([\n // `borrows` has a different format, however, so needs special parsing;\n // seems to require both, and as \"namepath\"'s\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'callback', new Map([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n ]),\n ],\n\n [\n 'class', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'const', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'constant', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'constructor', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'define', new Map([\n [\n 'typeRequired', isClosure,\n ],\n ]),\n ],\n\n [\n 'emits', new Map([\n // Signature seems to require a \"name\" (of an event) and no counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n ]),\n ],\n\n [\n 'enum', new Map([\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'event', new Map([\n // The doc signature of `event` seems to require a \"name\"\n [\n 'nameRequired', true,\n ],\n\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'exception', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'export', new Map([\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'extends', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', isTypescriptOrClosure || isPermissive,\n ],\n ]),\n ],\n\n [\n 'external', new Map([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // \"name\" (and a special syntax for the `external` name)\n [\n 'nameRequired', true,\n ],\n ]),\n ],\n\n [\n 'fires', new Map([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n ]),\n ],\n\n [\n 'function', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n [\n 'func', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'host', new Map([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // See `external`\n [\n 'nameRequired', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'interface', new Map([\n // Allows for \"name\" in signature, but indicates as optional\n [\n 'nameContents',\n isJsdocTypescriptOrPermissive ? 'namepath-defining' : false,\n ],\n ]),\n ],\n\n [\n 'implements', new Map([\n // Shows curly brackets in the doc signature and examples\n // \"typeExpression\"\n [\n 'typeRequired', true,\n ],\n ]),\n ],\n\n [\n 'lends', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'listens', new Map([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n ]),\n ],\n\n [\n 'member', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'memberof', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n [\n 'memberof!', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'method', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n [\n 'mixes', new Map([\n // Signature seems to require a \"OtherObjectPath\" with no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"OtherObjectPath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'mixin', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'modifies', new Map([\n // Has no documentation, but test example has curly brackets, and\n // \"name\" would be suggested rather than \"namepath\" based on example;\n // not sure if name is required\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'module', new Map([\n // Optional \"name\" and no curly brackets\n // this block impacts `no-undefined-types` and `valid-types` (search for\n // \"isNamepathDefiningTag|tagMightHaveNamepath|tagMightHaveEitherTypeOrNamePosition\")\n [\n 'nameContents', isJsdoc ? 'namepath-defining' : 'text',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'name', new Map([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'namespace', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'package', new Map([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'param', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Though no signature provided requiring, per\n // https://jsdoc.app/tags-param.html:\n // \"The @param tag requires you to specify the name of the parameter you\n // are documenting.\"\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'private', new Map([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'prop', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // See `property`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'property', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // No docs indicate required, but since parallel to `param`, we treat as\n // such:\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'protected', new Map([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'public', new Map([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'returns', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'return', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'see', new Map([\n // Signature allows for \"namepath\" or text, so user must configure to\n // 'namepath-referencing' to enforce checks\n [\n 'nameContents', 'text',\n ],\n ]),\n ],\n\n [\n 'static', new Map([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'suppress', new Map([\n [\n 'nameContents', !isClosure,\n ],\n [\n 'typeRequired', isClosure,\n ],\n ]),\n ],\n\n [\n 'template', new Map([\n [\n 'nameContents', isJsdoc ? 'text' : 'namepath-referencing',\n ],\n\n // Though defines `nameContents: 'namepath-defining'` in a sense, it is\n // not parseable in the same way for template (e.g., allowing commas),\n // so not adding\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n ]),\n ],\n\n [\n 'this', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n // Not used with namepath in Closure/TypeScript, however\n [\n 'nameContents', isJsdoc ? 'namepath-referencing' : false,\n ],\n\n [\n 'typeRequired', isTypescriptOrClosure,\n ],\n\n // namepath\n [\n 'typeOrNameRequired', isJsdoc,\n ],\n ]),\n ],\n\n [\n 'throws', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'type', new Map([\n // Shows curly brackets in the doc signature and examples\n // \"typeName\"\n [\n 'typeRequired', true,\n ],\n ]),\n ],\n\n [\n 'typedef', new Map([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', isJsdocTypescriptOrPermissive,\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'var', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'yields', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'yield', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n ]);\n};\n\nexport default getDefaultTagStructureForMode;\n"],"file":"getDefaultTagStructureForMode.js"}
1
+ {"version":3,"sources":["../src/getDefaultTagStructureForMode.js"],"names":["getDefaultTagStructureForMode","mode","isJsdoc","isClosure","isTypescript","isPermissive","isJsdocOrPermissive","isJsdocOrTypescript","isTypescriptOrClosure","isClosureOrPermissive","isJsdocTypescriptOrPermissive","Map"],"mappings":";;;;;;;AAAA,MAAMA,6BAA6B,GAAIC,IAAD,IAAU;AAC9C,QAAMC,OAAO,GAAGD,IAAI,KAAK,OAAzB;AACA,QAAME,SAAS,GAAGF,IAAI,KAAK,SAA3B;AACA,QAAMG,YAAY,GAAGH,IAAI,KAAK,YAA9B;AACA,QAAMI,YAAY,GAAGJ,IAAI,KAAK,YAA9B;AAEA,QAAMK,mBAAmB,GAAGJ,OAAO,IAAIG,YAAvC;AACA,QAAME,mBAAmB,GAAGL,OAAO,IAAIE,YAAvC;AACA,QAAMI,qBAAqB,GAAGJ,YAAY,IAAID,SAA9C;AACA,QAAMM,qBAAqB,GAAGN,SAAS,IAAIE,YAA3C;AACA,QAAMK,6BAA6B,GAAGH,mBAAmB,IAAIF,YAA7D,CAV8C,CAY9C;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAO,IAAIM,GAAJ,CAAQ,CACb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,sBADlB,CAFe,EAMf;AACA,GACE,oBADF,EACwB,IADxB,CAPe,CAAR,CADX,CADa,EAeb,CACE,KADF,EACS,IAAIA,GAAJ,CAAQ,CACb,CACE,cADF,EACkB,mBADlB,CADa,EAKb;AACA,GACE,cADF,EACkB,IADlB,CANa,EAUb;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZa,CAAR,CADT,CAfa,EAkCb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,mBADlB,CADkB,EAKlB;AACA,GACE,cADF,EACkB,IADlB,CANkB,EAUlB;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZkB,CAAR,CADd,CAlCa,EAqDb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,sBADlB,CAFkB,EAMlB;AACA,GACE,aADF,EACiB,IADjB,CAPkB,EAWlB;AACA,GACE,oBADF,EACwB,IADxB,CAZkB,CAAR,CADd,CArDa,EAwEb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHiB,EAOjB;AACA,GACE,oBADF,EACwB,IADxB,CARiB,CAAR,CADb,CAxEa,EAuFb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAJkB,EAQlB;AACA,GACE,cADF,EACkB,IADlB,CATkB,CAAR,CADd,CAvFa,EAuGb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,EAMf;AACA,GACE,aADF,EACiB,IADjB,CAPe,EAWf,CACE,aADF,EACiB,IADjB,CAXe,CAAR,CADX,CAvGa,EAyHb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,EAMf,CACE,aADF,EACiB,IADjB,CANe,CAAR,CADX,CAzHa,EAqIb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,mBADlB,CAFkB,EAMlB,CACE,aADF,EACiB,IADjB,CANkB,CAAR,CADd,CArIa,EAiJb,CACE,aADF,EACiB,IAAIA,GAAJ,CAAQ,CACrB;AACA,GACE,cADF,EACkB,mBADlB,CAFqB,EAMrB,CACE,aADF,EACiB,IADjB,CANqB,CAAR,CADjB,CAjJa,EA8Jb,CACE,YADF,EACgB,IAAIA,GAAJ,CAAQ,CACpB;AACA,GACE,cADF,EACkB,mBADlB,CAFoB,EAMpB,CACE,cADF,EACkB,KADlB,CANoB,EAUpB,CACE,aADF,EACiB,KADjB,CAVoB,CAAR,CADhB,CA9Ja,EA+Kb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB,CACE,cADF,EACkBR,SADlB,CADgB,CAAR,CADZ,CA/Ka,EAuLb,CACE,OADF,EACW,IAAIQ,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,sBADlB,CAFe,EAMf,CACE,cADF,EACkB,IADlB,CANe,EAUf,CACE,aADF,EACiB,KADjB,CAVe,CAAR,CADX,CAvLa,EAwMb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA,GACE,aADF,EACiB,IADjB,CAFc,CAAR,CADV,CAxMa,EAiNb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,IADlB,CAFe,EAMf;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CATe,CAAR,CADX,CAjNa,EAiOb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA,GACE,aADF,EACiB,IADjB,CAFmB,CAAR,CADf,CAjOa,EA0Ob;AACA,GACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB,CACE,aADF,EACiBF,qBADjB,CADgB,CAAR,CADZ,CA3Oa,EAmPb,CACE,SADF,EACa,IAAIE,GAAJ,CAAQ,CACjB,CACE,cADF,EACkB,mBADlB,CADiB,EAKjB,CACE,cADF,EACkBT,OADlB,CALiB,EASjB,CACE,aADF,EACiBO,qBADjB,CATiB,CAAR,CADb,CAnPa,EAmQb,CACE,SADF,EACa,IAAIE,GAAJ,CAAQ,CACjB;AACA,GACE,cADF,EACkB,sBADlB,CAFiB,EAMjB;AACA,GACE,aADF,EACiBH,qBAAqB,IAAIH,YAD1C,CAPiB,EAWjB,CACE,cADF,EACkBH,OADlB,CAXiB,EAejB;AACA,GACE,oBADF,EACwBM,qBAAqB,IAAIH,YADjD,CAhBiB,CAAR,CADb,CAnQa,EA0Rb,CACE,UADF,EACc,IAAIM,GAAJ,CAAQ,CAClB;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAJkB,EAQlB;AACA,GACE,cADF,EACkB,IADlB,CATkB,EAalB,CACE,aADF,EACiB,KADjB,CAbkB,CAAR,CADd,CA1Ra,EA8Sb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHe,EAOf,CACE,cADF,EACkB,IADlB,CAPe,EAWf,CACE,aADF,EACiB,KADjB,CAXe,CAAR,CADX,CA9Sa,EAgUb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,mBADlB,CAFkB,EAMlB,CACE,cADF,EACkB,KADlB,CANkB,EAUlB,CACE,aADF,EACiB,KADjB,CAVkB,CAAR,CADd,CAhUa,EAgVb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA,GACE,cADF,EACkB,mBADlB,CAFc,CAAR,CADV,CAhVa,EAyVb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAJc,EAQd;AACA,GACE,cADF,EACkB,IADlB,CATc,EAad,CACE,aADF,EACiB,KADjB,CAbc,CAAR,CADV,CAzVa,EA6Wb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA,GACE,cADF,EAEED,6BAA6B,GAAG,mBAAH,GAAyB,KAFxD,CAFmB,EAOnB;AACA,GACE,aADF,EACiBP,SADjB,CARmB,EAYnB,CACE,aADF,EACiB,KADjB,CAZmB,CAAR,CADf,CA7Wa,EAgYb,CACE,YADF,EACgB,IAAIQ,GAAJ,CAAQ,CACpB;AACA;AACA,GACE,cADF,EACkB,IADlB,CAHoB,CAAR,CADhB,CAhYa,EA0Yb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,sBADlB,CAFe,EAMf;AACA,GACE,oBADF,EACwB,IADxB,CAPe,CAAR,CADX,CA1Ya,EAwZb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHiB,EAOjB,CACE,cADF,EACkB,IADlB,CAPiB,EAWjB,CACE,aADF,EACiB,KADjB,CAXiB,CAAR,CADb,CAxZa,EA0ab,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,cADF,EACkB,mBADlB,CAFgB,EAMhB;AACA,GACE,aADF,EACiB,IADjB,CAPgB,CAAR,CADZ,CA1aa,EAwbb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHkB,EAOlB;AACA,GACE,oBADF,EACwB,IADxB,CARkB,CAAR,CADd,CAxba,EAscb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHmB,EAOnB;AACA,GACE,oBADF,EACwB,IADxB,CARmB,CAAR,CADf,CAtca,EAqdb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,cADF,EACkB,mBADlB,CAFgB,CAAR,CADZ,CArda,EA6db,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHe,EAOf;AACA,GACE,oBADF,EACwB,IADxB,CARe,CAAR,CADX,CA7da,EA4eb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,EAMf,CACE,cADF,EACkB,KADlB,CANe,EAUf,CACE,aADF,EACiB,KADjB,CAVe,CAAR,CADX,CA5ea,EA6fb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA;AACA,GACE,aADF,EACiB,IADjB,CAJkB,CAAR,CADd,CA7fa,EAwgBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA;AACA;AACA,GACE,cADF,EACkBT,OAAO,GAAG,mBAAH,GAAyB,MADlD,CAJgB,EAQhB;AACA,GACE,aADF,EACiB,IADjB,CATgB,CAAR,CADZ,CAxgBa,EAwhBb,CACE,MADF,EACU,IAAIS,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAHc,EAOd;AACA,GACE,cADF,EACkB,IADlB,CARc,EAYd;AACA,GACE,oBADF,EACwB,IADxB,CAbc,CAAR,CADV,CAxhBa,EA4iBb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA,GACE,cADF,EACkB,mBADlB,CAFmB,EAMnB;AACA,GACE,aADF,EACiB,IADjB,CAPmB,CAAR,CADf,CA5iBa,EAyjBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHiB,CAAR,CADb,CAzjBa,EAmkBb,CACE,OADF,EACW,IAAIE,GAAJ,CAAQ,CACf,CACE,cADF,EACkB,mBADlB,CADe,EAKf;AACA;AACA;AACA;AACA,GACE,cADF,EACkB,IADlB,CATe,EAaf;AACA;AACA,GACE,aADF,EACiB,IADjB,CAfe,CAAR,CADX,CAnkBa,EAylBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHiB,CAAR,CADb,CAzlBa,EAmmBb,CACE,MADF,EACU,IAAIE,GAAJ,CAAQ,CACd,CACE,cADF,EACkB,mBADlB,CADc,EAKd;AACA,GACE,cADF,EACkB,IADlB,CANc,EAUd;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZc,CAAR,CADV,CAnmBa,EAsnBb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,mBADlB,CADkB,EAKlB;AACA;AACA,GACE,cADF,EACkB,IADlB,CAPkB,EAWlB;AACA;AACA,GACE,aADF,EACiB,IADjB,CAbkB,CAAR,CADd,CAtnBa,EA0oBb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHmB,CAAR,CADf,CA1oBa,EAopBb,CACE,QADF,EACY,IAAIE,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiBF,qBADjB,CAFgB,CAAR,CADZ,CAppBa,EA6pBb,CACE,UADF,EACc,IAAIE,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,IADlB,CAFkB,EAMlB,CACE,aADF,EACiB,KADjB,CANkB,CAAR,CADd,CA7pBa,EA0qBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA,GACE,aADF,EACiB,IADjB,CAFiB,CAAR,CADb,CA1qBa,EAkrBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CAlrBa,EA2rBb,CACE,KADF,EACS,IAAIA,GAAJ,CAAQ,CACb;AACA;AACA,GACE,cADF,EACkB,MADlB,CAHa,CAAR,CADT,CA3rBa,EAqsBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiBF,qBADjB,CAFgB,CAAR,CADZ,CArsBa,EA8sBb,CACE,UADF,EACc,IAAIE,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,CAACR,SADnB,CADkB,EAIlB,CACE,cADF,EACkBA,SADlB,CAJkB,CAAR,CADd,CA9sBa,EAytBb,CACE,UADF,EACc,IAAIQ,GAAJ,CAAQ,CAClB,CACE,cADF,EACkBT,OAAO,GAAG,MAAH,GAAY,sBADrC,CADkB,EAKlB;AACA;AACA;AACA,GACE,aADF,EACiBM,qBAAqB,IAAIH,YAD1C,CARkB,CAAR,CADd,CAztBa,EAwuBb,CACE,MADF,EACU,IAAIM,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkBT,OAAO,GAAG,sBAAH,GAA4B,KADrD,CAHc,EAOd,CACE,cADF,EACkBM,qBADlB,CAPc,EAWd;AACA,GACE,oBADF,EACwBN,OADxB,CAZc,CAAR,CADV,CAxuBa,EA2vBb,CACE,QADF,EACY,IAAIS,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CA3vBa,EAowBb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,IADlB,CAFkB,EAMlB,CACE,aADF,EACiB,KADjB,CANkB,CAAR,CADd,CApwBa,EAixBb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkB,IADlB,CAHc,CAAR,CADV,CAjxBa,EA2xBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAHiB,EAOjB;AACA;AACA;AACA,GACE,cADF,EACkBL,mBADlB,CAViB,EAcjB;AACA;AAEA;AACA,GACE,aADF,EACiB,IADjB,CAlBiB,EAsBjB;AACA;AACA,GACE,oBADF,EACwB,CAACF,YADzB,CAxBiB,CAAR,CADb,CA3xBa,EA0zBb,CACE,KADF,EACS,IAAIO,GAAJ,CAAQ,CACb;AACA,GACE,cADF,EACkB,mBADlB,CAFa,EAMb;AACA,GACE,aADF,EACiB,IADjB,CAPa,CAAR,CADT,CA1zBa,EAw0Bb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CAx0Ba,EAg1Bb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,aADF,EACiB,IADjB,CAFe,CAAR,CADX,CAh1Ba,CAAR,CAAP;AAy1BD,CAn4BD;;eAq4BeX,6B","sourcesContent":["const getDefaultTagStructureForMode = (mode) => {\n const isJsdoc = mode === 'jsdoc';\n const isClosure = mode === 'closure';\n const isTypescript = mode === 'typescript';\n const isPermissive = mode === 'permissive';\n\n const isJsdocOrPermissive = isJsdoc || isPermissive;\n const isJsdocOrTypescript = isJsdoc || isTypescript;\n const isTypescriptOrClosure = isTypescript || isClosure;\n const isClosureOrPermissive = isClosure || isPermissive;\n const isJsdocTypescriptOrPermissive = isJsdocOrTypescript || isPermissive;\n\n // Properties:\n // `nameContents` - 'namepath-referencing'|'namepath-defining'|'text'|false\n // `typeAllowed` - boolean\n // `nameRequired` - boolean\n // `typeRequired` - boolean\n // `typeOrNameRequired` - boolean\n\n // All of `typeAllowed` have a signature with \"type\" except for\n // `augments`/`extends` (\"namepath\")\n // `param`/`arg`/`argument` (no signature)\n // `property`/`prop` (no signature)\n // `modifies` (undocumented)\n\n // None of the `nameContents: 'namepath-defining'` show as having curly\n // brackets for their name/namepath\n\n // Among `namepath-defining` and `namepath-referencing`, these do not seem\n // to allow curly brackets in their doc signature or examples (`modifies`\n // references namepaths within its type brackets and `param` is\n // name-defining but not namepath-defining, so not part of these groups)\n\n // Todo: Should support special processing for \"name\" as distinct from\n // \"namepath\" (e.g., param can't define a namepath)\n\n // Once checking inline tags:\n // Todo: Re: `typeOrNameRequired`, `@link` (or @linkcode/@linkplain) seems\n // to require a namepath OR URL and might be checked as such.\n // Todo: Should support a `tutorialID` type (for `@tutorial` block and\n // inline)\n\n return new Map([\n [\n 'alias', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'arg', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'argument', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'augments', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'borrows', new Map([\n // `borrows` has a different format, however, so needs special parsing;\n // seems to require both, and as \"namepath\"'s\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'callback', new Map([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples); TypeScript does not enforce but seems\n // problematic as not attached so presumably not useable without it\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n ]),\n ],\n\n [\n 'class', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', true,\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'const', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'constant', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'constructor', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'constructs', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'define', new Map([\n [\n 'typeRequired', isClosure,\n ],\n ]),\n ],\n\n [\n 'emits', new Map([\n // Signature seems to require a \"name\" (of an event) and no counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'enum', new Map([\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'event', new Map([\n // The doc signature of `event` seems to require a \"name\"\n [\n 'nameRequired', true,\n ],\n\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'exception', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n // Closure\n [\n 'export', new Map([\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'exports', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'extends', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', isTypescriptOrClosure || isPermissive,\n ],\n ]),\n ],\n\n [\n 'external', new Map([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // \"name\" (and a special syntax for the `external` name)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'fires', new Map([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'function', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n [\n 'func', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'host', new Map([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // See `external`\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'interface', new Map([\n // Allows for \"name\" in signature, but indicates as optional\n [\n 'nameContents',\n isJsdocTypescriptOrPermissive ? 'namepath-defining' : false,\n ],\n\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', isClosure,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'implements', new Map([\n // Shows curly brackets in the doc signature and examples\n // \"typeExpression\"\n [\n 'typeRequired', true,\n ],\n ]),\n ],\n\n [\n 'lends', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'listens', new Map([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'member', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'memberof', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n [\n 'memberof!', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'method', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n [\n 'mixes', new Map([\n // Signature seems to require a \"OtherObjectPath\" with no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"OtherObjectPath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'mixin', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'modifies', new Map([\n // Has no documentation, but test example has curly brackets, and\n // \"name\" would be suggested rather than \"namepath\" based on example;\n // not sure if name is required\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'module', new Map([\n // Optional \"name\" and no curly brackets\n // this block impacts `no-undefined-types` and `valid-types` (search for\n // \"isNamepathDefiningTag|tagMightHaveNamepath|tagMightHaveEitherTypeOrNamePosition\")\n [\n 'nameContents', isJsdoc ? 'namepath-defining' : 'text',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'name', new Map([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'namespace', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'package', new Map([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'param', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Though no signature provided requiring, per\n // https://jsdoc.app/tags-param.html:\n // \"The @param tag requires you to specify the name of the parameter you\n // are documenting.\"\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'private', new Map([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'prop', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // See `property`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'property', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // No docs indicate required, but since parallel to `param`, we treat as\n // such:\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'protected', new Map([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'public', new Map([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'requires', new Map([\n // <someModuleName>\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'returns', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'return', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'see', new Map([\n // Signature allows for \"namepath\" or text, so user must configure to\n // 'namepath-referencing' to enforce checks\n [\n 'nameContents', 'text',\n ],\n ]),\n ],\n\n [\n 'static', new Map([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'suppress', new Map([\n [\n 'nameContents', !isClosure,\n ],\n [\n 'typeRequired', isClosure,\n ],\n ]),\n ],\n\n [\n 'template', new Map([\n [\n 'nameContents', isJsdoc ? 'text' : 'namepath-referencing',\n ],\n\n // Though defines `nameContents: 'namepath-defining'` in a sense, it is\n // not parseable in the same way for template (e.g., allowing commas),\n // so not adding\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n ]),\n ],\n\n [\n 'this', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n // Not used with namepath in Closure/TypeScript, however\n [\n 'nameContents', isJsdoc ? 'namepath-referencing' : false,\n ],\n\n [\n 'typeRequired', isTypescriptOrClosure,\n ],\n\n // namepath\n [\n 'typeOrNameRequired', isJsdoc,\n ],\n ]),\n ],\n\n [\n 'throws', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'tutorial', new Map([\n // (a tutorial ID)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'type', new Map([\n // Shows curly brackets in the doc signature and examples\n // \"typeName\"\n [\n 'typeRequired', true,\n ],\n ]),\n ],\n\n [\n 'typedef', new Map([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // TypeScript may allow it to be dropped if followed by @property or @member;\n // also shown as missing in Closure\n // \"namepath\"\n [\n 'nameRequired', isJsdocOrPermissive,\n ],\n\n // Is not `typeRequired` for TypeScript because it gives an error:\n // JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags.\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n\n // TypeScript may allow it to be dropped if followed by @property or @member\n // \"namepath\"\n [\n 'typeOrNameRequired', !isTypescript,\n ],\n ]),\n ],\n\n [\n 'var', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'yields', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'yield', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n ]);\n};\n\nexport default getDefaultTagStructureForMode;\n"],"file":"getDefaultTagStructureForMode.js"}
@@ -13,6 +13,8 @@ var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
+ const allowedKinds = new Set(['class', 'constant', 'event', 'external', 'file', 'function', 'member', 'mixin', 'module', 'namespace', 'typedef']);
17
+
16
18
  var _default = (0, _iterateJsdoc.default)(({
17
19
  utils,
18
20
  report,
@@ -34,6 +36,15 @@ var _default = (0, _iterateJsdoc.default)(({
34
36
  report(`Invalid JSDoc @${targetTagName}: "${utils.getTagDescription(jsdocParameter)}".`, null, jsdocParameter);
35
37
  }
36
38
  });
39
+ utils.forEachPreferredTag('kind', (jsdocParameter, targetTagName) => {
40
+ const kind = utils.getTagDescription(jsdocParameter).trim();
41
+
42
+ if (!kind) {
43
+ report(`Missing JSDoc @${targetTagName} value.`, null, jsdocParameter);
44
+ } else if (!allowedKinds.has(kind)) {
45
+ report(`Invalid JSDoc @${targetTagName}: "${utils.getTagDescription(jsdocParameter)}"; ` + `must be one of: ${[...allowedKinds].join(', ')}.`, null, jsdocParameter);
46
+ }
47
+ });
37
48
 
38
49
  if (numericOnlyVariation) {
39
50
  utils.forEachPreferredTag('variation', (jsdocParameter, targetTagName) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/rules/checkValues.js"],"names":["utils","report","context","options","allowedLicenses","allowedAuthors","numericOnlyVariation","licensePattern","forEachPreferredTag","jsdocParameter","targetTagName","version","getTagDescription","trim","semver","valid","variation","Number","isInteger","licenseRegex","getRegexFromString","match","license","includes","join","author","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","items","type","anyOf"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;eAEe,2BAAa,CAAC;AAC3BA,EAAAA,KAD2B;AAE3BC,EAAAA,MAF2B;AAG3BC,EAAAA;AAH2B,CAAD,KAItB;AACJ,QAAMC,OAAO,GAAGD,OAAO,CAACC,OAAR,CAAgB,CAAhB,KAAsB,EAAtC;AACA,QAAM;AACJC,IAAAA,eAAe,GAAG,IADd;AAEJC,IAAAA,cAAc,GAAG,IAFb;AAGJC,IAAAA,oBAAoB,GAAG,KAHnB;AAIJC,IAAAA,cAAc,GAAG;AAJb,MAKFJ,OALJ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AAA,IAAI,EAAE;AAJR,WADK,EAOL;AACEA,YAAAA,IAAI,EAAE;AADR,WAPK;AADQ,SAPP;AAoBV5B,QAAAA,cAAc,EAAE;AACd4B,UAAAA,IAAI,EAAE;AADQ,SApBN;AAuBV7B,QAAAA,oBAAoB,EAAE;AACpB6B,UAAAA,IAAI,EAAE;AADc;AAvBZ,OAFd;AA6BEA,MAAAA,IAAI,EAAE;AA7BR,KADM,CALJ;AAsCJA,IAAAA,IAAI,EAAE;AAtCF;AAFL,CAlHY,C","sourcesContent":["import semver from 'semver';\nimport spdxExpressionParse from 'spdx-expression-parse';\nimport iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n utils,\n report,\n context,\n}) => {\n const options = context.options[0] || {};\n const {\n allowedLicenses = null,\n allowedAuthors = null,\n numericOnlyVariation = false,\n licensePattern = '/([^\\n\\r]*)/gu',\n } = options;\n\n utils.forEachPreferredTag('version', (jsdocParameter, targetTagName) => {\n const version = utils.getTagDescription(jsdocParameter).trim();\n if (!version) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (!semver.valid(version)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\".`,\n null,\n jsdocParameter,\n );\n }\n });\n if (numericOnlyVariation) {\n utils.forEachPreferredTag('variation', (jsdocParameter, targetTagName) => {\n const variation = utils.getTagDescription(jsdocParameter).trim();\n if (!variation) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (\n !Number.isInteger(Number(variation)) ||\n Number(variation) <= 0\n ) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\".`,\n null,\n jsdocParameter,\n );\n }\n });\n }\n\n utils.forEachPreferredTag('since', (jsdocParameter, targetTagName) => {\n const version = utils.getTagDescription(jsdocParameter).trim();\n if (!version) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (!semver.valid(version)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\".`,\n null,\n jsdocParameter,\n );\n }\n });\n utils.forEachPreferredTag('license', (jsdocParameter, targetTagName) => {\n const licenseRegex = utils.getRegexFromString(licensePattern, 'g');\n const match = utils.getTagDescription(jsdocParameter).match(licenseRegex);\n const license = match && match[1] || match[0];\n if (!license.trim()) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (allowedLicenses) {\n if (allowedLicenses !== true && !allowedLicenses.includes(license)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${license}\"; expected one of ${allowedLicenses.join(', ')}.`,\n null,\n jsdocParameter,\n );\n }\n } else {\n try {\n spdxExpressionParse(license);\n } catch {\n report(\n `Invalid JSDoc @${targetTagName}: \"${license}\"; expected SPDX expression: https://spdx.org/licenses/.`,\n null,\n jsdocParameter,\n );\n }\n }\n });\n\n utils.forEachPreferredTag('author', (jsdocParameter, targetTagName) => {\n const author = utils.getTagDescription(jsdocParameter).trim();\n if (!author) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (allowedAuthors && !allowedAuthors.includes(author)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\"; expected one of ${allowedAuthors.join(', ')}.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'This rule checks the values for a handful of tags: `@version`, `@since`, `@license` and `@author`.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-values',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowedAuthors: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n allowedLicenses: {\n anyOf: [\n {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n {\n type: 'boolean',\n },\n ],\n },\n licensePattern: {\n type: 'string',\n },\n numericOnlyVariation: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"file":"checkValues.js"}
1
+ {"version":3,"sources":["../../src/rules/checkValues.js"],"names":["allowedKinds","Set","utils","report","context","options","allowedLicenses","allowedAuthors","numericOnlyVariation","licensePattern","forEachPreferredTag","jsdocParameter","targetTagName","version","getTagDescription","trim","semver","valid","kind","has","join","variation","Number","isInteger","licenseRegex","getRegexFromString","match","license","includes","author","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","items","type","anyOf"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,IAAIC,GAAJ,CAAQ,CAC3B,OAD2B,EAE3B,UAF2B,EAG3B,OAH2B,EAI3B,UAJ2B,EAK3B,MAL2B,EAM3B,UAN2B,EAO3B,QAP2B,EAQ3B,OAR2B,EAS3B,QAT2B,EAU3B,WAV2B,EAW3B,SAX2B,CAAR,CAArB;;eAce,2BAAa,CAAC;AAC3BC,EAAAA,KAD2B;AAE3BC,EAAAA,MAF2B;AAG3BC,EAAAA;AAH2B,CAAD,KAItB;AACJ,QAAMC,OAAO,GAAGD,OAAO,CAACC,OAAR,CAAgB,CAAhB,KAAsB,EAAtC;AACA,QAAM;AACJC,IAAAA,eAAe,GAAG,IADd;AAEJC,IAAAA,cAAc,GAAG,IAFb;AAGJC,IAAAA,oBAAoB,GAAG,KAHnB;AAIJC,IAAAA,cAAc,GAAG;AAJb,MAKFJ,OALJ;AAOAH,EAAAA,KAAK,CAACQ,mBAAN,CAA0B,SAA1B,EAAqC,CAACC,cAAD,EAAiBC,aAAjB,KAAmC;AACtE,UAAMC,OAAO,GAAGX,KAAK,CAACY,iBAAN,CAAwBH,cAAxB,EAAwCI,IAAxC,EAAhB;;AACA,QAAI,CAACF,OAAL,EAAc;AACZV,MAAAA,MAAM,CACH,kBAAiBS,aAAc,SAD5B,EAEJ,IAFI,EAGJD,cAHI,CAAN;AAKD,KAND,MA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KADxB;AAEEC,MAAAA,UAAU,EAAE;AACV9B,QAAAA,cAAc,EAAE;AACd+B,UAAAA,KAAK,EAAE;AACLC,YAAAA,IAAI,EAAE;AADD,WADO;AAIdA,UAAAA,IAAI,EAAE;AAJQ,SADN;AAOVjC,QAAAA,eAAe,EAAE;AACfkC,UAAAA,KAAK,EAAE,CACL;AACEF,YAAAA,KAAK,EAAE;AACLC,cAAAA,IAAI,EAAE;AADD,aADT;AAIEA,YAAAA,IAAI,EAAE;AAJR,WADK,EAOL;AACEA,YAAAA,IAAI,EAAE;AADR,WAPK;AADQ,SAPP;AAoBV9B,QAAAA,cAAc,EAAE;AACd8B,UAAAA,IAAI,EAAE;AADQ,SApBN;AAuBV/B,QAAAA,oBAAoB,EAAE;AACpB+B,UAAAA,IAAI,EAAE;AADc;AAvBZ,OAFd;AA6BEA,MAAAA,IAAI,EAAE;AA7BR,KADM,CALJ;AAsCJA,IAAAA,IAAI,EAAE;AAtCF;AAFL,CAvIY,C","sourcesContent":["import semver from 'semver';\nimport spdxExpressionParse from 'spdx-expression-parse';\nimport iterateJsdoc from '../iterateJsdoc';\n\nconst allowedKinds = new Set([\n 'class',\n 'constant',\n 'event',\n 'external',\n 'file',\n 'function',\n 'member',\n 'mixin',\n 'module',\n 'namespace',\n 'typedef',\n]);\n\nexport default iterateJsdoc(({\n utils,\n report,\n context,\n}) => {\n const options = context.options[0] || {};\n const {\n allowedLicenses = null,\n allowedAuthors = null,\n numericOnlyVariation = false,\n licensePattern = '/([^\\n\\r]*)/gu',\n } = options;\n\n utils.forEachPreferredTag('version', (jsdocParameter, targetTagName) => {\n const version = utils.getTagDescription(jsdocParameter).trim();\n if (!version) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (!semver.valid(version)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\".`,\n null,\n jsdocParameter,\n );\n }\n });\n\n utils.forEachPreferredTag('kind', (jsdocParameter, targetTagName) => {\n const kind = utils.getTagDescription(jsdocParameter).trim();\n if (!kind) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (!allowedKinds.has(kind)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\"; ` +\n `must be one of: ${[\n ...allowedKinds,\n ].join(', ')}.`,\n null,\n jsdocParameter,\n );\n }\n });\n\n if (numericOnlyVariation) {\n utils.forEachPreferredTag('variation', (jsdocParameter, targetTagName) => {\n const variation = utils.getTagDescription(jsdocParameter).trim();\n if (!variation) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (\n !Number.isInteger(Number(variation)) ||\n Number(variation) <= 0\n ) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\".`,\n null,\n jsdocParameter,\n );\n }\n });\n }\n\n utils.forEachPreferredTag('since', (jsdocParameter, targetTagName) => {\n const version = utils.getTagDescription(jsdocParameter).trim();\n if (!version) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (!semver.valid(version)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\".`,\n null,\n jsdocParameter,\n );\n }\n });\n utils.forEachPreferredTag('license', (jsdocParameter, targetTagName) => {\n const licenseRegex = utils.getRegexFromString(licensePattern, 'g');\n const match = utils.getTagDescription(jsdocParameter).match(licenseRegex);\n const license = match && match[1] || match[0];\n if (!license.trim()) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (allowedLicenses) {\n if (allowedLicenses !== true && !allowedLicenses.includes(license)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${license}\"; expected one of ${allowedLicenses.join(', ')}.`,\n null,\n jsdocParameter,\n );\n }\n } else {\n try {\n spdxExpressionParse(license);\n } catch {\n report(\n `Invalid JSDoc @${targetTagName}: \"${license}\"; expected SPDX expression: https://spdx.org/licenses/.`,\n null,\n jsdocParameter,\n );\n }\n }\n });\n\n utils.forEachPreferredTag('author', (jsdocParameter, targetTagName) => {\n const author = utils.getTagDescription(jsdocParameter).trim();\n if (!author) {\n report(\n `Missing JSDoc @${targetTagName} value.`,\n null,\n jsdocParameter,\n );\n } else if (allowedAuthors && !allowedAuthors.includes(author)) {\n report(\n `Invalid JSDoc @${targetTagName}: \"${utils.getTagDescription(jsdocParameter)}\"; expected one of ${allowedAuthors.join(', ')}.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'This rule checks the values for a handful of tags: `@version`, `@since`, `@license` and `@author`.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-values',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowedAuthors: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n allowedLicenses: {\n anyOf: [\n {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n {\n type: 'boolean',\n },\n ],\n },\n licensePattern: {\n type: 'string',\n },\n numericOnlyVariation: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"file":"checkValues.js"}
@@ -15,6 +15,7 @@ const defaultEmptyTags = new Set(['abstract', 'async', 'generator', 'global', 'h
15
15
  'internal']);
16
16
  const emptyIfNotClosure = new Set(['package', 'private', 'protected', 'public', 'static', // Closure doesn't allow with this casing
17
17
  'inheritdoc']);
18
+ const emptyIfClosure = new Set(['interface']);
18
19
 
19
20
  var _default = (0, _iterateJsdoc.default)(({
20
21
  settings,
@@ -28,7 +29,7 @@ var _default = (0, _iterateJsdoc.default)(({
28
29
  tag
29
30
  }) => {
30
31
  return tag === tagName;
31
- }) || settings.mode !== 'closure' && emptyIfNotClosure.has(tagName);
32
+ }) || settings.mode === 'closure' && emptyIfClosure.has(tagName) || settings.mode !== 'closure' && emptyIfNotClosure.has(tagName);
32
33
  });
33
34
 
34
35
  for (const tag of emptyTags) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/rules/emptyTags.js"],"names":["defaultEmptyTags","Set","emptyIfNotClosure","settings","jsdoc","utils","emptyTags","filterTags","tag","tagName","has","hasOptionTag","tags","some","mode","content","name","description","type","trim","fix","setTag","reportJSDoc","checkInternal","checkPrivate","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","items"],"mappings":";;;;;;;AAAA;;;;AAEA,MAAMA,gBAAgB,GAAG,IAAIC,GAAJ,CAAQ,CAC/B,UAD+B,EACnB,OADmB,EACV,WADU,EACG,QADH,EACa,iBADb,EAE/B,QAF+B,EAErB,OAFqB,EAEZ,UAFY,EAEA,UAFA,EAEY,UAFZ,EAI/B;AACA;AACA,YAN+B,EAQ/B;AACA,UAT+B,CAAR,CAAzB;AAYA,MAAMC,iBAAiB,GAAG,IAAID,GAAJ,CAAQ,CAChC,SADgC,EACrB,SADqB,EACV,WADU,EACG,QADH,EACa,QADb,EAGhC;AACA,YAJgC,CAAR,CAA1B;;eAOe,2BAAa,CAAC;AAC3BE,EAAAA,QAD2B;AAE3BC,EAAAA,KAF2B;AAG3BC,EAAAA;AAH2B,CAAD,KAItB;AACJ,QAAMC,SAAS,GAAGD,KAAK,CAACE,UAAN,CAAiB,CAAC;AAClCC,IAAAA,GAAG,EAAEC;AAD6B,GAAD,KAE7B;AACJ,WAAOT,gBAAgB,CAACU,GAAjB,CAAqBD,OAArB,KACLJ,KAAK,CAACM,YAAN,CAAmBF,OAAnB,KAA+BL,KAAK,CAACQ,IAAN,CAAWC,IAAX,CAAgB,CAAC;AAC9CL,MAAAA;AAD8C,KAAD,KAEzC;AACJ,aAAOA,GAAG,KAAKC,OAAf;AACD,KAJ8B,CAD1B,IAMLN,QAAQ,CAACW,IAAT,KAAkB,SAAlB,IAA+BZ,iBAAiB,CAACQ,GAAlB,CAAsBD,OAAtB,CANjC;AAOD,GAViB,CAAlB;;AAWA,OAAK,MAAMD,GAAX,IAAkBF,SAAlB,EAA6B;AAC3B,UAAMS,OAAO,GAAGP,GAAG,CAACQ,IAAJ,IAAYR,GAAG,CAACS,WAAhB,IAA+BT,GAAG,CAACU,IAAnD;;AACA,QAAIH,OAAO,CAACI,IAAR,EAAJ,EAAoB;AAClB,YAAMC,GAAG,GAAG,MAAM;AAChBf,QAAAA,KAAK,CAACgB,MAAN,CAAab,GAAb;AACD,OAFD;;AAIAH,MAAAA,KAAK,CAACiB,WAAN,CAAmB,IAAGd,GAAG,CAACA,GAAI,mBAA9B,EAAkDA,GAAlD,EAAuDY,GAAvD,EAA4D,IAA5D;AACD;AACF;AACF,CA1Bc,EA0BZ;AACDG,EAAAA,aAAa,EAAE,IADd;AAEDC,EAAAA,YAAY,EAAE,IAFb;AAGDC,EAAAA,gBAAgB,EAAE,IAHjB;AAIDC,EAAAA,IAAI,EAAE;AACJC,IAAAA,IAAI,EAAE;AACJV,MAAAA,WAAW,EAAE,mDADT;AAEJW,MAAAA,GAAG,EAAE;AAFD,KADF;AAKJC,IAAAA,OAAO,EAAE,MALL;AAMJC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,oBAAoB,EAAE,KADxB;AAEEC,MAAAA,UAAU,EAAE;AACVpB,QAAAA,IAAI,EAAE;AACJqB,UAAAA,KAAK,EAAE;AACLf,YAAAA,IAAI,EAAE;AADD,WADH;AAIJA,UAAAA,IAAI,EAAE;AAJF;AADI,OAFd;AAUEA,MAAAA,IAAI,EAAE;AAVR,KADM,CANJ;AAoBJA,IAAAA,IAAI,EAAE;AApBF;AAJL,CA1BY,C","sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst defaultEmptyTags = new Set([\n 'abstract', 'async', 'generator', 'global', 'hideconstructor',\n 'ignore', 'inner', 'instance', 'override', 'readonly',\n\n // jsdoc doesn't use this form in its docs, but allow for compatibility with\n // TypeScript which allows and Closure which requires\n 'inheritDoc',\n\n // jsdoc doesn't use but allow for TypeScript\n 'internal',\n]);\n\nconst emptyIfNotClosure = new Set([\n 'package', 'private', 'protected', 'public', 'static',\n\n // Closure doesn't allow with this casing\n 'inheritdoc',\n]);\n\nexport default iterateJsdoc(({\n settings,\n jsdoc,\n utils,\n}) => {\n const emptyTags = utils.filterTags(({\n tag: tagName,\n }) => {\n return defaultEmptyTags.has(tagName) ||\n utils.hasOptionTag(tagName) && jsdoc.tags.some(({\n tag,\n }) => {\n return tag === tagName;\n }) ||\n settings.mode !== 'closure' && emptyIfNotClosure.has(tagName);\n });\n for (const tag of emptyTags) {\n const content = tag.name || tag.description || tag.type;\n if (content.trim()) {\n const fix = () => {\n utils.setTag(tag);\n };\n\n utils.reportJSDoc(`@${tag.tag} should be empty.`, tag, fix, true);\n }\n }\n}, {\n checkInternal: true,\n checkPrivate: true,\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Expects specific tags to be empty of any content.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-empty-tags',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n tags: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"file":"emptyTags.js"}
1
+ {"version":3,"sources":["../../src/rules/emptyTags.js"],"names":["defaultEmptyTags","Set","emptyIfNotClosure","emptyIfClosure","settings","jsdoc","utils","emptyTags","filterTags","tag","tagName","has","hasOptionTag","tags","some","mode","content","name","description","type","trim","fix","setTag","reportJSDoc","checkInternal","checkPrivate","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","items"],"mappings":";;;;;;;AAAA;;;;AAEA,MAAMA,gBAAgB,GAAG,IAAIC,GAAJ,CAAQ,CAC/B,UAD+B,EACnB,OADmB,EACV,WADU,EACG,QADH,EACa,iBADb,EAE/B,QAF+B,EAErB,OAFqB,EAEZ,UAFY,EAEA,UAFA,EAEY,UAFZ,EAI/B;AACA;AACA,YAN+B,EAQ/B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I,mBAA9B,EAAkDA,GAAlD,EAAuDY,GAAvD,EAA4D,IAA5D;AACD;AACF;AACF,CA3Bc,EA2BZ;AACDG,EAAAA,aAAa,EAAE,IADd;AAEDC,EAAAA,YAAY,EAAE,IAFb;AAGDC,EAAAA,gBAAgB,EAAE,IAHjB;AAIDC,EAAAA,IAAI,EAAE;AACJC,IAAAA,IAAI,EAAE;AACJV,MAAAA,WAAW,EAAE,mDADT;AAEJW,MAAAA,GAAG,EAAE;AAFD,KADF;AAKJC,IAAAA,OAAO,EAAE,MALL;AAMJC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,oBAAoB,EAAE,KADxB;AAEEC,MAAAA,UAAU,EAAE;AACVpB,QAAAA,IAAI,EAAE;AACJqB,UAAAA,KAAK,EAAE;AACLf,YAAAA,IAAI,EAAE;AADD,WADH;AAIJA,UAAAA,IAAI,EAAE;AAJF;AADI,OAFd;AAUEA,MAAAA,IAAI,EAAE;AAVR,KADM,CANJ;AAoBJA,IAAAA,IAAI,EAAE;AApBF;AAJL,CA3BY,C","sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst defaultEmptyTags = new Set([\n 'abstract', 'async', 'generator', 'global', 'hideconstructor',\n 'ignore', 'inner', 'instance', 'override', 'readonly',\n\n // jsdoc doesn't use this form in its docs, but allow for compatibility with\n // TypeScript which allows and Closure which requires\n 'inheritDoc',\n\n // jsdoc doesn't use but allow for TypeScript\n 'internal',\n]);\n\nconst emptyIfNotClosure = new Set([\n 'package', 'private', 'protected', 'public', 'static',\n\n // Closure doesn't allow with this casing\n 'inheritdoc',\n]);\n\nconst emptyIfClosure = new Set([\n 'interface',\n]);\n\nexport default iterateJsdoc(({\n settings,\n jsdoc,\n utils,\n}) => {\n const emptyTags = utils.filterTags(({\n tag: tagName,\n }) => {\n return defaultEmptyTags.has(tagName) ||\n utils.hasOptionTag(tagName) && jsdoc.tags.some(({\n tag,\n }) => {\n return tag === tagName;\n }) ||\n settings.mode === 'closure' && emptyIfClosure.has(tagName) ||\n settings.mode !== 'closure' && emptyIfNotClosure.has(tagName);\n });\n for (const tag of emptyTags) {\n const content = tag.name || tag.description || tag.type;\n if (content.trim()) {\n const fix = () => {\n utils.setTag(tag);\n };\n\n utils.reportJSDoc(`@${tag.tag} should be empty.`, tag, fix, true);\n }\n }\n}, {\n checkInternal: true,\n checkPrivate: true,\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Expects specific tags to be empty of any content.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-empty-tags',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n tags: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"file":"emptyTags.js"}
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "http://gajus.com"
6
6
  },
7
7
  "dependencies": {
8
- "@es-joy/jsdoccomment": "~0.18.0",
8
+ "@es-joy/jsdoccomment": "~0.19.0",
9
9
  "comment-parser": "1.3.0",
10
10
  "debug": "^4.3.3",
11
11
  "escape-string-regexp": "^4.0.0",
@@ -17,7 +17,7 @@
17
17
  "description": "JSDoc linting rules for ESLint.",
18
18
  "devDependencies": {
19
19
  "@babel/cli": "^7.17.0",
20
- "@babel/core": "^7.17.0",
20
+ "@babel/core": "^7.17.2",
21
21
  "@babel/eslint-parser": "^7.17.0",
22
22
  "@babel/node": "^7.16.8",
23
23
  "@babel/plugin-syntax-class-properties": "^7.12.13",
@@ -25,7 +25,7 @@
25
25
  "@babel/preset-env": "^7.16.11",
26
26
  "@babel/register": "^7.17.0",
27
27
  "@hkdobrev/run-if-changed": "^0.3.1",
28
- "@typescript-eslint/parser": "^5.10.2",
28
+ "@typescript-eslint/parser": "^5.11.0",
29
29
  "babel-plugin-add-module-exports": "^1.0.4",
30
30
  "babel-plugin-istanbul": "^6.1.1",
31
31
  "camelcase": "^6.3.0",
@@ -107,5 +107,5 @@
107
107
  "test-index": "cross-env BABEL_ENV=test mocha --recursive --require @babel/register --reporter progress --timeout 12000 test/rules/index.js",
108
108
  "test-no-cov": "cross-env BABEL_ENV=test mocha --reporter dot --recursive --require @babel/register --timeout 12000"
109
109
  },
110
- "version": "37.8.0"
110
+ "version": "37.9.1"
111
111
  }