eslint-plugin-jsdoc 63.0.11 → 63.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/WarnSettings.cjs +8 -1
  2. package/dist/WarnSettings.cjs.map +1 -1
  3. package/dist/alignTransform.cjs +10 -6
  4. package/dist/alignTransform.cjs.map +1 -1
  5. package/dist/buildForbidRuleDefinition.cjs +10 -3
  6. package/dist/buildForbidRuleDefinition.cjs.map +1 -1
  7. package/dist/buildRejectOrPreferRuleDefinition.cjs +14 -7
  8. package/dist/buildRejectOrPreferRuleDefinition.cjs.map +1 -1
  9. package/dist/defaultTagOrder.cjs +8 -1
  10. package/dist/defaultTagOrder.cjs.map +1 -1
  11. package/dist/exportParser.cjs +14 -6
  12. package/dist/exportParser.cjs.map +1 -1
  13. package/dist/generateDocs.cjs +44 -36
  14. package/dist/generateDocs.cjs.map +1 -1
  15. package/dist/generateOptions.cjs +18 -15
  16. package/dist/generateOptions.cjs.map +1 -1
  17. package/dist/generateRule.cjs +24 -24
  18. package/dist/generateRule.cjs.map +1 -1
  19. package/dist/generateRuleTypes.cjs +9 -6
  20. package/dist/generateRuleTypes.cjs.map +1 -1
  21. package/dist/getDefaultTagStructureForMode.cjs +8 -1
  22. package/dist/getDefaultTagStructureForMode.cjs.map +1 -1
  23. package/dist/getJsdocProcessorPlugin.cjs +28 -20
  24. package/dist/getJsdocProcessorPlugin.cjs.map +1 -1
  25. package/dist/index-cjs.cjs +159 -152
  26. package/dist/index-cjs.cjs.map +1 -1
  27. package/dist/index-esm.cjs +27 -16
  28. package/dist/index-esm.cjs.map +1 -1
  29. package/dist/index.cjs +172 -159
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/iterateJsdoc.cjs +32 -22
  32. package/dist/iterateJsdoc.cjs.map +1 -1
  33. package/dist/jsdocUtils.cjs +86 -18
  34. package/dist/jsdocUtils.cjs.map +1 -1
  35. package/dist/rules/checkAccess.cjs +10 -2
  36. package/dist/rules/checkAccess.cjs.map +1 -1
  37. package/dist/rules/checkAlignment.cjs +10 -2
  38. package/dist/rules/checkAlignment.cjs.map +1 -1
  39. package/dist/rules/checkExamples.cjs +15 -6
  40. package/dist/rules/checkExamples.cjs.map +1 -1
  41. package/dist/rules/checkIndentation.cjs +9 -2
  42. package/dist/rules/checkIndentation.cjs.map +1 -1
  43. package/dist/rules/checkLineAlignment.cjs +14 -6
  44. package/dist/rules/checkLineAlignment.cjs.map +1 -1
  45. package/dist/rules/checkParamNames.cjs +9 -2
  46. package/dist/rules/checkParamNames.cjs.map +1 -1
  47. package/dist/rules/checkPropertyNames.cjs +9 -2
  48. package/dist/rules/checkPropertyNames.cjs.map +1 -1
  49. package/dist/rules/checkSyntax.cjs +10 -2
  50. package/dist/rules/checkSyntax.cjs.map +1 -1
  51. package/dist/rules/checkTagNames.cjs +11 -4
  52. package/dist/rules/checkTagNames.cjs.map +1 -1
  53. package/dist/rules/checkTemplateNames.cjs +20 -12
  54. package/dist/rules/checkTemplateNames.cjs.map +1 -1
  55. package/dist/rules/checkTypes.cjs +10 -4
  56. package/dist/rules/checkTypes.cjs.map +1 -1
  57. package/dist/rules/checkValues.cjs +17 -9
  58. package/dist/rules/checkValues.cjs.map +1 -1
  59. package/dist/rules/convertToJsdocComments.cjs +19 -13
  60. package/dist/rules/convertToJsdocComments.cjs.map +1 -1
  61. package/dist/rules/emptyTags.cjs +10 -2
  62. package/dist/rules/emptyTags.cjs.map +1 -1
  63. package/dist/rules/escapeInlineTags.cjs +10 -2
  64. package/dist/rules/escapeInlineTags.cjs.map +1 -1
  65. package/dist/rules/implementsOnClasses.cjs +10 -2
  66. package/dist/rules/implementsOnClasses.cjs.map +1 -1
  67. package/dist/rules/importsAsDependencies.cjs +20 -12
  68. package/dist/rules/importsAsDependencies.cjs.map +1 -1
  69. package/dist/rules/informativeDocs.cjs +12 -4
  70. package/dist/rules/informativeDocs.cjs.map +1 -1
  71. package/dist/rules/linesBeforeBlock.cjs +9 -2
  72. package/dist/rules/linesBeforeBlock.cjs.map +1 -1
  73. package/dist/rules/matchDescription.cjs +9 -2
  74. package/dist/rules/matchDescription.cjs.map +1 -1
  75. package/dist/rules/matchName.cjs +10 -2
  76. package/dist/rules/matchName.cjs.map +1 -1
  77. package/dist/rules/multilineBlocks.cjs +9 -2
  78. package/dist/rules/multilineBlocks.cjs.map +1 -1
  79. package/dist/rules/noBadBlocks.cjs +11 -4
  80. package/dist/rules/noBadBlocks.cjs.map +1 -1
  81. package/dist/rules/noBlankBlockDescriptions.cjs +10 -2
  82. package/dist/rules/noBlankBlockDescriptions.cjs.map +1 -1
  83. package/dist/rules/noBlankBlocks.cjs +10 -2
  84. package/dist/rules/noBlankBlocks.cjs.map +1 -1
  85. package/dist/rules/noDefaults.cjs +10 -2
  86. package/dist/rules/noDefaults.cjs.map +1 -1
  87. package/dist/rules/noMissingSyntax.cjs +9 -2
  88. package/dist/rules/noMissingSyntax.cjs.map +1 -1
  89. package/dist/rules/noMultiAsterisks.cjs +10 -2
  90. package/dist/rules/noMultiAsterisks.cjs.map +1 -1
  91. package/dist/rules/noRestrictedSyntax.cjs +9 -2
  92. package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
  93. package/dist/rules/noTypes.cjs +9 -2
  94. package/dist/rules/noTypes.cjs.map +1 -1
  95. package/dist/rules/noUndefinedTypes.cjs +21 -13
  96. package/dist/rules/noUndefinedTypes.cjs.map +1 -1
  97. package/dist/rules/preferImportTag.cjs +28 -21
  98. package/dist/rules/preferImportTag.cjs.map +1 -1
  99. package/dist/rules/requireAsteriskPrefix.cjs +10 -2
  100. package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
  101. package/dist/rules/requireDescription.cjs +9 -2
  102. package/dist/rules/requireDescription.cjs.map +1 -1
  103. package/dist/rules/requireDescriptionCompleteSentence.cjs +15 -7
  104. package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
  105. package/dist/rules/requireExample.cjs +10 -2
  106. package/dist/rules/requireExample.cjs.map +1 -1
  107. package/dist/rules/requireFileOverview.cjs +10 -2
  108. package/dist/rules/requireFileOverview.cjs.map +1 -1
  109. package/dist/rules/requireHyphenBeforeParamDescription.cjs +10 -2
  110. package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
  111. package/dist/rules/requireJsdoc.cjs +24 -17
  112. package/dist/rules/requireJsdoc.cjs.map +1 -1
  113. package/dist/rules/requireParam.cjs +9 -2
  114. package/dist/rules/requireParam.cjs.map +1 -1
  115. package/dist/rules/requireParamDescription.cjs +10 -2
  116. package/dist/rules/requireParamDescription.cjs.map +1 -1
  117. package/dist/rules/requireParamName.cjs +10 -2
  118. package/dist/rules/requireParamName.cjs.map +1 -1
  119. package/dist/rules/requireParamType.cjs +10 -2
  120. package/dist/rules/requireParamType.cjs.map +1 -1
  121. package/dist/rules/requireProperty.cjs +10 -2
  122. package/dist/rules/requireProperty.cjs.map +1 -1
  123. package/dist/rules/requirePropertyDescription.cjs +10 -2
  124. package/dist/rules/requirePropertyDescription.cjs.map +1 -1
  125. package/dist/rules/requirePropertyName.cjs +10 -2
  126. package/dist/rules/requirePropertyName.cjs.map +1 -1
  127. package/dist/rules/requirePropertyType.cjs +10 -2
  128. package/dist/rules/requirePropertyType.cjs.map +1 -1
  129. package/dist/rules/requireRejects.cjs +9 -2
  130. package/dist/rules/requireRejects.cjs.map +1 -1
  131. package/dist/rules/requireReturns.cjs +11 -4
  132. package/dist/rules/requireReturns.cjs.map +1 -1
  133. package/dist/rules/requireReturnsCheck.cjs +15 -8
  134. package/dist/rules/requireReturnsCheck.cjs.map +1 -1
  135. package/dist/rules/requireReturnsDescription.cjs +10 -2
  136. package/dist/rules/requireReturnsDescription.cjs.map +1 -1
  137. package/dist/rules/requireReturnsType.cjs +10 -2
  138. package/dist/rules/requireReturnsType.cjs.map +1 -1
  139. package/dist/rules/requireTags.cjs +9 -2
  140. package/dist/rules/requireTags.cjs.map +1 -1
  141. package/dist/rules/requireTemplate.cjs +13 -5
  142. package/dist/rules/requireTemplate.cjs.map +1 -1
  143. package/dist/rules/requireThrows.cjs +9 -2
  144. package/dist/rules/requireThrows.cjs.map +1 -1
  145. package/dist/rules/requireYields.cjs +9 -2
  146. package/dist/rules/requireYields.cjs.map +1 -1
  147. package/dist/rules/requireYieldsCheck.cjs +9 -2
  148. package/dist/rules/requireYieldsCheck.cjs.map +1 -1
  149. package/dist/rules/sortTags.cjs +12 -4
  150. package/dist/rules/sortTags.cjs.map +1 -1
  151. package/dist/rules/tagLines.cjs +9 -2
  152. package/dist/rules/tagLines.cjs.map +1 -1
  153. package/dist/rules/textEscaping.cjs +9 -2
  154. package/dist/rules/textEscaping.cjs.map +1 -1
  155. package/dist/rules/tsMethodSignatureStyle.cjs +18 -10
  156. package/dist/rules/tsMethodSignatureStyle.cjs.map +1 -1
  157. package/dist/rules/tsNoEmptyObjectType.cjs +13 -5
  158. package/dist/rules/tsNoEmptyObjectType.cjs.map +1 -1
  159. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs +16 -8
  160. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs.map +1 -1
  161. package/dist/rules/tsPreferFunctionType.cjs +16 -8
  162. package/dist/rules/tsPreferFunctionType.cjs.map +1 -1
  163. package/dist/rules/typeFormatting.cjs +17 -9
  164. package/dist/rules/typeFormatting.cjs.map +1 -1
  165. package/dist/rules/validTypes.cjs +18 -10
  166. package/dist/rules/validTypes.cjs.map +1 -1
  167. package/dist/tagNames.cjs +9 -4
  168. package/dist/tagNames.cjs.map +1 -1
  169. package/dist/utils/hasReturnValue.cjs +8 -1
  170. package/dist/utils/hasReturnValue.cjs.map +1 -1
  171. package/package.json +1 -1
@@ -1,7 +1,14 @@
1
- import iterateJsdoc from '../iterateJsdoc.js';
2
- import { rewireByParsedType } from '../jsdocUtils.js';
3
- import { parse as parseType, traverse } from '@es-joy/jsdoccomment';
4
- export default iterateJsdoc(({
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
8
+ var _jsdocUtils = require("../jsdocUtils.cjs");
9
+ var _jsdoccomment = require("@es-joy/jsdoccomment");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ var _default = exports.default = (0, _iterateJsdoc.default)(({
5
12
  context,
6
13
  indent,
7
14
  jsdoc,
@@ -23,11 +30,11 @@ export default iterateJsdoc(({
23
30
  /** @type {import('jsdoc-type-pratt-parser').RootResult} */
24
31
  let parsedType;
25
32
  try {
26
- parsedType = parseType(/** @type {string} */potentialType, 'typescript');
33
+ parsedType = (0, _jsdoccomment.parse)(/** @type {string} */potentialType, 'typescript');
27
34
  } catch {
28
35
  return;
29
36
  }
30
- traverse(parsedType, (nde, parentNode, property, index) => {
37
+ (0, _jsdoccomment.traverse)(parsedType, (nde, parentNode, property, index) => {
31
38
  switch (nde.type) {
32
39
  case 'JsdocTypeTemplateLiteral':
33
40
  {
@@ -39,7 +46,7 @@ export default iterateJsdoc(({
39
46
  nde.literals.splice(stringInterpolationIndex, 2, nde.literals[stringInterpolationIndex] + /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */
40
47
  nde.interpolations[stringInterpolationIndex].value + nde.literals[stringInterpolationIndex + 1]);
41
48
  nde.interpolations.splice(stringInterpolationIndex, 1);
42
- rewireByParsedType(jsdoc, tag, parsedType, indent);
49
+ (0, _jsdocUtils.rewireByParsedType)(jsdoc, tag, parsedType, indent);
43
50
  } : null);
44
51
  } else if (nde.literals.length === 2 && nde.literals[0] === '' && nde.literals[1] === '') {
45
52
  utils.reportJSDoc('Found a lone template expression within a template.', tag, enableFixer ? () => {
@@ -55,7 +62,7 @@ export default iterateJsdoc(({
55
62
  } else {
56
63
  parsedType = interpolation;
57
64
  }
58
- rewireByParsedType(jsdoc, tag, parsedType, indent);
65
+ (0, _jsdocUtils.rewireByParsedType)(jsdoc, tag, parsedType, indent);
59
66
  } : null);
60
67
  }
61
68
  }
@@ -93,4 +100,5 @@ export default iterateJsdoc(({
93
100
  type: 'suggestion'
94
101
  }
95
102
  });
103
+ module.exports = exports.default;
96
104
  //# sourceMappingURL=tsNoUnnecessaryTemplateExpression.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsNoUnnecessaryTemplateExpression.cjs","names":[],"sources":["../../src/rules/tsNoUnnecessaryTemplateExpression.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n rewireByParsedType,\n} from '../jsdocUtils.js';\nimport {\n parse as parseType,\n traverse,\n} from '@es-joy/jsdoccomment';\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n settings,\n utils,\n}) => {\n if (settings.mode !== 'typescript') {\n return;\n }\n\n const {\n enableFixer = true,\n } = context.options[0] ?? {};\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag\n */\n const checkType = (tag) => {\n const potentialType = tag.type;\n /** @type {import('jsdoc-type-pratt-parser').RootResult} */\n let parsedType;\n try {\n parsedType = parseType(\n /** @type {string} */ (potentialType), 'typescript',\n );\n } catch {\n return;\n }\n\n traverse(parsedType, (nde, parentNode, property, index) => {\n switch (nde.type) {\n case 'JsdocTypeTemplateLiteral': {\n const stringInterpolationIndex = nde.interpolations.findIndex((interpolation) => {\n return interpolation.type === 'JsdocTypeStringValue';\n });\n if (stringInterpolationIndex > -1) {\n utils.reportJSDoc(\n 'Found an unnecessary string literal within a template.',\n tag,\n enableFixer ? () => {\n nde.literals.splice(\n stringInterpolationIndex,\n 2,\n nde.literals[stringInterpolationIndex] +\n /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */\n (nde.interpolations[stringInterpolationIndex]).value +\n nde.literals[stringInterpolationIndex + 1],\n );\n\n nde.interpolations.splice(\n stringInterpolationIndex, 1,\n );\n\n rewireByParsedType(jsdoc, tag, parsedType, indent);\n } : null,\n );\n } else if (nde.literals.length === 2 && nde.literals[0] === '' &&\n nde.literals[1] === ''\n ) {\n utils.reportJSDoc(\n 'Found a lone template expression within a template.',\n tag,\n enableFixer ? () => {\n const interpolation = nde.interpolations[0];\n\n if (parentNode && property) {\n if (typeof index === 'number') {\n // @ts-expect-error Safe\n parentNode[property][index] = interpolation;\n } else {\n // @ts-expect-error Safe\n parentNode[property] = interpolation;\n }\n } else {\n parsedType = interpolation;\n }\n\n rewireByParsedType(jsdoc, tag, parsedType, indent);\n } : null,\n );\n }\n }\n }\n });\n };\n\n const tags = utils.filterTags(({\n tag,\n }) => {\n return Boolean(tag !== 'import' && utils.tagMightHaveTypePosition(tag));\n });\n\n for (const tag of tags) {\n if (tag.type) {\n checkType(tag);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Catches unnecessary template expressions such as string expressions within a template literal.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-unnecessary-template-expression.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB;AAC7C,SACE,kBAAkB,QACb,kBAAkB;AACzB,SACE,KAAK,IAAI,SAAS,EAClB,QAAQ,QACH,sBAAsB;AAE7B,eAAe,YAAY,CAAC,CAAC;EAC3B,OAAO;EACP,MAAM;EACN,KAAK;EACL,QAAQ;EACR;AACF,CAAC,KAAK;EACJ,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,EAAE;IAClC;EACF;EAEA,MAAM;IACJ,WAAW,GAAG;EAChB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;;EAE5B;AACF;AACA;EACE,MAAM,SAAS,GAAI,GAAG,IAAK;IACzB,MAAM,aAAa,GAAG,GAAG,CAAC,IAAI;IA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,CAAC,CAAC;gBAE3C,IAAI,UAAU,IAAI,QAAQ,EAAE;kBAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;oBAC7B;oBACA,UAAU,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,aAAa;kBAC7C,CAAC,MAAM;oBACL;oBACA,UAAU,CAAC,QAAQ,CAAC,GAAG,aAAa;kBACtC;gBACF,CAAC,MAAM;kBACL,UAAU,GAAG,aAAa;gBAC5B;gBAEA,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC;cACpD,CAAC,GAAG,IACN,CAAC;YACH;UACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAED,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7B;EACF,CAAC,KAAK;IACJ,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;EACzE,CAAC,CAAC;EAEF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;IACtB,IAAI,GAAG,CAAC,IAAI,EAAE;MACZ,SAAS,CAAC,GAAG,CAAC;IAChB;EACF;AACF,CAAC,EAAE;EACD,gBAAgB,EAAE,IAAI;EACtB,IAAI,EAAE;IACJ,IAAI,EAAE;MACJ,WAAW,EAAE,gGAAgG;MAC7G,GAAG,EAAE;IACP,CAAC;IACD,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,CACN;MACE,oBAAoB,EAAE,KAAK;MAC3B,UAAU,EAAE;QACV,WAAW,EAAE;UACX,WAAW,EAAE,kDAAkD;UAC/D,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"tsNoUnnecessaryTemplateExpression.cjs","names":["iterateJsdoc","parseType","traverse","rewireByParsedType"],"sources":["../../src/rules/tsNoUnnecessaryTemplateExpression.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n rewireByParsedType,\n} from '../jsdocUtils.js';\nimport {\n parse as parseType,\n traverse,\n} from '@es-joy/jsdoccomment';\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n settings,\n utils,\n}) => {\n if (settings.mode !== 'typescript') {\n return;\n }\n\n const {\n enableFixer = true,\n } = context.options[0] ?? {};\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag\n */\n const checkType = (tag) => {\n const potentialType = tag.type;\n /** @type {import('jsdoc-type-pratt-parser').RootResult} */\n let parsedType;\n try {\n parsedType = parseType(\n /** @type {string} */ (potentialType), 'typescript',\n );\n } catch {\n return;\n }\n\n traverse(parsedType, (nde, parentNode, property, index) => {\n switch (nde.type) {\n case 'JsdocTypeTemplateLiteral': {\n const stringInterpolationIndex = nde.interpolations.findIndex((interpolation) => {\n return interpolation.type === 'JsdocTypeStringValue';\n });\n if (stringInterpolationIndex > -1) {\n utils.reportJSDoc(\n 'Found an unnecessary string literal within a template.',\n tag,\n enableFixer ? () => {\n nde.literals.splice(\n stringInterpolationIndex,\n 2,\n nde.literals[stringInterpolationIndex] +\n /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */\n (nde.interpolations[stringInterpolationIndex]).value +\n nde.literals[stringInterpolationIndex + 1],\n );\n\n nde.interpolations.splice(\n stringInterpolationIndex, 1,\n );\n\n rewireByParsedType(jsdoc, tag, parsedType, indent);\n } : null,\n );\n } else if (nde.literals.length === 2 && nde.literals[0] === '' &&\n nde.literals[1] === ''\n ) {\n utils.reportJSDoc(\n 'Found a lone template expression within a template.',\n tag,\n enableFixer ? () => {\n const interpolation = nde.interpolations[0];\n\n if (parentNode && property) {\n if (typeof index === 'number') {\n // @ts-expect-error Safe\n parentNode[property][index] = interpolation;\n } else {\n // @ts-expect-error Safe\n parentNode[property] = interpolation;\n }\n } else {\n parsedType = interpolation;\n }\n\n rewireByParsedType(jsdoc, tag, parsedType, indent);\n } : null,\n );\n }\n }\n }\n });\n };\n\n const tags = utils.filterTags(({\n tag,\n }) => {\n return Boolean(tag !== 'import' && utils.tagMightHaveTypePosition(tag));\n });\n\n for (const tag of tags) {\n if (tag.type) {\n checkType(tag);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Catches unnecessary template expressions such as string expressions within a template literal.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-unnecessary-template-expression.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA;AACA;AAGA;AAG8B;AAAA,iCAEf,IAAAA,qBAAY,EAAC,CAAC;EAC3B,OAAO;EACP,MAAM;EACN,KAAK;EACL,QAAQ;EACR;AACF,CAAC,KAAK;EACJ,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,EAAE;IAClC;EACF;EAEA,MAAM;IACJ,WAAW,GAAG;EAChB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;;EAE5B;AACF;AACA;EACE,MAAM,SAAS,GAAI,GAAG,IAAK;IACzB,MAAM,aAAa,GAAG,GAAG,CAAC,IAAI;IAC9B;IACA,IAAI,UAAU;IACd,IAAI;MACF,UAAU,GAAG,IAAAC,mBAAS,EACpB,qBAAuB,aAAa,EAAG,YACzC,CAAC;IACH,CAAC,CAAC,MAAM;MACN;IACF;IAEA,IAAAC,cAAA,QAAQ,EAAC,UAAU,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,KAAK;MACzD,QAAQ,GAAG,CAAC,IAAI;QACd,KAAK,0BAA0B;UAAE;YAC/B,MAAM,wBAAwB,GAAG,GAAG,CAAC,cAAc,C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IAAAA,YAAA,kBAAkB,EAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC;cACpD,CAAC,GAAG,IACN,CAAC;YACH;UACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAED,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7B;EACF,CAAC,KAAK;IACJ,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;EACzE,CAAC,CAAC;EAEF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;IACtB,IAAI,GAAG,CAAC,IAAI,EAAE;MACZ,SAAS,CAAC,GAAG,CAAC;IAChB;EACF;AACF,CAAC,EAAE;EACD,gBAAgB,EAAE,IAAI;EACtB,IAAI,EAAE;IACJ,IAAI,EAAE;MACJ,WAAW,EAAE,gGAAgG;MAC7G,GAAG,EAAE;IACP,CAAC;IACD,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,CACN;MACE,oBAAoB,EAAE,KAAK;MAC3B,UAAU,EAAE;QACV,WAAW,EAAE;UACX,WAAW,EAAE,kDAAkD;UAC/D,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -1,7 +1,14 @@
1
- import iterateJsdoc from '../iterateJsdoc.js';
2
- import { rewireByParsedType } from '../jsdocUtils.js';
3
- import { parse as parseType, traverse } from '@es-joy/jsdoccomment';
4
- export default iterateJsdoc(({
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
8
+ var _jsdocUtils = require("../jsdocUtils.cjs");
9
+ var _jsdoccomment = require("@es-joy/jsdoccomment");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ var _default = exports.default = (0, _iterateJsdoc.default)(({
5
12
  context,
6
13
  indent,
7
14
  jsdoc,
@@ -20,15 +27,15 @@ export default iterateJsdoc(({
20
27
  /** @type {import('jsdoc-type-pratt-parser').RootResult} */
21
28
  let parsedType;
22
29
  try {
23
- parsedType = parseType(/** @type {string} */potentialType, 'typescript');
30
+ parsedType = (0, _jsdoccomment.parse)(/** @type {string} */potentialType, 'typescript');
24
31
  } catch {
25
32
  return;
26
33
  }
27
- traverse(parsedType, (nde, parentNode) => {
34
+ (0, _jsdoccomment.traverse)(parsedType, (nde, parentNode) => {
28
35
  // @ts-expect-error Adding our own property for use below
29
36
  nde.parentNode = parentNode;
30
37
  });
31
- traverse(parsedType, (nde, parentNode, property, index) => {
38
+ (0, _jsdoccomment.traverse)(parsedType, (nde, parentNode, property, index) => {
32
39
  switch (nde.type) {
33
40
  case 'JsdocTypeCallSignature':
34
41
  {
@@ -60,7 +67,7 @@ export default iterateJsdoc(({
60
67
  } else {
61
68
  parsedType = func;
62
69
  }
63
- rewireByParsedType(jsdoc, tag, parsedType, indent);
70
+ (0, _jsdocUtils.rewireByParsedType)(jsdoc, tag, parsedType, indent);
64
71
  } : null);
65
72
  }
66
73
  break;
@@ -99,4 +106,5 @@ export default iterateJsdoc(({
99
106
  type: 'suggestion'
100
107
  }
101
108
  });
109
+ module.exports = exports.default;
102
110
  //# sourceMappingURL=tsPreferFunctionType.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsPreferFunctionType.cjs","names":[],"sources":["../../src/rules/tsPreferFunctionType.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n rewireByParsedType,\n} from '../jsdocUtils.js';\nimport {\n parse as parseType,\n traverse,\n} from '@es-joy/jsdoccomment';\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n utils,\n}) => {\n const {\n enableFixer = true,\n } = context.options[0] || {};\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag\n */\n const checkType = (tag) => {\n const potentialType = tag.type;\n\n /** @type {import('jsdoc-type-pratt-parser').RootResult} */\n let parsedType;\n try {\n parsedType = parseType(\n /** @type {string} */ (potentialType), 'typescript',\n );\n } catch {\n return;\n }\n\n traverse(parsedType, (nde, parentNode) => {\n // @ts-expect-error Adding our own property for use below\n nde.parentNode = parentNode;\n });\n\n traverse(parsedType, (nde, parentNode, property, index) => {\n switch (nde.type) {\n case 'JsdocTypeCallSignature': {\n const object = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */ (\n parentNode\n );\n if (typeof index === 'number' && object.elements.length === 1) {\n utils.reportJSDoc(\n 'Call signature found; function type preferred.',\n tag,\n enableFixer ? () => {\n const func = /** @type {import('jsdoc-type-pratt-parser').FunctionResult} */ ({\n arrow: true,\n constructor: false,\n meta: /** @type {Required<import('jsdoc-type-pratt-parser').MethodSignatureResult['meta']>} */ (\n nde.meta\n ),\n parameters: nde.parameters,\n parenthesis: true,\n returnType: nde.returnType,\n type: 'JsdocTypeFunction',\n typeParameters: nde.typeParameters,\n });\n\n if (property && 'parentNode' in object && object.parentNode) {\n if (typeof object.parentNode === 'object' &&\n 'elements' in object.parentNode &&\n Array.isArray(object.parentNode.elements)\n ) {\n const idx = object.parentNode.elements.indexOf(object);\n object.parentNode.elements[idx] = func;\n /* c8 ignore next 6 -- Guard */\n } else {\n throw new Error(\n // @ts-expect-error Ok\n `Rule currently unable to handle type ${object.parentNode.type}`,\n );\n }\n } else {\n parsedType = func;\n }\n\n rewireByParsedType(jsdoc, tag, parsedType, indent);\n } : null,\n );\n }\n\n break;\n }\n }\n });\n };\n\n const tags = utils.filterTags(({\n tag,\n }) => {\n return Boolean(tag !== 'import' && utils.tagMightHaveTypePosition(tag));\n });\n\n for (const tag of tags) {\n if (tag.type) {\n checkType(tag);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Prefers function types over call signatures when there are no other properties.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-prefer-function-type.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n enableFixer: {\n description: 'Whether to enable the fixer or not',\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB;AAC7C,SACE,kBAAkB,QACb,kBAAkB;AACzB,SACE,KAAK,IAAI,SAAS,EAClB,QAAQ,QACH,sBAAsB;AAE7B,eAAe,YAAY,CAAC,CAAC;EAC3B,OAAO;EACP,MAAM;EACN,KAAK;EACL;AACF,CAAC,KAAK;EACJ,MAAM;IACJ,WAAW,GAAG;EAChB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;;EAE5B;AACF;AACA;EACE,MAAM,SAAS,GAAI,GAAG,IAAK;IACzB,MAAM,aAAa,GAAG,GAAG,CAAC,IAAI;;IAE9B;IACA,IAAI,UAAU;IACd,IAAI;MACF,UAAU,GAAG,SAAS,CACpB,qBAAuB,aAAa,EAAG,YACzC,CAAC;IACH,CAAC,CAAC,MAAM;MACN;IACF;IAEA,QAAQ,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK;MACxC;MACA,GAAG,CAAC,UAAU,GAAG,UAAU;IAC7B,CAAC,CAAC;IAEF,QAAQ,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,KAAK;MACzD,QAAQ,GAAG,CAAC,IAAI;QACd,KAAK,wBAAwB;UAAE;YAC7B,MAAM,MAAM,GAAG;YACb,UACD;YACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;cAC7D,KAAK,CAAC,WAAW,CACf,gDAAgD,EAChD,GAAG,EACH,WAAW,GAAG,MAAM;gBAClB,MAAM,IAAI,GAAG,+DAAiE;k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C,IAAI,EAAE;MACZ,SAAS,CAAC,GAAG,CAAC;IAChB;EACF;AACF,CAAC,EAAE;EACD,gBAAgB,EAAE,IAAI;EACtB,IAAI,EAAE;IACJ,IAAI,EAAE;MACJ,WAAW,EAAE,iFAAiF;MAC9F,GAAG,EAAE;IACP,CAAC;IACD,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,CACN;MACE,oBAAoB,EAAE,KAAK;MAC3B,UAAU,EAAE;QACV,WAAW,EAAE;UACX,WAAW,EAAE,oCAAoC;UACjD,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"tsPreferFunctionType.cjs","names":["iterateJsdoc","parseType","traverse","rewireByParsedType"],"sources":["../../src/rules/tsPreferFunctionType.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n rewireByParsedType,\n} from '../jsdocUtils.js';\nimport {\n parse as parseType,\n traverse,\n} from '@es-joy/jsdoccomment';\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n utils,\n}) => {\n const {\n enableFixer = true,\n } = context.options[0] || {};\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag\n */\n const checkType = (tag) => {\n const potentialType = tag.type;\n\n /** @type {import('jsdoc-type-pratt-parser').RootResult} */\n let parsedType;\n try {\n parsedType = parseType(\n /** @type {string} */ (potentialType), 'typescript',\n );\n } catch {\n return;\n }\n\n traverse(parsedType, (nde, parentNode) => {\n // @ts-expect-error Adding our own property for use below\n nde.parentNode = parentNode;\n });\n\n traverse(parsedType, (nde, parentNode, property, index) => {\n switch (nde.type) {\n case 'JsdocTypeCallSignature': {\n const object = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */ (\n parentNode\n );\n if (typeof index === 'number' && object.elements.length === 1) {\n utils.reportJSDoc(\n 'Call signature found; function type preferred.',\n tag,\n enableFixer ? () => {\n const func = /** @type {import('jsdoc-type-pratt-parser').FunctionResult} */ ({\n arrow: true,\n constructor: false,\n meta: /** @type {Required<import('jsdoc-type-pratt-parser').MethodSignatureResult['meta']>} */ (\n nde.meta\n ),\n parameters: nde.parameters,\n parenthesis: true,\n returnType: nde.returnType,\n type: 'JsdocTypeFunction',\n typeParameters: nde.typeParameters,\n });\n\n if (property && 'parentNode' in object && object.parentNode) {\n if (typeof object.parentNode === 'object' &&\n 'elements' in object.parentNode &&\n Array.isArray(object.parentNode.elements)\n ) {\n const idx = object.parentNode.elements.indexOf(object);\n object.parentNode.elements[idx] = func;\n /* c8 ignore next 6 -- Guard */\n } else {\n throw new Error(\n // @ts-expect-error Ok\n `Rule currently unable to handle type ${object.parentNode.type}`,\n );\n }\n } else {\n parsedType = func;\n }\n\n rewireByParsedType(jsdoc, tag, parsedType, indent);\n } : null,\n );\n }\n\n break;\n }\n }\n });\n };\n\n const tags = utils.filterTags(({\n tag,\n }) => {\n return Boolean(tag !== 'import' && utils.tagMightHaveTypePosition(tag));\n });\n\n for (const tag of tags) {\n if (tag.type) {\n checkType(tag);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Prefers function types over call signatures when there are no other properties.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-prefer-function-type.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n enableFixer: {\n description: 'Whether to enable the fixer or not',\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA;AACA;AAGA;AAG8B;AAAA,iCAEf,IAAAA,qBAAY,EAAC,CAAC;EAC3B,OAAO;EACP,MAAM;EACN,KAAK;EACL;AACF,CAAC,KAAK;EACJ,MAAM;IACJ,WAAW,GAAG;EAChB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;;EAE5B;AACF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Jsdoc from '../iterateJsdoc.js';
2
- import { rewireByParsedType } from '../jsdocUtils.js';
3
- import { parse as parseType, stringify, traverse, tryParse as tryParseType } from '@es-joy/jsdoccomment';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
8
+ var _jsdocUtils = require("../jsdocUtils.cjs");
9
+ var _jsdoccomment = require("@es-joy/jsdoccomment");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
4
11
  const digitRegex = /^(\d+(\.\d*)?|\.\d+)([eE][\-+]?\d+)?$/v;
5
- export default iterateJsdoc(({
12
+ var _default = exports.default = (0, _iterateJsdoc.default)(({
6
13
  context,
7
14
  indent,
8
15
  jsdoc,
@@ -54,12 +61,12 @@ export default iterateJsdoc(({
54
61
  const potentialType = tag.type;
55
62
  let parsedType;
56
63
  try {
57
- parsedType = mode === 'permissive' ? tryParseType(/** @type {string} */potentialType) : parseType(/** @type {string} */potentialType, mode);
64
+ parsedType = mode === 'permissive' ? (0, _jsdoccomment.tryParse)(/** @type {string} */potentialType) : (0, _jsdoccomment.parse)(/** @type {string} */potentialType, mode);
58
65
  } catch {
59
66
  return;
60
67
  }
61
68
  const fix = () => {
62
- rewireByParsedType(jsdoc, tag, parsedType, indent, typeBracketSpacing);
69
+ (0, _jsdocUtils.rewireByParsedType)(jsdoc, tag, parsedType, indent, typeBracketSpacing);
63
70
  };
64
71
 
65
72
  /** @type {string[]} */
@@ -71,7 +78,7 @@ export default iterateJsdoc(({
71
78
  }
72
79
 
73
80
  // eslint-disable-next-line complexity -- Todo
74
- traverse(parsedType, nde => {
81
+ (0, _jsdoccomment.traverse)(parsedType, nde => {
75
82
  let errorMessage = '';
76
83
 
77
84
  /**
@@ -310,7 +317,7 @@ export default iterateJsdoc(({
310
317
  /* c8 ignore next -- Guard */
311
318
  const separator = typeNode.meta.separator ?? 'comma';
312
319
  if (separator !== objectFieldSeparator && (!objectFieldSeparatorOptionalLinebreak || !(objectFieldSeparator.endsWith('-linebreak') && objectFieldSeparator.startsWith(separator))) || (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField || (typeNode.meta.propertyIndent ?? '') !== objectFieldIndent && separator.endsWith('-linebreak') || (/* c8 ignore next 5 -- jsdoc-type-pratt-parser doesn't encode as should */
313
- (typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation && (typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly || !stringify(typeNode).includes('\n')) || !typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly || stringify(typeNode).includes('\n'))))) {
320
+ (typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation && (typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly || !(0, _jsdoccomment.stringify)(typeNode).includes('\n')) || !typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly || (0, _jsdoccomment.stringify)(typeNode).includes('\n'))))) {
314
321
  typeNode.meta.separator = objectFieldSeparatorOptionalLinebreak && !separator.endsWith('and-linebreak') ? objectFieldSeparator.replace(/-and-linebreak$/v, '') : objectFieldSeparator;
315
322
  typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;
316
323
  typeNode.meta.propertyIndent = objectFieldIndent;
@@ -409,7 +416,7 @@ export default iterateJsdoc(({
409
416
  errorMessages.push(errorMessage);
410
417
  }
411
418
  });
412
- const differentResult = tag.type !== typeBracketSpacing + stringify(parsedType) + typeBracketSpacing;
419
+ const differentResult = tag.type !== typeBracketSpacing + (0, _jsdoccomment.stringify)(parsedType) + typeBracketSpacing;
413
420
  if (errorMessages.length && differentResult) {
414
421
  for (const errorMessage of errorMessages) {
415
422
  utils.reportJSDoc(errorMessage, tag, enableFixer ? fix : null);
@@ -596,4 +603,5 @@ to the empty string.`,
596
603
  type: 'suggestion'
597
604
  }
598
605
  });
606
+ module.exports = exports.default;
599
607
  //# sourceMappingURL=typeFormatting.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeFormatting.cjs","names":[],"sources":["../../src/rules/typeFormatting.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n rewireByParsedType,\n} from '../jsdocUtils.js';\nimport {\n parse as parseType,\n stringify,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nconst digitRegex = (/^(\\d+(\\.\\d*)?|\\.\\d+)([eE][\\-+]?\\d+)?$/v);\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n settings,\n utils,\n// eslint-disable-next-line complexity -- Todo\n}) => {\n const {\n arrayBrackets = 'square',\n arrowFunctionPostReturnMarkerSpacing = ' ',\n arrowFunctionPreReturnMarkerSpacing = ' ',\n enableFixer = true,\n functionOrClassParameterSpacing = ' ',\n functionOrClassPostGenericSpacing = '',\n functionOrClassPostReturnMarkerSpacing = ' ',\n functionOrClassPreReturnMarkerSpacing = '',\n functionOrClassTypeParameterSpacing = ' ',\n genericAndTupleElementSpacing = ' ',\n genericDot = false,\n keyValuePostColonSpacing = ' ',\n keyValuePostKeySpacing = '',\n keyValuePostOptionalSpacing = '',\n keyValuePostVariadicSpacing = '',\n methodQuotes = 'double',\n objectFieldIndent = '',\n objectFieldQuote = null,\n objectFieldSeparator = 'comma',\n objectFieldSeparatorOptionalLinebreak = true,\n objectFieldSeparatorTrailingPunctuation = false,\n objectTypeBracketSpacing = '',\n parameterDefaultValueSpacing = ' ',\n postMethodNameSpacing = '',\n postNewSpacing = ' ',\n // propertyQuotes = null,\n separatorForSingleObjectField = false,\n stringQuotes = 'double',\n trailingPunctuationMultilineOnly = false,\n typeBracketSpacing = '',\n unionSpacing = ' ',\n } = context.options[0] || {};\n\n const {\n mode,\n } = settings;\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag\n */\n const checkTypeFormats = (tag) => {\n const potentialType = tag.type;\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode);\n } catch {\n return;\n }\n\n const fix = () => {\n rewireByParsedType(jsdoc, tag, parsedType, indent, typeBracketSpacing);\n };\n\n /** @type {string[]} */\n const errorMessages = [];\n\n if (typeBracketSpacing && (!tag.type.startsWith(typeBracketSpacing) || !tag.type.endsWith(typeBracketSpacing))) {\n errorMessages.push(`Must have initial and final \"${typeBracketSpacing}\" spacing`);\n } else if (!typeBracketSpacing && ((/^\\s/v).test(tag.type) || (/\\s$/v).test(tag.type))) {\n errorMessages.push('Must have no initial spacing');\n }\n\n // eslint-disable-next-line complexity -- Todo\n traverse(parsedType, (nde) => {\n let errorMessage = '';\n\n /**\n * @param {Partial<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }} meta\n * @returns {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }}\n */\n const conditionalAdds = (meta) => {\n const typNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult|\n * import('jsdoc-type-pratt-parser').CallSignatureResult|\n * import('jsdoc-type-pratt-parser').ComputedMethodResult|\n * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|\n * import('jsdoc-type-pratt-parser').MethodSignatureResult\n * }\n */ (nde);\n\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }}\n */\n const newMeta = {\n parameterSpacing: meta.parameterSpacing ?? typNode.meta?.parameterSpacing ?? ' ',\n postGenericSpacing: meta.postGenericSpacing ?? typNode.meta?.postGenericSpacing ?? '',\n postReturnMarkerSpacing: meta.postReturnMarkerSpacing ?? typNode.meta?.postReturnMarkerSpacing ?? ' ',\n preReturnMarkerSpacing: meta.preReturnMarkerSpacing ?? typNode.meta?.preReturnMarkerSpacing ?? '',\n typeParameterSpacing: meta.typeParameterSpacing ?? typNode.meta?.typeParameterSpacing ?? ' ',\n };\n\n if (typNode.type === 'JsdocTypeConstructorSignature') {\n newMeta.postNewSpacing = meta.postNewSpacing;\n }\n\n if (typNode.type === 'JsdocTypeMethodSignature') {\n newMeta.postMethodNameSpacing = meta.postMethodNameSpacing ?? typNode.meta?.postMethodNameSpacing ?? '';\n }\n\n return newMeta;\n };\n\n switch (nde.type) {\n case 'JsdocTypeConstructorSignature': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ConstructorSignatureResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postNewSpacing ?? ' ') !== postNewSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n postNewSpacing,\n }));\n errorMessage = `Post-\\`new\\` spacing should be \"${postNewSpacing}\"`;\n break;\n }\n }\n\n case 'JsdocTypeFunction': {\n const typeNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult}\n */ nde;\n if ('arrow' in typeNode && typeNode.arrow) {\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== arrowFunctionPostReturnMarkerSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n postReturnMarkerSpacing: arrowFunctionPostReturnMarkerSpacing,\n /* c8 ignore next -- Guard */\n preReturnMarkerSpacing: typeNode.meta?.preReturnMarkerSpacing ?? ' ',\n }));\n errorMessage = `Post-return-marker spacing should be \"${arrowFunctionPostReturnMarkerSpacing}\"`;\n break;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.preReturnMarkerSpacing ?? ' ') !== arrowFunctionPreReturnMarkerSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n /* c8 ignore next -- Guard */\n postReturnMarkerSpacing: typeNode.meta?.postReturnMarkerSpacing ?? ' ',\n preReturnMarkerSpacing: arrowFunctionPreReturnMarkerSpacing,\n }));\n errorMessage = `Pre-return-marker spacing should be \"${arrowFunctionPreReturnMarkerSpacing}\"`;\n break;\n }\n\n break;\n }\n }\n\n case 'JsdocTypeCallSignature':\n case 'JsdocTypeComputedMethod':\n case 'JsdocTypeMethodSignature': {\n const typeNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult|\n * import('jsdoc-type-pratt-parser').CallSignatureResult|\n * import('jsdoc-type-pratt-parser').ComputedMethodResult|\n * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|\n * import('jsdoc-type-pratt-parser').MethodSignatureResult\n * }\n */ (nde);\n if (typeNode.type === 'JsdocTypeMethodSignature' &&\n (typeNode.meta?.postMethodNameSpacing ?? '') !== postMethodNameSpacing\n ) {\n typeNode.meta = {\n quote: typeNode.meta.quote,\n ...conditionalAdds({\n postMethodNameSpacing,\n }),\n };\n errorMessage = `Post-method-name spacing should be \"${postMethodNameSpacing}\"`;\n break;\n } else if (typeNode.type === 'JsdocTypeMethodSignature' &&\n typeNode.meta.quote !== undefined &&\n typeNode.meta.quote !== methodQuotes\n ) {\n typeNode.meta = {\n ...conditionalAdds({\n postMethodNameSpacing: typeNode.meta.postMethodNameSpacing ?? '',\n }),\n quote: methodQuotes,\n };\n errorMessage = `Method quoting style should be \"${methodQuotes}\"`;\n break;\n }\n\n if ((typeNode.meta?.parameterSpacing ?? ' ') !== functionOrClassParameterSpacing) {\n typeNode.meta = conditionalAdds({\n parameterSpacing: functionOrClassParameterSpacing,\n });\n errorMessage = `Parameter spacing should be \"${functionOrClassParameterSpacing}\"`;\n } else if ((typeNode.meta?.postGenericSpacing ?? '') !== functionOrClassPostGenericSpacing) {\n typeNode.meta = conditionalAdds({\n postGenericSpacing: functionOrClassPostGenericSpacing,\n });\n errorMessage = `Post-generic spacing should be \"${functionOrClassPostGenericSpacing}\"`;\n } else if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== functionOrClassPostReturnMarkerSpacing) {\n typeNode.meta = conditionalAdds({\n postReturnMarkerSpacing: functionOrClassPostReturnMarkerSpacing,\n });\n errorMessage = `Post-return-marker spacing should be \"${functionOrClassPostReturnMarkerSpacing}\"`;\n } else if ((typeNode.meta?.preReturnMarkerSpacing ?? '') !== functionOrClassPreReturnMarkerSpacing) {\n typeNode.meta = conditionalAdds({\n preReturnMarkerSpacing: functionOrClassPreReturnMarkerSpacing,\n });\n errorMessage = `Pre-return-marker spacing should be \"${functionOrClassPreReturnMarkerSpacing}\"`;\n } else if ((typeNode.meta?.typeParameterSpacing ?? ' ') !== functionOrClassTypeParameterSpacing) {\n typeNode.meta = conditionalAdds({\n typeParameterSpacing: functionOrClassTypeParameterSpacing,\n });\n errorMessage = `Type parameter spacing should be \"${functionOrClassTypeParameterSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeGeneric': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').GenericResult} */ (nde);\n if ('value' in typeNode.left && typeNode.left.value === 'Array') {\n if (typeNode.meta.brackets !== arrayBrackets) {\n typeNode.meta.brackets = arrayBrackets;\n errorMessage = `Array bracket style should be ${arrayBrackets}`;\n }\n } else if (typeNode.meta.dot !== genericDot) {\n typeNode.meta.dot = genericDot;\n errorMessage = `Dot usage should be ${genericDot}`;\n } else if ((typeNode.meta.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {\n typeNode.meta.elementSpacing = genericAndTupleElementSpacing;\n errorMessage = `Element spacing should be \"${genericAndTupleElementSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeKeyValue': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').KeyValueResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {\n typeNode.meta = {\n /* c8 ignore next -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: keyValuePostKeySpacing,\n /* c8 ignore next 2 -- Guard */\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post key spacing should be \"${keyValuePostKeySpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {\n typeNode.meta = {\n postColonSpacing: keyValuePostColonSpacing,\n /* c8 ignore next 3 -- Guard */\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post colon spacing should be \"${keyValuePostColonSpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {\n typeNode.meta = {\n /* c8 ignore next 2 -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: keyValuePostOptionalSpacing,\n /* c8 ignore next -- Guard */\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post optional (\\`?\\`) spacing should be \"${keyValuePostOptionalSpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if (typeNode.variadic && (typeNode.meta?.postVariadicSpacing ?? '') !== keyValuePostVariadicSpacing) {\n typeNode.meta = {\n /* c8 ignore next 3 -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: keyValuePostVariadicSpacing,\n };\n errorMessage = `Post variadic (\\`...\\`) spacing should be \"${keyValuePostVariadicSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeObject': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */ (nde);\n /* c8 ignore next -- Guard */\n const separator = typeNode.meta.separator ?? 'comma';\n\n if (\n (separator !== objectFieldSeparator &&\n (!objectFieldSeparatorOptionalLinebreak ||\n !(objectFieldSeparator.endsWith('-linebreak') &&\n objectFieldSeparator.startsWith(separator)))) ||\n (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField ||\n ((typeNode.meta.propertyIndent ?? '') !== objectFieldIndent &&\n separator.endsWith('-linebreak')) ||\n /* c8 ignore next 5 -- jsdoc-type-pratt-parser doesn't encode as should */\n ((typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation &&\n ((typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly ||\n !stringify(typeNode).includes('\\n'))) ||\n (!typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly ||\n stringify(typeNode).includes('\\n')))))\n ) {\n typeNode.meta.separator = objectFieldSeparatorOptionalLinebreak && !separator.endsWith('and-linebreak') ?\n objectFieldSeparator.replace(/-and-linebreak$/v, '') :\n objectFieldSeparator;\n typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;\n typeNode.meta.propertyIndent = objectFieldIndent;\n typeNode.meta.trailingPunctuation = objectFieldSeparatorTrailingPunctuation;\n errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;\n } else if ((typeNode.meta.bracketSpacing ?? '') !== objectTypeBracketSpacing) {\n typeNode.meta.bracketSpacing = objectTypeBracketSpacing;\n // This might not be the cause\n // errorMessage = `Object type bracket spacing should be \"${objectTypeBracketSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeObjectField': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectFieldResult} */ (nde);\n if ((objectFieldQuote ||\n (typeof typeNode.key === 'string' &&\n (\n (/^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/v).test(typeNode.key) ||\n digitRegex.test(typeNode.key)\n )\n )) &&\n typeNode.meta.quote !== (objectFieldQuote ?? undefined) &&\n (typeof typeNode.key !== 'string' ||\n !digitRegex.test(typeNode.key))\n ) {\n typeNode.meta.quote = objectFieldQuote ?? undefined;\n errorMessage = `Inconsistent object field quotes ${objectFieldQuote}`;\n } else if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {\n typeNode.meta.postKeySpacing = keyValuePostKeySpacing;\n errorMessage = `Post key spacing should be \"${keyValuePostKeySpacing}\"`;\n } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {\n typeNode.meta.postColonSpacing = keyValuePostColonSpacing;\n errorMessage = `Post colon spacing should be \"${keyValuePostColonSpacing}\"`;\n } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {\n typeNode.meta.postOptionalSpacing = keyValuePostOptionalSpacing;\n errorMessage = `Post optional (\\`?\\`) spacing should be \"${keyValuePostOptionalSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeStringValue': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */ (nde);\n if (typeNode.meta.quote !== stringQuotes) {\n typeNode.meta.quote = stringQuotes;\n errorMessage = `Inconsistent ${stringQuotes} string quotes usage`;\n }\n\n break;\n }\n\n // Only suitable for namepaths (and would need changes); see https://github.com/gajus/eslint-plugin-jsdoc/issues/1524\n // case 'JsdocTypeProperty': {\n // const typeNode = /** @type {import('jsdoc-type-pratt-parser').PropertyResult} */ (nde);\n\n // if ((propertyQuotes ||\n // (typeof typeNode.value === 'string' && !(/\\s/v).test(typeNode.value))) &&\n // typeNode.meta.quote !== (propertyQuotes ?? undefined)\n // ) {\n // typeNode.meta.quote = propertyQuotes ?? undefined;\n // errorMessage = `Inconsistent ${propertyQuotes} property quotes usage`;\n // }\n\n // break;\n // }\n\n case 'JsdocTypeTuple': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').TupleResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {\n typeNode.meta = {\n elementSpacing: genericAndTupleElementSpacing,\n };\n errorMessage = `Element spacing should be \"${genericAndTupleElementSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeTypeParameter': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').TypeParameterResult} */ (nde);\n /* c8 ignore next -- Guard */\n if (typeNode.defaultValue && (typeNode.meta?.defaultValueSpacing ?? ' ') !== parameterDefaultValueSpacing) {\n typeNode.meta = {\n defaultValueSpacing: parameterDefaultValueSpacing,\n };\n errorMessage = `Default value spacing should be \"${parameterDefaultValueSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeUnion': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').UnionResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.spacing ?? ' ') !== unionSpacing) {\n typeNode.meta = {\n spacing: unionSpacing,\n };\n errorMessage = `Inconsistent \"${unionSpacing}\" union spacing usage`;\n }\n\n break;\n }\n\n default:\n break;\n }\n\n if (errorMessage) {\n errorMessages.push(errorMessage);\n }\n });\n\n const differentResult = tag.type !==\n typeBracketSpacing + stringify(parsedType) + typeBracketSpacing;\n\n if (errorMessages.length && differentResult) {\n for (const errorMessage of errorMessages) {\n utils.reportJSDoc(\n errorMessage, tag, enableFixer ? fix : null,\n );\n }\n // Stringification may have been equal previously (and thus no error reported)\n // because the stringification doesn't preserve everything\n } else if (differentResult) {\n utils.reportJSDoc(\n 'There was an error with type formatting', tag, enableFixer ? fix : null,\n );\n }\n };\n\n const tags = utils.getPresentTags([\n 'param',\n 'property',\n 'returns',\n 'this',\n 'throws',\n 'type',\n 'typedef',\n 'yields',\n ]);\n for (const tag of tags) {\n if (tag.type) {\n checkTypeFormats(tag);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Formats JSDoc type values.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n arrayBrackets: {\n description: 'Determines how array generics are represented. Set to `angle` for the style `Array<type>` or `square` for the style `type[]`. Defaults to \"square\".',\n enum: [\n 'angle',\n 'square',\n ],\n type: 'string',\n },\n arrowFunctionPostReturnMarkerSpacing: {\n description: 'The space character (if any) to use after return markers (`=>`). Defaults to \" \".',\n type: 'string',\n },\n arrowFunctionPreReturnMarkerSpacing: {\n description: 'The space character (if any) to use before return markers (`=>`). Defaults to \" \".',\n type: 'string',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n functionOrClassParameterSpacing: {\n description: 'The space character (if any) to use between function or class parameters. Defaults to \" \".',\n type: 'string',\n },\n functionOrClassPostGenericSpacing: {\n description: 'The space character (if any) to use after a generic expression in a function or class. Defaults to \"\".',\n type: 'string',\n },\n functionOrClassPostReturnMarkerSpacing: {\n description: 'The space character (if any) to use after return markers (`:`). Defaults to \"\".',\n type: 'string',\n },\n functionOrClassPreReturnMarkerSpacing: {\n description: 'The space character (if any) to use before return markers (`:`). Defaults to \"\".',\n type: 'string',\n },\n functionOrClassTypeParameterSpacing: {\n description: 'The space character (if any) to use between type parameters in a function or class. Defaults to \" \".',\n type: 'string',\n },\n genericAndTupleElementSpacing: {\n description: 'The space character (if any) to use between elements in generics and tuples. Defaults to \" \".',\n type: 'string',\n },\n genericDot: {\n description: 'Boolean value of whether to use a dot before the angled brackets of a generic (e.g., `SomeType.<AnotherType>`). Defaults to `false`.',\n type: 'boolean',\n },\n keyValuePostColonSpacing: {\n description: 'The amount of spacing (if any) after the colon of a key-value or object-field pair. Defaults to \" \".',\n type: 'string',\n },\n keyValuePostKeySpacing: {\n description: 'The amount of spacing (if any) immediately after keys in a key-value or object-field pair. Defaults to \"\".',\n type: 'string',\n },\n keyValuePostOptionalSpacing: {\n description: 'The amount of spacing (if any) after the optional operator (`?`) in a key-value or object-field pair. Defaults to \"\".',\n type: 'string',\n },\n keyValuePostVariadicSpacing: {\n description: 'The amount of spacing (if any) after a variadic operator (`...`) in a key-value pair. Defaults to \"\".',\n type: 'string',\n },\n methodQuotes: {\n description: 'The style of quotation mark for surrounding method names when quoted. Defaults to `double`',\n enum: [\n 'double',\n 'single',\n ],\n type: 'string',\n },\n objectFieldIndent: {\n description: `A string indicating the whitespace to be added on each line preceding an\nobject property-value field. Defaults to the empty string.`,\n type: 'string',\n },\n objectFieldQuote: {\n description: `Whether and how object field properties should be quoted (e.g., \\`{\"a\": string}\\`).\nSet to \\`single\\`, \\`double\\`, or \\`null\\`. Defaults to \\`null\\` (no quotes unless\nrequired due to special characters within the field). Digits will be kept as is,\nregardless of setting (they can either represent a digit or a string digit).`,\n enum: [\n 'double',\n 'single',\n null,\n ],\n },\n objectFieldSeparator: {\n description: `For object properties, specify whether a \"semicolon\", \"comma\", \"linebreak\",\n\"semicolon-and-linebreak\", or \"comma-and-linebreak\" should be used after\neach object property-value pair.\n\nDefaults to \\`\"comma\"\\`.`,\n enum: [\n 'comma',\n 'comma-and-linebreak',\n 'linebreak',\n 'semicolon',\n 'semicolon-and-linebreak',\n ],\n type: 'string',\n },\n objectFieldSeparatorOptionalLinebreak: {\n description: `Whether \\`objectFieldSeparator\\` set to \\`\"semicolon-and-linebreak\"\\` or\n\\`\"comma-and-linebreak\"\\` should be allowed to optionally drop the linebreak.\n\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n objectFieldSeparatorTrailingPunctuation: {\n description: `If \\`separatorForSingleObjectField\\` is not in effect (i.e., if it is \\`false\\`\nor there are multiple property-value object fields present), this property\nwill determine whether to add punctuation corresponding to the\n\\`objectFieldSeparator\\` (e.g., a semicolon) to the final object field.\nDefaults to \\`false\\`.`,\n type: 'boolean',\n },\n objectTypeBracketSpacing: {\n description: 'The space character (if any) to add after an object\\'s initial curly bracket and before its ending curly bracket',\n type: 'string',\n },\n parameterDefaultValueSpacing: {\n description: 'The space character (if any) to use between the equal signs of a default value. Defaults to \" \".',\n type: 'string',\n },\n postMethodNameSpacing: {\n description: 'The space character (if any) to add after a method name. Defaults to \"\".',\n type: 'string',\n },\n postNewSpacing: {\n description: 'The space character (if any) to add after \"new\" in a constructor. Defaults to \" \".',\n type: 'string',\n },\n // propertyQuotes: {\n // description: `Whether and how namepath properties should be quoted (e.g., \\`ab.\"cd\".\"ef\"\\`).\n // Set to \\`single\\`, \\`double\\`, or \\`null\\`. Defaults to \\`null\\` (no quotes unless\n // required due to whitespace within the property).`,\n // enum: [\n // 'double',\n // 'single',\n // null,\n // ],\n // },\n separatorForSingleObjectField: {\n description: `Whether to apply the \\`objectFieldSeparator\\` (e.g., a semicolon) when there\nis only one property-value object field present. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n stringQuotes: {\n description: `How string literals should be quoted (e.g., \\`\"abc\"\\`). Set to \\`single\\`\nor \\`double\\`. Defaults to 'double'.`,\n enum: [\n 'double',\n 'single',\n ],\n type: 'string',\n },\n trailingPunctuationMultilineOnly: {\n description: 'If `objectFieldSeparatorTrailingPunctuation` is set, this will determine whether the trailing puncutation is only added when the type is multiline',\n type: 'boolean',\n },\n typeBracketSpacing: {\n description: `A string of spaces that will be added immediately after the type's initial\ncurly bracket and immediately before its ending curly bracket. Defaults\nto the empty string.`,\n type: 'string',\n },\n unionSpacing: {\n description: 'Determines the spacing to add to unions (`|`). Defaults to a single space (`\" \"`).',\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB;AAC7C,SACE,kBAAkB,QACb,kBAAkB;AACzB,SACE,KAAK,IAAI,SAAS,EAClB,SAAS,EACT,QAAQ,EACR,QAAQ,IAAI,YAAY,QACnB,sBAAsB;AAE7B,MAA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AACA;AACA,yBAAyB;UACb,IAAI,EAAE,CACJ,OAAO,EACP,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,yBAAyB,CAC1B;UACD,IAAI,EAAE;QACR,CAAC;QACD,qCAAqC,EAAE;UACrC,WAAW,EAAE;AACzB;AACA;AACA,sBAAsB;UACV,IAAI,EAAE;QACR,CAAC;QACD,uCAAuC,EAAE;UACvC,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACX,IAAI,EAAE;QACR,CAAC;QACD,wBAAwB,EAAE;UACxB,WAAW,EAAE,kHAAkH;UAC/H,IAAI,EAAE;QACR,CAAC;QACD,4BAA4B,EAAE;UAC5B,WAAW,EAAE,kGAAkG;UAC/G,IAAI,EAAE;QACR,CAAC;QACD,qBAAqB,EAAE;UACrB,WAAW,EAAE,0EAA0E;UACvF,IAAI,EAAE;QACR,CAAC;QACD,cAAc,EAAE;UACd,WAAW,EAAE,oFAAoF;UACjG,IAAI,EAAE;QACR,CAAC;QACD;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,6BAA6B,EAAE;UAC7B,WAAW,EAAE;AACzB,wEAAwE;UAC5D,IAAI,EAAE;QACR,CAAC;QACD,YAAY,EAAE;UACZ,WAAW,EAAE;AACzB,qCAAqC;UACzB,IAAI,EAAE,CACJ,QAAQ,EACR,QAAQ,CACT;UACD,IAAI,EAAE;QACR,CAAC;QACD,gCAAgC,EAAE;UAChC,WAAW,EAAE,oJAAoJ;UACjK,IAAI,EAAE;QACR,CAAC;QACD,kBAAkB,EAAE;UAClB,WAAW,EAAE;AACzB;AACA,qBAAqB;UACT,IAAI,EAAE;QACR,CAAC;QACD,YAAY,EAAE;UACZ,WAAW,EAAE,oFAAoF;UACjG,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"typeFormatting.cjs","names":["iterateJsdoc","tryParseType","parseType","rewireByParsedType","traverse","stringify"],"sources":["../../src/rules/typeFormatting.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n rewireByParsedType,\n} from '../jsdocUtils.js';\nimport {\n parse as parseType,\n stringify,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nconst digitRegex = (/^(\\d+(\\.\\d*)?|\\.\\d+)([eE][\\-+]?\\d+)?$/v);\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n settings,\n utils,\n// eslint-disable-next-line complexity -- Todo\n}) => {\n const {\n arrayBrackets = 'square',\n arrowFunctionPostReturnMarkerSpacing = ' ',\n arrowFunctionPreReturnMarkerSpacing = ' ',\n enableFixer = true,\n functionOrClassParameterSpacing = ' ',\n functionOrClassPostGenericSpacing = '',\n functionOrClassPostReturnMarkerSpacing = ' ',\n functionOrClassPreReturnMarkerSpacing = '',\n functionOrClassTypeParameterSpacing = ' ',\n genericAndTupleElementSpacing = ' ',\n genericDot = false,\n keyValuePostColonSpacing = ' ',\n keyValuePostKeySpacing = '',\n keyValuePostOptionalSpacing = '',\n keyValuePostVariadicSpacing = '',\n methodQuotes = 'double',\n objectFieldIndent = '',\n objectFieldQuote = null,\n objectFieldSeparator = 'comma',\n objectFieldSeparatorOptionalLinebreak = true,\n objectFieldSeparatorTrailingPunctuation = false,\n objectTypeBracketSpacing = '',\n parameterDefaultValueSpacing = ' ',\n postMethodNameSpacing = '',\n postNewSpacing = ' ',\n // propertyQuotes = null,\n separatorForSingleObjectField = false,\n stringQuotes = 'double',\n trailingPunctuationMultilineOnly = false,\n typeBracketSpacing = '',\n unionSpacing = ' ',\n } = context.options[0] || {};\n\n const {\n mode,\n } = settings;\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag\n */\n const checkTypeFormats = (tag) => {\n const potentialType = tag.type;\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode);\n } catch {\n return;\n }\n\n const fix = () => {\n rewireByParsedType(jsdoc, tag, parsedType, indent, typeBracketSpacing);\n };\n\n /** @type {string[]} */\n const errorMessages = [];\n\n if (typeBracketSpacing && (!tag.type.startsWith(typeBracketSpacing) || !tag.type.endsWith(typeBracketSpacing))) {\n errorMessages.push(`Must have initial and final \"${typeBracketSpacing}\" spacing`);\n } else if (!typeBracketSpacing && ((/^\\s/v).test(tag.type) || (/\\s$/v).test(tag.type))) {\n errorMessages.push('Must have no initial spacing');\n }\n\n // eslint-disable-next-line complexity -- Todo\n traverse(parsedType, (nde) => {\n let errorMessage = '';\n\n /**\n * @param {Partial<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }} meta\n * @returns {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }}\n */\n const conditionalAdds = (meta) => {\n const typNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult|\n * import('jsdoc-type-pratt-parser').CallSignatureResult|\n * import('jsdoc-type-pratt-parser').ComputedMethodResult|\n * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|\n * import('jsdoc-type-pratt-parser').MethodSignatureResult\n * }\n */ (nde);\n\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }}\n */\n const newMeta = {\n parameterSpacing: meta.parameterSpacing ?? typNode.meta?.parameterSpacing ?? ' ',\n postGenericSpacing: meta.postGenericSpacing ?? typNode.meta?.postGenericSpacing ?? '',\n postReturnMarkerSpacing: meta.postReturnMarkerSpacing ?? typNode.meta?.postReturnMarkerSpacing ?? ' ',\n preReturnMarkerSpacing: meta.preReturnMarkerSpacing ?? typNode.meta?.preReturnMarkerSpacing ?? '',\n typeParameterSpacing: meta.typeParameterSpacing ?? typNode.meta?.typeParameterSpacing ?? ' ',\n };\n\n if (typNode.type === 'JsdocTypeConstructorSignature') {\n newMeta.postNewSpacing = meta.postNewSpacing;\n }\n\n if (typNode.type === 'JsdocTypeMethodSignature') {\n newMeta.postMethodNameSpacing = meta.postMethodNameSpacing ?? typNode.meta?.postMethodNameSpacing ?? '';\n }\n\n return newMeta;\n };\n\n switch (nde.type) {\n case 'JsdocTypeConstructorSignature': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ConstructorSignatureResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postNewSpacing ?? ' ') !== postNewSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n postNewSpacing,\n }));\n errorMessage = `Post-\\`new\\` spacing should be \"${postNewSpacing}\"`;\n break;\n }\n }\n\n case 'JsdocTypeFunction': {\n const typeNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult}\n */ nde;\n if ('arrow' in typeNode && typeNode.arrow) {\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== arrowFunctionPostReturnMarkerSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n postReturnMarkerSpacing: arrowFunctionPostReturnMarkerSpacing,\n /* c8 ignore next -- Guard */\n preReturnMarkerSpacing: typeNode.meta?.preReturnMarkerSpacing ?? ' ',\n }));\n errorMessage = `Post-return-marker spacing should be \"${arrowFunctionPostReturnMarkerSpacing}\"`;\n break;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.preReturnMarkerSpacing ?? ' ') !== arrowFunctionPreReturnMarkerSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n /* c8 ignore next -- Guard */\n postReturnMarkerSpacing: typeNode.meta?.postReturnMarkerSpacing ?? ' ',\n preReturnMarkerSpacing: arrowFunctionPreReturnMarkerSpacing,\n }));\n errorMessage = `Pre-return-marker spacing should be \"${arrowFunctionPreReturnMarkerSpacing}\"`;\n break;\n }\n\n break;\n }\n }\n\n case 'JsdocTypeCallSignature':\n case 'JsdocTypeComputedMethod':\n case 'JsdocTypeMethodSignature': {\n const typeNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult|\n * import('jsdoc-type-pratt-parser').CallSignatureResult|\n * import('jsdoc-type-pratt-parser').ComputedMethodResult|\n * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|\n * import('jsdoc-type-pratt-parser').MethodSignatureResult\n * }\n */ (nde);\n if (typeNode.type === 'JsdocTypeMethodSignature' &&\n (typeNode.meta?.postMethodNameSpacing ?? '') !== postMethodNameSpacing\n ) {\n typeNode.meta = {\n quote: typeNode.meta.quote,\n ...conditionalAdds({\n postMethodNameSpacing,\n }),\n };\n errorMessage = `Post-method-name spacing should be \"${postMethodNameSpacing}\"`;\n break;\n } else if (typeNode.type === 'JsdocTypeMethodSignature' &&\n typeNode.meta.quote !== undefined &&\n typeNode.meta.quote !== methodQuotes\n ) {\n typeNode.meta = {\n ...conditionalAdds({\n postMethodNameSpacing: typeNode.meta.postMethodNameSpacing ?? '',\n }),\n quote: methodQuotes,\n };\n errorMessage = `Method quoting style should be \"${methodQuotes}\"`;\n break;\n }\n\n if ((typeNode.meta?.parameterSpacing ?? ' ') !== functionOrClassParameterSpacing) {\n typeNode.meta = conditionalAdds({\n parameterSpacing: functionOrClassParameterSpacing,\n });\n errorMessage = `Parameter spacing should be \"${functionOrClassParameterSpacing}\"`;\n } else if ((typeNode.meta?.postGenericSpacing ?? '') !== functionOrClassPostGenericSpacing) {\n typeNode.meta = conditionalAdds({\n postGenericSpacing: functionOrClassPostGenericSpacing,\n });\n errorMessage = `Post-generic spacing should be \"${functionOrClassPostGenericSpacing}\"`;\n } else if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== functionOrClassPostReturnMarkerSpacing) {\n typeNode.meta = conditionalAdds({\n postReturnMarkerSpacing: functionOrClassPostReturnMarkerSpacing,\n });\n errorMessage = `Post-return-marker spacing should be \"${functionOrClassPostReturnMarkerSpacing}\"`;\n } else if ((typeNode.meta?.preReturnMarkerSpacing ?? '') !== functionOrClassPreReturnMarkerSpacing) {\n typeNode.meta = conditionalAdds({\n preReturnMarkerSpacing: functionOrClassPreReturnMarkerSpacing,\n });\n errorMessage = `Pre-return-marker spacing should be \"${functionOrClassPreReturnMarkerSpacing}\"`;\n } else if ((typeNode.meta?.typeParameterSpacing ?? ' ') !== functionOrClassTypeParameterSpacing) {\n typeNode.meta = conditionalAdds({\n typeParameterSpacing: functionOrClassTypeParameterSpacing,\n });\n errorMessage = `Type parameter spacing should be \"${functionOrClassTypeParameterSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeGeneric': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').GenericResult} */ (nde);\n if ('value' in typeNode.left && typeNode.left.value === 'Array') {\n if (typeNode.meta.brackets !== arrayBrackets) {\n typeNode.meta.brackets = arrayBrackets;\n errorMessage = `Array bracket style should be ${arrayBrackets}`;\n }\n } else if (typeNode.meta.dot !== genericDot) {\n typeNode.meta.dot = genericDot;\n errorMessage = `Dot usage should be ${genericDot}`;\n } else if ((typeNode.meta.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {\n typeNode.meta.elementSpacing = genericAndTupleElementSpacing;\n errorMessage = `Element spacing should be \"${genericAndTupleElementSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeKeyValue': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').KeyValueResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {\n typeNode.meta = {\n /* c8 ignore next -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: keyValuePostKeySpacing,\n /* c8 ignore next 2 -- Guard */\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post key spacing should be \"${keyValuePostKeySpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {\n typeNode.meta = {\n postColonSpacing: keyValuePostColonSpacing,\n /* c8 ignore next 3 -- Guard */\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post colon spacing should be \"${keyValuePostColonSpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {\n typeNode.meta = {\n /* c8 ignore next 2 -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: keyValuePostOptionalSpacing,\n /* c8 ignore next -- Guard */\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post optional (\\`?\\`) spacing should be \"${keyValuePostOptionalSpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if (typeNode.variadic && (typeNode.meta?.postVariadicSpacing ?? '') !== keyValuePostVariadicSpacing) {\n typeNode.meta = {\n /* c8 ignore next 3 -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: keyValuePostVariadicSpacing,\n };\n errorMessage = `Post variadic (\\`...\\`) spacing should be \"${keyValuePostVariadicSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeObject': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */ (nde);\n /* c8 ignore next -- Guard */\n const separator = typeNode.meta.separator ?? 'comma';\n\n if (\n (separator !== objectFieldSeparator &&\n (!objectFieldSeparatorOptionalLinebreak ||\n !(objectFieldSeparator.endsWith('-linebreak') &&\n objectFieldSeparator.startsWith(separator)))) ||\n (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField ||\n ((typeNode.meta.propertyIndent ?? '') !== objectFieldIndent &&\n separator.endsWith('-linebreak')) ||\n /* c8 ignore next 5 -- jsdoc-type-pratt-parser doesn't encode as should */\n ((typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation &&\n ((typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly ||\n !stringify(typeNode).includes('\\n'))) ||\n (!typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly ||\n stringify(typeNode).includes('\\n')))))\n ) {\n typeNode.meta.separator = objectFieldSeparatorOptionalLinebreak && !separator.endsWith('and-linebreak') ?\n objectFieldSeparator.replace(/-and-linebreak$/v, '') :\n objectFieldSeparator;\n typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;\n typeNode.meta.propertyIndent = objectFieldIndent;\n typeNode.meta.trailingPunctuation = objectFieldSeparatorTrailingPunctuation;\n errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;\n } else if ((typeNode.meta.bracketSpacing ?? '') !== objectTypeBracketSpacing) {\n typeNode.meta.bracketSpacing = objectTypeBracketSpacing;\n // This might not be the cause\n // errorMessage = `Object type bracket spacing should be \"${objectTypeBracketSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeObjectField': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectFieldResult} */ (nde);\n if ((objectFieldQuote ||\n (typeof typeNode.key === 'string' &&\n (\n (/^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/v).test(typeNode.key) ||\n digitRegex.test(typeNode.key)\n )\n )) &&\n typeNode.meta.quote !== (objectFieldQuote ?? undefined) &&\n (typeof typeNode.key !== 'string' ||\n !digitRegex.test(typeNode.key))\n ) {\n typeNode.meta.quote = objectFieldQuote ?? undefined;\n errorMessage = `Inconsistent object field quotes ${objectFieldQuote}`;\n } else if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {\n typeNode.meta.postKeySpacing = keyValuePostKeySpacing;\n errorMessage = `Post key spacing should be \"${keyValuePostKeySpacing}\"`;\n } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {\n typeNode.meta.postColonSpacing = keyValuePostColonSpacing;\n errorMessage = `Post colon spacing should be \"${keyValuePostColonSpacing}\"`;\n } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {\n typeNode.meta.postOptionalSpacing = keyValuePostOptionalSpacing;\n errorMessage = `Post optional (\\`?\\`) spacing should be \"${keyValuePostOptionalSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeStringValue': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */ (nde);\n if (typeNode.meta.quote !== stringQuotes) {\n typeNode.meta.quote = stringQuotes;\n errorMessage = `Inconsistent ${stringQuotes} string quotes usage`;\n }\n\n break;\n }\n\n // Only suitable for namepaths (and would need changes); see https://github.com/gajus/eslint-plugin-jsdoc/issues/1524\n // case 'JsdocTypeProperty': {\n // const typeNode = /** @type {import('jsdoc-type-pratt-parser').PropertyResult} */ (nde);\n\n // if ((propertyQuotes ||\n // (typeof typeNode.value === 'string' && !(/\\s/v).test(typeNode.value))) &&\n // typeNode.meta.quote !== (propertyQuotes ?? undefined)\n // ) {\n // typeNode.meta.quote = propertyQuotes ?? undefined;\n // errorMessage = `Inconsistent ${propertyQuotes} property quotes usage`;\n // }\n\n // break;\n // }\n\n case 'JsdocTypeTuple': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').TupleResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {\n typeNode.meta = {\n elementSpacing: genericAndTupleElementSpacing,\n };\n errorMessage = `Element spacing should be \"${genericAndTupleElementSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeTypeParameter': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').TypeParameterResult} */ (nde);\n /* c8 ignore next -- Guard */\n if (typeNode.defaultValue && (typeNode.meta?.defaultValueSpacing ?? ' ') !== parameterDefaultValueSpacing) {\n typeNode.meta = {\n defaultValueSpacing: parameterDefaultValueSpacing,\n };\n errorMessage = `Default value spacing should be \"${parameterDefaultValueSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeUnion': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').UnionResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.spacing ?? ' ') !== unionSpacing) {\n typeNode.meta = {\n spacing: unionSpacing,\n };\n errorMessage = `Inconsistent \"${unionSpacing}\" union spacing usage`;\n }\n\n break;\n }\n\n default:\n break;\n }\n\n if (errorMessage) {\n errorMessages.push(errorMessage);\n }\n });\n\n const differentResult = tag.type !==\n typeBracketSpacing + stringify(parsedType) + typeBracketSpacing;\n\n if (errorMessages.length && differentResult) {\n for (const errorMessage of errorMessages) {\n utils.reportJSDoc(\n errorMessage, tag, enableFixer ? fix : null,\n );\n }\n // Stringification may have been equal previously (and thus no error reported)\n // because the stringification doesn't preserve everything\n } else if (differentResult) {\n utils.reportJSDoc(\n 'There was an error with type formatting', tag, enableFixer ? fix : null,\n );\n }\n };\n\n const tags = utils.getPresentTags([\n 'param',\n 'property',\n 'returns',\n 'this',\n 'throws',\n 'type',\n 'typedef',\n 'yields',\n ]);\n for (const tag of tags) {\n if (tag.type) {\n checkTypeFormats(tag);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Formats JSDoc type values.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n arrayBrackets: {\n description: 'Determines how array generics are represented. Set to `angle` for the style `Array<type>` or `square` for the style `type[]`. Defaults to \"square\".',\n enum: [\n 'angle',\n 'square',\n ],\n type: 'string',\n },\n arrowFunctionPostReturnMarkerSpacing: {\n description: 'The space character (if any) to use after return markers (`=>`). Defaults to \" \".',\n type: 'string',\n },\n arrowFunctionPreReturnMarkerSpacing: {\n description: 'The space character (if any) to use before return markers (`=>`). Defaults to \" \".',\n type: 'string',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n functionOrClassParameterSpacing: {\n description: 'The space character (if any) to use between function or class parameters. Defaults to \" \".',\n type: 'string',\n },\n functionOrClassPostGenericSpacing: {\n description: 'The space character (if any) to use after a generic expression in a function or class. Defaults to \"\".',\n type: 'string',\n },\n functionOrClassPostReturnMarkerSpacing: {\n description: 'The space character (if any) to use after return markers (`:`). Defaults to \"\".',\n type: 'string',\n },\n functionOrClassPreReturnMarkerSpacing: {\n description: 'The space character (if any) to use before return markers (`:`). Defaults to \"\".',\n type: 'string',\n },\n functionOrClassTypeParameterSpacing: {\n description: 'The space character (if any) to use between type parameters in a function or class. Defaults to \" \".',\n type: 'string',\n },\n genericAndTupleElementSpacing: {\n description: 'The space character (if any) to use between elements in generics and tuples. Defaults to \" \".',\n type: 'string',\n },\n genericDot: {\n description: 'Boolean value of whether to use a dot before the angled brackets of a generic (e.g., `SomeType.<AnotherType>`). Defaults to `false`.',\n type: 'boolean',\n },\n keyValuePostColonSpacing: {\n description: 'The amount of spacing (if any) after the colon of a key-value or object-field pair. Defaults to \" \".',\n type: 'string',\n },\n keyValuePostKeySpacing: {\n description: 'The amount of spacing (if any) immediately after keys in a key-value or object-field pair. Defaults to \"\".',\n type: 'string',\n },\n keyValuePostOptionalSpacing: {\n description: 'The amount of spacing (if any) after the optional operator (`?`) in a key-value or object-field pair. Defaults to \"\".',\n type: 'string',\n },\n keyValuePostVariadicSpacing: {\n description: 'The amount of spacing (if any) after a variadic operator (`...`) in a key-value pair. Defaults to \"\".',\n type: 'string',\n },\n methodQuotes: {\n description: 'The style of quotation mark for surrounding method names when quoted. Defaults to `double`',\n enum: [\n 'double',\n 'single',\n ],\n type: 'string',\n },\n objectFieldIndent: {\n description: `A string indicating the whitespace to be added on each line preceding an\nobject property-value field. Defaults to the empty string.`,\n type: 'string',\n },\n objectFieldQuote: {\n description: `Whether and how object field properties should be quoted (e.g., \\`{\"a\": string}\\`).\nSet to \\`single\\`, \\`double\\`, or \\`null\\`. Defaults to \\`null\\` (no quotes unless\nrequired due to special characters within the field). Digits will be kept as is,\nregardless of setting (they can either represent a digit or a string digit).`,\n enum: [\n 'double',\n 'single',\n null,\n ],\n },\n objectFieldSeparator: {\n description: `For object properties, specify whether a \"semicolon\", \"comma\", \"linebreak\",\n\"semicolon-and-linebreak\", or \"comma-and-linebreak\" should be used after\neach object property-value pair.\n\nDefaults to \\`\"comma\"\\`.`,\n enum: [\n 'comma',\n 'comma-and-linebreak',\n 'linebreak',\n 'semicolon',\n 'semicolon-and-linebreak',\n ],\n type: 'string',\n },\n objectFieldSeparatorOptionalLinebreak: {\n description: `Whether \\`objectFieldSeparator\\` set to \\`\"semicolon-and-linebreak\"\\` or\n\\`\"comma-and-linebreak\"\\` should be allowed to optionally drop the linebreak.\n\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n objectFieldSeparatorTrailingPunctuation: {\n description: `If \\`separatorForSingleObjectField\\` is not in effect (i.e., if it is \\`false\\`\nor there are multiple property-value object fields present), this property\nwill determine whether to add punctuation corresponding to the\n\\`objectFieldSeparator\\` (e.g., a semicolon) to the final object field.\nDefaults to \\`false\\`.`,\n type: 'boolean',\n },\n objectTypeBracketSpacing: {\n description: 'The space character (if any) to add after an object\\'s initial curly bracket and before its ending curly bracket',\n type: 'string',\n },\n parameterDefaultValueSpacing: {\n description: 'The space character (if any) to use between the equal signs of a default value. Defaults to \" \".',\n type: 'string',\n },\n postMethodNameSpacing: {\n description: 'The space character (if any) to add after a method name. Defaults to \"\".',\n type: 'string',\n },\n postNewSpacing: {\n description: 'The space character (if any) to add after \"new\" in a constructor. Defaults to \" \".',\n type: 'string',\n },\n // propertyQuotes: {\n // description: `Whether and how namepath properties should be quoted (e.g., \\`ab.\"cd\".\"ef\"\\`).\n // Set to \\`single\\`, \\`double\\`, or \\`null\\`. Defaults to \\`null\\` (no quotes unless\n // required due to whitespace within the property).`,\n // enum: [\n // 'double',\n // 'single',\n // null,\n // ],\n // },\n separatorForSingleObjectField: {\n description: `Whether to apply the \\`objectFieldSeparator\\` (e.g., a semicolon) when there\nis only one property-value object field present. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n stringQuotes: {\n description: `How string literals should be quoted (e.g., \\`\"abc\"\\`). Set to \\`single\\`\nor \\`double\\`. Defaults to 'double'.`,\n enum: [\n 'double',\n 'single',\n ],\n type: 'string',\n },\n trailingPunctuationMultilineOnly: {\n description: 'If `objectFieldSeparatorTrailingPunctuation` is set, this will determine whether the trailing puncutation is only added when the type is multiline',\n type: 'boolean',\n },\n typeBracketSpacing: {\n description: `A string of spaces that will be added immediately after the type's initial\ncurly bracket and immediately before its ending curly bracket. Defaults\nto the empty string.`,\n type: 'string',\n },\n unionSpacing: {\n description: 'Determines the spacing to add to unions (`|`). Defaults to a single space (`\" \"`).',\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA;AACA;AAGA;AAK8B;AAE9B,MAAM,UAAU,GAAI,wCAAyC;AAAC,iCAE/C,IAAAA,qBAAY,EAAC,CAAC;EAC3B,OAAO;EACP,MAAM;EACN,KAAK;EACL,QAAQ;EACR;EACF;AACA,CAAC,KAAK;EACJ,MAAM;IACJ,aAAa,GAAG,QAAQ;IACxB,oCAAoC,G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AC1B;UACD,IAAI,EAAE;QACR,CAAC;QACD,qCAAqC,EAAE;UACrC,WAAW,EAAE;AACzB;AACA;AACA,sBAAsB;UACV,IAAI,EAAE;QACR,CAAC;QACD,uCAAuC,EAAE;UACvC,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACX,IAAI,EAAE;QACR,CAAC;QACD,wBAAwB,EAAE;UACxB,WAAW,EAAE,kHAAkH;UAC/H,IAAI,EAAE;QACR,CAAC;QACD,4BAA4B,EAAE;UAC5B,WAAW,EAAE,kGAAkG;UAC/G,IAAI,EAAE;QACR,CAAC;QACD,qBAAqB,EAAE;UACrB,WAAW,EAAE,0EAA0E;UACvF,IAAI,EAAE;QACR,CAAC;QACD,cAAc,EAAE;UACd,WAAW,EAAE,oFAAoF;UACjG,IAAI,EAAE;QACR,CAAC;QACD;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,6BAA6B,EAAE;UAC7B,WAAW,EAAE;AACzB,wEAAwE;UAC5D,IAAI,EAAE;QACR,CAAC;QACD,YAAY,EAAE;UACZ,WAAW,EAAE;AACzB,qCAAqC;UACzB,IAAI,EAAE,CACJ,QAAQ,EACR,QAAQ,CACT;UACD,IAAI,EAAE;QACR,CAAC;QACD,gCAAgC,EAAE;UAChC,WAAW,EAAE,oJAAoJ;UACjK,IAAI,EAAE;QACR,CAAC;QACD,kBAAkB,EAAE;UAClB,WAAW,EAAE;AACzB;AACA,qBAAqB;UACT,IAAI,EAAE;QACR,CAAC;QACD,YAAY,EAAE;UACZ,WAAW,EAAE,oFAAoF;UACjG,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -1,5 +1,12 @@
1
- import iterateJsdoc from '../iterateJsdoc.js';
2
- import { parse, parseName, parseNamePath, traverse, tryParse } from '@es-joy/jsdoccomment';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
8
+ var _jsdoccomment = require("@es-joy/jsdoccomment");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
3
10
  const inlineTags = new Set([
4
11
  // Typdoc
5
12
  'include', 'includeCode',
@@ -24,7 +31,7 @@ const suppressTypes = new Set([
24
31
  */
25
32
  const tryParsePathIgnoreError = (path, mode) => {
26
33
  try {
27
- parseNamePath(path, mode === 'permissive' ? 'jsdoc' : mode, {
34
+ (0, _jsdoccomment.parseNamePath)(path, mode === 'permissive' ? 'jsdoc' : mode, {
28
35
  includeSpecial: true
29
36
  });
30
37
  return true;
@@ -41,14 +48,14 @@ const tryParsePathIgnoreError = (path, mode) => {
41
48
  */
42
49
  const tryParseNameIgnoreError = (name, mode) => {
43
50
  try {
44
- parseName(name, mode);
51
+ (0, _jsdoccomment.parseName)(name, mode);
45
52
  return true;
46
53
  } catch {
47
54
  // Keep the original error for including the whole type
48
55
  }
49
56
  return false;
50
57
  };
51
- export default iterateJsdoc(({
58
+ var _default = exports.default = (0, _iterateJsdoc.default)(({
52
59
  context,
53
60
  jsdoc,
54
61
  report,
@@ -124,11 +131,11 @@ export default iterateJsdoc(({
124
131
  let parsedTypes;
125
132
  try {
126
133
  if (mode === 'permissive') {
127
- parsedTypes = tryParse(type, undefined, {
134
+ parsedTypes = (0, _jsdoccomment.tryParse)(type, undefined, {
128
135
  classContext: true
129
136
  });
130
137
  } else {
131
- parsedTypes = parse(type, mode, {
138
+ parsedTypes = (0, _jsdoccomment.parse)(type, mode, {
132
139
  classContext: true
133
140
  });
134
141
  }
@@ -137,7 +144,7 @@ export default iterateJsdoc(({
137
144
  return false;
138
145
  }
139
146
  if (mode === 'closure' || mode === 'typescript') {
140
- traverse(parsedTypes, node => {
147
+ (0, _jsdoccomment.traverse)(parsedTypes, node => {
141
148
  const {
142
149
  type: typ
143
150
  } = node;
@@ -178,12 +185,12 @@ export default iterateJsdoc(({
178
185
  if (tag.tag === 'suppress' && mode === 'closure') {
179
186
  let parsedTypes;
180
187
  try {
181
- parsedTypes = tryParse(tag.type);
188
+ parsedTypes = (0, _jsdoccomment.tryParse)(tag.type);
182
189
  } catch {
183
190
  // Ignore
184
191
  }
185
192
  if (parsedTypes) {
186
- traverse(parsedTypes, node => {
193
+ (0, _jsdoccomment.traverse)(parsedTypes, node => {
187
194
  let type;
188
195
  if ('value' in node && typeof node.value === 'string') {
189
196
  type = node.value;
@@ -313,4 +320,5 @@ wish to require name paths on a tag-by-tag basis. Defaults to \`true\`.`,
313
320
  type: 'suggestion'
314
321
  }
315
322
  });
323
+ module.exports = exports.default;
316
324
  //# sourceMappingURL=validTypes.cjs.map