@depup/eslint-plugin-jsdoc 63.3.2-depup.1 → 64.0.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/README.md +3 -11
  2. package/changes.json +3 -16
  3. package/dist/index.d.ts +7 -4
  4. package/package.json +29 -67
  5. package/src/index.js +7 -8
  6. package/dist/WarnSettings.cjs +0 -38
  7. package/dist/WarnSettings.cjs.map +0 -1
  8. package/dist/alignTransform.cjs +0 -402
  9. package/dist/alignTransform.cjs.map +0 -1
  10. package/dist/buildForbidRuleDefinition.cjs +0 -101
  11. package/dist/buildForbidRuleDefinition.cjs.map +0 -1
  12. package/dist/buildRejectOrPreferRuleDefinition.cjs +0 -352
  13. package/dist/buildRejectOrPreferRuleDefinition.cjs.map +0 -1
  14. package/dist/cjs/WarnSettings.d.ts +0 -16
  15. package/dist/cjs/alignTransform.d.ts +0 -33
  16. package/dist/cjs/buildForbidRuleDefinition.d.ts +0 -14
  17. package/dist/cjs/buildRejectOrPreferRuleDefinition.d.ts +0 -8
  18. package/dist/cjs/defaultTagOrder.d.ts +0 -4
  19. package/dist/cjs/exportParser.d.ts +0 -40
  20. package/dist/cjs/getDefaultTagStructureForMode.d.ts +0 -10
  21. package/dist/cjs/getJsdocProcessorPlugin.d.cts +0 -5
  22. package/dist/cjs/getJsdocProcessorPlugin.d.ts +0 -66
  23. package/dist/cjs/index-cjs.d.ts +0 -23
  24. package/dist/cjs/index.cjs.d.cts +0 -2
  25. package/dist/cjs/iterateJsdoc.d.cts +0 -7
  26. package/dist/cjs/iterateJsdoc.d.ts +0 -495
  27. package/dist/cjs/jsdocUtils.d.ts +0 -500
  28. package/dist/cjs/rules/checkAccess.d.ts +0 -2
  29. package/dist/cjs/rules/checkAlignment.d.ts +0 -2
  30. package/dist/cjs/rules/checkExamples.d.ts +0 -3
  31. package/dist/cjs/rules/checkIndentation.d.ts +0 -2
  32. package/dist/cjs/rules/checkLineAlignment.d.ts +0 -9
  33. package/dist/cjs/rules/checkParamNames.d.ts +0 -2
  34. package/dist/cjs/rules/checkPropertyNames.d.ts +0 -2
  35. package/dist/cjs/rules/checkSyntax.d.ts +0 -2
  36. package/dist/cjs/rules/checkTagNames.d.ts +0 -2
  37. package/dist/cjs/rules/checkTemplateNames.d.ts +0 -2
  38. package/dist/cjs/rules/checkTypes.d.ts +0 -7
  39. package/dist/cjs/rules/checkValues.d.ts +0 -2
  40. package/dist/cjs/rules/convertToJsdocComments.d.ts +0 -266
  41. package/dist/cjs/rules/emptyTags.d.ts +0 -2
  42. package/dist/cjs/rules/escapeInlineTags.d.ts +0 -2
  43. package/dist/cjs/rules/implementsOnClasses.d.ts +0 -2
  44. package/dist/cjs/rules/importsAsDependencies.d.ts +0 -2
  45. package/dist/cjs/rules/informativeDocs.d.ts +0 -2
  46. package/dist/cjs/rules/linesBeforeBlock.d.ts +0 -2
  47. package/dist/cjs/rules/matchDescription.d.ts +0 -2
  48. package/dist/cjs/rules/matchName.d.ts +0 -2
  49. package/dist/cjs/rules/multilineBlocks.d.ts +0 -2
  50. package/dist/cjs/rules/noBadBlocks.d.ts +0 -2
  51. package/dist/cjs/rules/noBlankBlockDescriptions.d.ts +0 -2
  52. package/dist/cjs/rules/noBlankBlocks.d.ts +0 -2
  53. package/dist/cjs/rules/noDefaults.d.ts +0 -2
  54. package/dist/cjs/rules/noMissingSyntax.d.ts +0 -9
  55. package/dist/cjs/rules/noMultiAsterisks.d.ts +0 -2
  56. package/dist/cjs/rules/noRestrictedSyntax.d.ts +0 -2
  57. package/dist/cjs/rules/noTypes.d.ts +0 -2
  58. package/dist/cjs/rules/noUndefinedTypes.d.ts +0 -2
  59. package/dist/cjs/rules/normalizeSeeLinks.d.ts +0 -2
  60. package/dist/cjs/rules/preferImportTag.d.ts +0 -2
  61. package/dist/cjs/rules/requireAsteriskPrefix.d.ts +0 -2
  62. package/dist/cjs/rules/requireDescription.d.ts +0 -2
  63. package/dist/cjs/rules/requireDescriptionCompleteSentence.d.ts +0 -2
  64. package/dist/cjs/rules/requireExample.d.ts +0 -2
  65. package/dist/cjs/rules/requireFileOverview.d.ts +0 -2
  66. package/dist/cjs/rules/requireHyphenBeforeParamDescription.d.ts +0 -2
  67. package/dist/cjs/rules/requireJsdoc.d.ts +0 -24
  68. package/dist/cjs/rules/requireParam.d.ts +0 -3
  69. package/dist/cjs/rules/requireParamDescription.d.ts +0 -2
  70. package/dist/cjs/rules/requireParamName.d.ts +0 -2
  71. package/dist/cjs/rules/requireParamType.d.ts +0 -2
  72. package/dist/cjs/rules/requireProperty.d.ts +0 -2
  73. package/dist/cjs/rules/requirePropertyDescription.d.ts +0 -2
  74. package/dist/cjs/rules/requirePropertyName.d.ts +0 -2
  75. package/dist/cjs/rules/requirePropertyType.d.ts +0 -2
  76. package/dist/cjs/rules/requireRejects.d.ts +0 -2
  77. package/dist/cjs/rules/requireReturns.d.ts +0 -2
  78. package/dist/cjs/rules/requireReturnsCheck.d.ts +0 -2
  79. package/dist/cjs/rules/requireReturnsDescription.d.ts +0 -2
  80. package/dist/cjs/rules/requireReturnsType.d.ts +0 -2
  81. package/dist/cjs/rules/requireTags.d.ts +0 -2
  82. package/dist/cjs/rules/requireTemplate.d.ts +0 -2
  83. package/dist/cjs/rules/requireThrows.d.ts +0 -2
  84. package/dist/cjs/rules/requireYields.d.ts +0 -2
  85. package/dist/cjs/rules/requireYieldsCheck.d.ts +0 -2
  86. package/dist/cjs/rules/sortTags.d.ts +0 -2
  87. package/dist/cjs/rules/tagLines.d.ts +0 -2
  88. package/dist/cjs/rules/textEscaping.d.ts +0 -2
  89. package/dist/cjs/rules/tsMethodSignatureStyle.d.ts +0 -2
  90. package/dist/cjs/rules/tsNoEmptyObjectType.d.ts +0 -2
  91. package/dist/cjs/rules/tsNoUnnecessaryTemplateExpression.d.ts +0 -2
  92. package/dist/cjs/rules/tsPreferFunctionType.d.ts +0 -2
  93. package/dist/cjs/rules/typeFormatting.d.ts +0 -2
  94. package/dist/cjs/rules/validTypes.d.ts +0 -2
  95. package/dist/cjs/tagNames.d.ts +0 -15
  96. package/dist/cjs/utils/hasReturnValue.d.ts +0 -19
  97. package/dist/defaultTagOrder.cjs +0 -46
  98. package/dist/defaultTagOrder.cjs.map +0 -1
  99. package/dist/exportParser.cjs +0 -732
  100. package/dist/exportParser.cjs.map +0 -1
  101. package/dist/generateDocs.cjs +0 -342
  102. package/dist/generateDocs.cjs.map +0 -1
  103. package/dist/generateOptions.cjs +0 -62
  104. package/dist/generateOptions.cjs.map +0 -1
  105. package/dist/generateRule.cjs +0 -248
  106. package/dist/generateRule.cjs.map +0 -1
  107. package/dist/generateRuleTypes.cjs +0 -24
  108. package/dist/generateRuleTypes.cjs.map +0 -1
  109. package/dist/getDefaultTagStructureForMode.cjs +0 -289
  110. package/dist/getDefaultTagStructureForMode.cjs.map +0 -1
  111. package/dist/getJsdocProcessorPlugin.cjs +0 -587
  112. package/dist/getJsdocProcessorPlugin.cjs.map +0 -1
  113. package/dist/getJsdocProcessorPlugin.cts +0 -5
  114. package/dist/index-cjs.cjs +0 -598
  115. package/dist/index-cjs.cjs.map +0 -1
  116. package/dist/index-cjs.d.ts +0 -24
  117. package/dist/index-esm.cjs +0 -162
  118. package/dist/index-esm.cjs.map +0 -1
  119. package/dist/index-esm.d.ts +0 -72
  120. package/dist/index.cjs +0 -746
  121. package/dist/index.cjs.cts +0 -3
  122. package/dist/index.cjs.map +0 -1
  123. package/dist/iterateJsdoc.cjs +0 -2150
  124. package/dist/iterateJsdoc.cjs.map +0 -1
  125. package/dist/iterateJsdoc.cts +0 -7
  126. package/dist/jsdocUtils.cjs +0 -1786
  127. package/dist/jsdocUtils.cjs.map +0 -1
  128. package/dist/rules/checkAccess.cjs +0 -40
  129. package/dist/rules/checkAccess.cjs.map +0 -1
  130. package/dist/rules/checkAlignment.cjs +0 -78
  131. package/dist/rules/checkAlignment.cjs.map +0 -1
  132. package/dist/rules/checkExamples.cjs +0 -521
  133. package/dist/rules/checkExamples.cjs.map +0 -1
  134. package/dist/rules/checkIndentation.cjs +0 -170
  135. package/dist/rules/checkIndentation.cjs.map +0 -1
  136. package/dist/rules/checkLineAlignment.cjs +0 -398
  137. package/dist/rules/checkLineAlignment.cjs.map +0 -1
  138. package/dist/rules/checkParamNames.cjs +0 -407
  139. package/dist/rules/checkParamNames.cjs.map +0 -1
  140. package/dist/rules/checkPropertyNames.cjs +0 -135
  141. package/dist/rules/checkPropertyNames.cjs.map +0 -1
  142. package/dist/rules/checkSyntax.cjs +0 -38
  143. package/dist/rules/checkSyntax.cjs.map +0 -1
  144. package/dist/rules/checkTagNames.cjs +0 -312
  145. package/dist/rules/checkTagNames.cjs.map +0 -1
  146. package/dist/rules/checkTemplateNames.cjs +0 -192
  147. package/dist/rules/checkTemplateNames.cjs.map +0 -1
  148. package/dist/rules/checkTypes.cjs +0 -111
  149. package/dist/rules/checkTypes.cjs.map +0 -1
  150. package/dist/rules/checkValues.cjs +0 -166
  151. package/dist/rules/checkValues.cjs.map +0 -1
  152. package/dist/rules/convertToJsdocComments.cjs +0 -356
  153. package/dist/rules/convertToJsdocComments.cjs.map +0 -1
  154. package/dist/rules/emptyTags.cjs +0 -98
  155. package/dist/rules/emptyTags.cjs.map +0 -1
  156. package/dist/rules/escapeInlineTags.cjs +0 -234
  157. package/dist/rules/escapeInlineTags.cjs.map +0 -1
  158. package/dist/rules/implementsOnClasses.cjs +0 -74
  159. package/dist/rules/implementsOnClasses.cjs.map +0 -1
  160. package/dist/rules/importsAsDependencies.cjs +0 -104
  161. package/dist/rules/importsAsDependencies.cjs.map +0 -1
  162. package/dist/rules/informativeDocs.cjs +0 -187
  163. package/dist/rules/informativeDocs.cjs.map +0 -1
  164. package/dist/rules/linesBeforeBlock.cjs +0 -120
  165. package/dist/rules/linesBeforeBlock.cjs.map +0 -1
  166. package/dist/rules/matchDescription.cjs +0 -356
  167. package/dist/rules/matchDescription.cjs.map +0 -1
  168. package/dist/rules/matchName.cjs +0 -160
  169. package/dist/rules/matchName.cjs.map +0 -1
  170. package/dist/rules/multilineBlocks.cjs +0 -431
  171. package/dist/rules/multilineBlocks.cjs.map +0 -1
  172. package/dist/rules/noBadBlocks.cjs +0 -100
  173. package/dist/rules/noBadBlocks.cjs.map +0 -1
  174. package/dist/rules/noBlankBlockDescriptions.cjs +0 -63
  175. package/dist/rules/noBlankBlockDescriptions.cjs.map +0 -1
  176. package/dist/rules/noBlankBlocks.cjs +0 -54
  177. package/dist/rules/noBlankBlocks.cjs.map +0 -1
  178. package/dist/rules/noDefaults.cjs +0 -102
  179. package/dist/rules/noDefaults.cjs.map +0 -1
  180. package/dist/rules/noMissingSyntax.cjs +0 -196
  181. package/dist/rules/noMissingSyntax.cjs.map +0 -1
  182. package/dist/rules/noMultiAsterisks.cjs +0 -126
  183. package/dist/rules/noMultiAsterisks.cjs.map +0 -1
  184. package/dist/rules/noRestrictedSyntax.cjs +0 -68
  185. package/dist/rules/noRestrictedSyntax.cjs.map +0 -1
  186. package/dist/rules/noTypes.cjs +0 -101
  187. package/dist/rules/noTypes.cjs.map +0 -1
  188. package/dist/rules/noUndefinedTypes.cjs +0 -616
  189. package/dist/rules/noUndefinedTypes.cjs.map +0 -1
  190. package/dist/rules/normalizeSeeLinks.cjs +0 -271
  191. package/dist/rules/normalizeSeeLinks.cjs.map +0 -1
  192. package/dist/rules/preferImportTag.cjs +0 -362
  193. package/dist/rules/preferImportTag.cjs.map +0 -1
  194. package/dist/rules/requireAsteriskPrefix.cjs +0 -190
  195. package/dist/rules/requireAsteriskPrefix.cjs.map +0 -1
  196. package/dist/rules/requireDescription.cjs +0 -164
  197. package/dist/rules/requireDescription.cjs.map +0 -1
  198. package/dist/rules/requireDescriptionCompleteSentence.cjs +0 -321
  199. package/dist/rules/requireDescriptionCompleteSentence.cjs.map +0 -1
  200. package/dist/rules/requireExample.cjs +0 -136
  201. package/dist/rules/requireExample.cjs.map +0 -1
  202. package/dist/rules/requireFileOverview.cjs +0 -194
  203. package/dist/rules/requireFileOverview.cjs.map +0 -1
  204. package/dist/rules/requireHyphenBeforeParamDescription.cjs +0 -166
  205. package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +0 -1
  206. package/dist/rules/requireJsdoc.cjs +0 -721
  207. package/dist/rules/requireJsdoc.cjs.map +0 -1
  208. package/dist/rules/requireParam.cjs +0 -772
  209. package/dist/rules/requireParam.cjs.map +0 -1
  210. package/dist/rules/requireParamDescription.cjs +0 -105
  211. package/dist/rules/requireParamDescription.cjs.map +0 -1
  212. package/dist/rules/requireParamName.cjs +0 -68
  213. package/dist/rules/requireParamName.cjs.map +0 -1
  214. package/dist/rules/requireParamType.cjs +0 -104
  215. package/dist/rules/requireParamType.cjs.map +0 -1
  216. package/dist/rules/requireProperty.cjs +0 -63
  217. package/dist/rules/requireProperty.cjs.map +0 -1
  218. package/dist/rules/requirePropertyDescription.cjs +0 -29
  219. package/dist/rules/requirePropertyDescription.cjs.map +0 -1
  220. package/dist/rules/requirePropertyName.cjs +0 -29
  221. package/dist/rules/requirePropertyName.cjs.map +0 -1
  222. package/dist/rules/requirePropertyType.cjs +0 -29
  223. package/dist/rules/requirePropertyType.cjs.map +0 -1
  224. package/dist/rules/requireRejects.cjs +0 -226
  225. package/dist/rules/requireRejects.cjs.map +0 -1
  226. package/dist/rules/requireReturns.cjs +0 -262
  227. package/dist/rules/requireReturns.cjs.map +0 -1
  228. package/dist/rules/requireReturnsCheck.cjs +0 -225
  229. package/dist/rules/requireReturnsCheck.cjs.map +0 -1
  230. package/dist/rules/requireReturnsDescription.cjs +0 -72
  231. package/dist/rules/requireReturnsDescription.cjs.map +0 -1
  232. package/dist/rules/requireReturnsType.cjs +0 -68
  233. package/dist/rules/requireReturnsType.cjs.map +0 -1
  234. package/dist/rules/requireTags.cjs +0 -74
  235. package/dist/rules/requireTags.cjs.map +0 -1
  236. package/dist/rules/requireTemplate.cjs +0 -220
  237. package/dist/rules/requireTemplate.cjs.map +0 -1
  238. package/dist/rules/requireThrows.cjs +0 -118
  239. package/dist/rules/requireThrows.cjs.map +0 -1
  240. package/dist/rules/requireYields.cjs +0 -224
  241. package/dist/rules/requireYields.cjs.map +0 -1
  242. package/dist/rules/requireYieldsCheck.cjs +0 -179
  243. package/dist/rules/requireYieldsCheck.cjs.map +0 -1
  244. package/dist/rules/sortTags.cjs +0 -656
  245. package/dist/rules/sortTags.cjs.map +0 -1
  246. package/dist/rules/tagLines.cjs +0 -374
  247. package/dist/rules/tagLines.cjs.map +0 -1
  248. package/dist/rules/textEscaping.cjs +0 -141
  249. package/dist/rules/textEscaping.cjs.map +0 -1
  250. package/dist/rules/tsMethodSignatureStyle.cjs +0 -240
  251. package/dist/rules/tsMethodSignatureStyle.cjs.map +0 -1
  252. package/dist/rules/tsNoEmptyObjectType.cjs +0 -62
  253. package/dist/rules/tsNoEmptyObjectType.cjs.map +0 -1
  254. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs +0 -104
  255. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs.map +0 -1
  256. package/dist/rules/tsPreferFunctionType.cjs +0 -110
  257. package/dist/rules/tsPreferFunctionType.cjs.map +0 -1
  258. package/dist/rules/typeFormatting.cjs +0 -607
  259. package/dist/rules/typeFormatting.cjs.map +0 -1
  260. package/dist/rules/validTypes.cjs +0 -324
  261. package/dist/rules/validTypes.cjs.map +0 -1
  262. package/dist/tagNames.cjs +0 -244
  263. package/dist/tagNames.cjs.map +0 -1
  264. package/dist/to-valid-identifier.cjs +0 -263
  265. package/dist/utils/hasReturnValue.cjs +0 -495
  266. package/dist/utils/hasReturnValue.cjs.map +0 -1
  267. package/rollup.config.js +0 -16
  268. package/src/getJsdocProcessorPlugin.cts +0 -5
  269. package/src/index-cjs.js +0 -758
  270. package/src/index-esm.js +0 -196
  271. package/src/index.cjs.cts +0 -3
  272. package/src/iterateJsdoc.cts +0 -7
@@ -1,607 +0,0 @@
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
- const digitRegex = /^(\d+(\.\d*)?|\.\d+)([eE][\-+]?\d+)?$/v;
12
- var _default = exports.default = (0, _iterateJsdoc.default)(({
13
- context,
14
- indent,
15
- jsdoc,
16
- settings,
17
- utils
18
- // eslint-disable-next-line complexity -- Todo
19
- }) => {
20
- const {
21
- arrayBrackets = 'square',
22
- arrowFunctionPostReturnMarkerSpacing = ' ',
23
- arrowFunctionPreReturnMarkerSpacing = ' ',
24
- enableFixer = true,
25
- functionOrClassParameterSpacing = ' ',
26
- functionOrClassPostGenericSpacing = '',
27
- functionOrClassPostReturnMarkerSpacing = ' ',
28
- functionOrClassPreReturnMarkerSpacing = '',
29
- functionOrClassTypeParameterSpacing = ' ',
30
- genericAndTupleElementSpacing = ' ',
31
- genericDot = false,
32
- keyValuePostColonSpacing = ' ',
33
- keyValuePostKeySpacing = '',
34
- keyValuePostOptionalSpacing = '',
35
- keyValuePostVariadicSpacing = '',
36
- methodQuotes = 'double',
37
- objectFieldIndent = '',
38
- objectFieldQuote = null,
39
- objectFieldSeparator = 'comma',
40
- objectFieldSeparatorOptionalLinebreak = true,
41
- objectFieldSeparatorTrailingPunctuation = false,
42
- objectTypeBracketSpacing = '',
43
- parameterDefaultValueSpacing = ' ',
44
- postMethodNameSpacing = '',
45
- postNewSpacing = ' ',
46
- // propertyQuotes = null,
47
- separatorForSingleObjectField = false,
48
- stringQuotes = 'double',
49
- trailingPunctuationMultilineOnly = false,
50
- typeBracketSpacing = '',
51
- unionSpacing = ' '
52
- } = context.options[0] || {};
53
- const {
54
- mode
55
- } = settings;
56
-
57
- /**
58
- * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag
59
- */
60
- const checkTypeFormats = tag => {
61
- const potentialType = tag.type;
62
- let parsedType;
63
- try {
64
- parsedType = mode === 'permissive' ? (0, _jsdoccomment.tryParse)(/** @type {string} */potentialType) : (0, _jsdoccomment.parse)(/** @type {string} */potentialType, mode);
65
- } catch {
66
- return;
67
- }
68
- const fix = () => {
69
- (0, _jsdocUtils.rewireByParsedType)(jsdoc, tag, parsedType, indent, typeBracketSpacing);
70
- };
71
-
72
- /** @type {string[]} */
73
- const errorMessages = [];
74
- if (typeBracketSpacing && (!tag.type.startsWith(typeBracketSpacing) || !tag.type.endsWith(typeBracketSpacing))) {
75
- errorMessages.push(`Must have initial and final "${typeBracketSpacing}" spacing`);
76
- } else if (!typeBracketSpacing && (/^\s/v.test(tag.type) || /\s$/v.test(tag.type))) {
77
- errorMessages.push('Must have no initial spacing');
78
- }
79
-
80
- // eslint-disable-next-line complexity -- Todo
81
- (0, _jsdoccomment.traverse)(parsedType, nde => {
82
- let errorMessage = '';
83
-
84
- /**
85
- * @param {Partial<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {
86
- * postNewSpacing?: string,
87
- * postMethodNameSpacing?: string
88
- * }} meta
89
- * @returns {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {
90
- * postNewSpacing?: string,
91
- * postMethodNameSpacing?: string
92
- * }}
93
- */
94
- const conditionalAdds = meta => {
95
- const typNode =
96
- /**
97
- * @type {import('jsdoc-type-pratt-parser').FunctionResult|
98
- * import('jsdoc-type-pratt-parser').CallSignatureResult|
99
- * import('jsdoc-type-pratt-parser').ComputedMethodResult|
100
- * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|
101
- * import('jsdoc-type-pratt-parser').MethodSignatureResult
102
- * }
103
- */
104
- nde;
105
-
106
- /**
107
- * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {
108
- * postNewSpacing?: string,
109
- * postMethodNameSpacing?: string
110
- * }}
111
- */
112
- const newMeta = {
113
- parameterSpacing: meta.parameterSpacing ?? typNode.meta?.parameterSpacing ?? ' ',
114
- postGenericSpacing: meta.postGenericSpacing ?? typNode.meta?.postGenericSpacing ?? '',
115
- postReturnMarkerSpacing: meta.postReturnMarkerSpacing ?? typNode.meta?.postReturnMarkerSpacing ?? ' ',
116
- preReturnMarkerSpacing: meta.preReturnMarkerSpacing ?? typNode.meta?.preReturnMarkerSpacing ?? '',
117
- typeParameterSpacing: meta.typeParameterSpacing ?? typNode.meta?.typeParameterSpacing ?? ' '
118
- };
119
- if (typNode.type === 'JsdocTypeConstructorSignature') {
120
- newMeta.postNewSpacing = meta.postNewSpacing;
121
- }
122
- if (typNode.type === 'JsdocTypeMethodSignature') {
123
- newMeta.postMethodNameSpacing = meta.postMethodNameSpacing ?? typNode.meta?.postMethodNameSpacing ?? '';
124
- }
125
- return newMeta;
126
- };
127
- switch (nde.type) {
128
- case 'JsdocTypeConstructorSignature':
129
- {
130
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').ConstructorSignatureResult} */nde;
131
- /* c8 ignore next -- Guard */
132
- if ((typeNode.meta?.postNewSpacing ?? ' ') !== postNewSpacing) {
133
- typeNode.meta =
134
- /**
135
- * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {
136
- * postNewSpacing: string,
137
- * }}
138
- */
139
- conditionalAdds({
140
- postNewSpacing
141
- });
142
- errorMessage = `Post-\`new\` spacing should be "${postNewSpacing}"`;
143
- break;
144
- }
145
- }
146
- case 'JsdocTypeFunction':
147
- {
148
- const typeNode =
149
- /**
150
- * @type {import('jsdoc-type-pratt-parser').FunctionResult}
151
- */
152
- nde;
153
- if ('arrow' in typeNode && typeNode.arrow) {
154
- /* c8 ignore next -- Guard */
155
- if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== arrowFunctionPostReturnMarkerSpacing) {
156
- typeNode.meta =
157
- /**
158
- * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {
159
- * postNewSpacing: string,
160
- * }}
161
- */
162
- conditionalAdds({
163
- postReturnMarkerSpacing: arrowFunctionPostReturnMarkerSpacing,
164
- /* c8 ignore next -- Guard */
165
- preReturnMarkerSpacing: typeNode.meta?.preReturnMarkerSpacing ?? ' '
166
- });
167
- errorMessage = `Post-return-marker spacing should be "${arrowFunctionPostReturnMarkerSpacing}"`;
168
- break;
169
- /* c8 ignore next -- Guard */
170
- } else if ((typeNode.meta?.preReturnMarkerSpacing ?? ' ') !== arrowFunctionPreReturnMarkerSpacing) {
171
- typeNode.meta =
172
- /**
173
- * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {
174
- * postNewSpacing: string,
175
- * }}
176
- */
177
- conditionalAdds({
178
- /* c8 ignore next -- Guard */
179
- postReturnMarkerSpacing: typeNode.meta?.postReturnMarkerSpacing ?? ' ',
180
- preReturnMarkerSpacing: arrowFunctionPreReturnMarkerSpacing
181
- });
182
- errorMessage = `Pre-return-marker spacing should be "${arrowFunctionPreReturnMarkerSpacing}"`;
183
- break;
184
- }
185
- break;
186
- }
187
- }
188
- case 'JsdocTypeCallSignature':
189
- case 'JsdocTypeComputedMethod':
190
- case 'JsdocTypeMethodSignature':
191
- {
192
- const typeNode =
193
- /**
194
- * @type {import('jsdoc-type-pratt-parser').FunctionResult|
195
- * import('jsdoc-type-pratt-parser').CallSignatureResult|
196
- * import('jsdoc-type-pratt-parser').ComputedMethodResult|
197
- * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|
198
- * import('jsdoc-type-pratt-parser').MethodSignatureResult
199
- * }
200
- */
201
- nde;
202
- if (typeNode.type === 'JsdocTypeMethodSignature' && (typeNode.meta?.postMethodNameSpacing ?? '') !== postMethodNameSpacing) {
203
- typeNode.meta = {
204
- quote: typeNode.meta.quote,
205
- ...conditionalAdds({
206
- postMethodNameSpacing
207
- })
208
- };
209
- errorMessage = `Post-method-name spacing should be "${postMethodNameSpacing}"`;
210
- break;
211
- } else if (typeNode.type === 'JsdocTypeMethodSignature' && typeNode.meta.quote !== undefined && typeNode.meta.quote !== methodQuotes) {
212
- typeNode.meta = {
213
- ...conditionalAdds({
214
- postMethodNameSpacing: typeNode.meta.postMethodNameSpacing ?? ''
215
- }),
216
- quote: methodQuotes
217
- };
218
- errorMessage = `Method quoting style should be "${methodQuotes}"`;
219
- break;
220
- }
221
- if ((typeNode.meta?.parameterSpacing ?? ' ') !== functionOrClassParameterSpacing) {
222
- typeNode.meta = conditionalAdds({
223
- parameterSpacing: functionOrClassParameterSpacing
224
- });
225
- errorMessage = `Parameter spacing should be "${functionOrClassParameterSpacing}"`;
226
- } else if ((typeNode.meta?.postGenericSpacing ?? '') !== functionOrClassPostGenericSpacing) {
227
- typeNode.meta = conditionalAdds({
228
- postGenericSpacing: functionOrClassPostGenericSpacing
229
- });
230
- errorMessage = `Post-generic spacing should be "${functionOrClassPostGenericSpacing}"`;
231
- } else if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== functionOrClassPostReturnMarkerSpacing) {
232
- typeNode.meta = conditionalAdds({
233
- postReturnMarkerSpacing: functionOrClassPostReturnMarkerSpacing
234
- });
235
- errorMessage = `Post-return-marker spacing should be "${functionOrClassPostReturnMarkerSpacing}"`;
236
- } else if ((typeNode.meta?.preReturnMarkerSpacing ?? '') !== functionOrClassPreReturnMarkerSpacing) {
237
- typeNode.meta = conditionalAdds({
238
- preReturnMarkerSpacing: functionOrClassPreReturnMarkerSpacing
239
- });
240
- errorMessage = `Pre-return-marker spacing should be "${functionOrClassPreReturnMarkerSpacing}"`;
241
- } else if ((typeNode.meta?.typeParameterSpacing ?? ' ') !== functionOrClassTypeParameterSpacing) {
242
- typeNode.meta = conditionalAdds({
243
- typeParameterSpacing: functionOrClassTypeParameterSpacing
244
- });
245
- errorMessage = `Type parameter spacing should be "${functionOrClassTypeParameterSpacing}"`;
246
- }
247
- break;
248
- }
249
- case 'JsdocTypeGeneric':
250
- {
251
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').GenericResult} */nde;
252
- if ('value' in typeNode.left && typeNode.left.value === 'Array') {
253
- if (typeNode.meta.brackets !== arrayBrackets) {
254
- typeNode.meta.brackets = arrayBrackets;
255
- errorMessage = `Array bracket style should be ${arrayBrackets}`;
256
- }
257
- } else if (typeNode.meta.dot !== genericDot) {
258
- typeNode.meta.dot = genericDot;
259
- errorMessage = `Dot usage should be ${genericDot}`;
260
- } else if ((typeNode.meta.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {
261
- typeNode.meta.elementSpacing = genericAndTupleElementSpacing;
262
- errorMessage = `Element spacing should be "${genericAndTupleElementSpacing}"`;
263
- }
264
- break;
265
- }
266
- case 'JsdocTypeKeyValue':
267
- {
268
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').KeyValueResult} */nde;
269
- /* c8 ignore next -- Guard */
270
- if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {
271
- typeNode.meta = {
272
- /* c8 ignore next -- Guard */
273
- postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',
274
- postKeySpacing: keyValuePostKeySpacing,
275
- /* c8 ignore next 2 -- Guard */
276
- postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',
277
- postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? ''
278
- };
279
- errorMessage = `Post key spacing should be "${keyValuePostKeySpacing}"`;
280
- /* c8 ignore next -- Guard */
281
- } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {
282
- typeNode.meta = {
283
- postColonSpacing: keyValuePostColonSpacing,
284
- /* c8 ignore next 3 -- Guard */
285
- postKeySpacing: typeNode.meta?.postKeySpacing ?? '',
286
- postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',
287
- postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? ''
288
- };
289
- errorMessage = `Post colon spacing should be "${keyValuePostColonSpacing}"`;
290
- /* c8 ignore next -- Guard */
291
- } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {
292
- typeNode.meta = {
293
- /* c8 ignore next 2 -- Guard */
294
- postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',
295
- postKeySpacing: typeNode.meta?.postKeySpacing ?? '',
296
- postOptionalSpacing: keyValuePostOptionalSpacing,
297
- /* c8 ignore next -- Guard */
298
- postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? ''
299
- };
300
- errorMessage = `Post optional (\`?\`) spacing should be "${keyValuePostOptionalSpacing}"`;
301
- /* c8 ignore next -- Guard */
302
- } else if (typeNode.variadic && (typeNode.meta?.postVariadicSpacing ?? '') !== keyValuePostVariadicSpacing) {
303
- typeNode.meta = {
304
- /* c8 ignore next 3 -- Guard */
305
- postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',
306
- postKeySpacing: typeNode.meta?.postKeySpacing ?? '',
307
- postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',
308
- postVariadicSpacing: keyValuePostVariadicSpacing
309
- };
310
- errorMessage = `Post variadic (\`...\`) spacing should be "${keyValuePostVariadicSpacing}"`;
311
- }
312
- break;
313
- }
314
- case 'JsdocTypeObject':
315
- {
316
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */nde;
317
- /* c8 ignore next -- Guard */
318
- const separator = typeNode.meta.separator ?? 'comma';
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 */
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'))))) {
321
- typeNode.meta.separator = objectFieldSeparatorOptionalLinebreak && !separator.endsWith('and-linebreak') ? objectFieldSeparator.replace(/-and-linebreak$/v, '') : objectFieldSeparator;
322
- typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;
323
- typeNode.meta.propertyIndent = objectFieldIndent;
324
- typeNode.meta.trailingPunctuation = objectFieldSeparatorTrailingPunctuation;
325
- errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;
326
- } else if ((typeNode.meta.bracketSpacing ?? '') !== objectTypeBracketSpacing) {
327
- typeNode.meta.bracketSpacing = objectTypeBracketSpacing;
328
- // This might not be the cause
329
- // errorMessage = `Object type bracket spacing should be "${objectTypeBracketSpacing}"`;
330
- }
331
- break;
332
- }
333
- case 'JsdocTypeObjectField':
334
- {
335
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectFieldResult} */nde;
336
- if ((objectFieldQuote || typeof typeNode.key === 'string' && (/^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/v.test(typeNode.key) || digitRegex.test(typeNode.key))) && typeNode.meta.quote !== (objectFieldQuote ?? undefined) && (typeof typeNode.key !== 'string' || !digitRegex.test(typeNode.key))) {
337
- typeNode.meta.quote = objectFieldQuote ?? undefined;
338
- errorMessage = `Inconsistent object field quotes ${objectFieldQuote}`;
339
- } else if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {
340
- typeNode.meta.postKeySpacing = keyValuePostKeySpacing;
341
- errorMessage = `Post key spacing should be "${keyValuePostKeySpacing}"`;
342
- } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {
343
- typeNode.meta.postColonSpacing = keyValuePostColonSpacing;
344
- errorMessage = `Post colon spacing should be "${keyValuePostColonSpacing}"`;
345
- } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {
346
- typeNode.meta.postOptionalSpacing = keyValuePostOptionalSpacing;
347
- errorMessage = `Post optional (\`?\`) spacing should be "${keyValuePostOptionalSpacing}"`;
348
- }
349
- break;
350
- }
351
- case 'JsdocTypeStringValue':
352
- {
353
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */nde;
354
- if (typeNode.meta.quote !== stringQuotes) {
355
- typeNode.meta.quote = stringQuotes;
356
- errorMessage = `Inconsistent ${stringQuotes} string quotes usage`;
357
- }
358
- break;
359
- }
360
-
361
- // Only suitable for namepaths (and would need changes); see https://github.com/gajus/eslint-plugin-jsdoc/issues/1524
362
- // case 'JsdocTypeProperty': {
363
- // const typeNode = /** @type {import('jsdoc-type-pratt-parser').PropertyResult} */ (nde);
364
-
365
- // if ((propertyQuotes ||
366
- // (typeof typeNode.value === 'string' && !(/\s/v).test(typeNode.value))) &&
367
- // typeNode.meta.quote !== (propertyQuotes ?? undefined)
368
- // ) {
369
- // typeNode.meta.quote = propertyQuotes ?? undefined;
370
- // errorMessage = `Inconsistent ${propertyQuotes} property quotes usage`;
371
- // }
372
-
373
- // break;
374
- // }
375
-
376
- case 'JsdocTypeTuple':
377
- {
378
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').TupleResult} */nde;
379
- /* c8 ignore next -- Guard */
380
- if ((typeNode.meta?.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {
381
- typeNode.meta = {
382
- elementSpacing: genericAndTupleElementSpacing
383
- };
384
- errorMessage = `Element spacing should be "${genericAndTupleElementSpacing}"`;
385
- }
386
- break;
387
- }
388
- case 'JsdocTypeTypeParameter':
389
- {
390
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').TypeParameterResult} */nde;
391
- /* c8 ignore next -- Guard */
392
- if (typeNode.defaultValue && (typeNode.meta?.defaultValueSpacing ?? ' ') !== parameterDefaultValueSpacing) {
393
- typeNode.meta = {
394
- defaultValueSpacing: parameterDefaultValueSpacing
395
- };
396
- errorMessage = `Default value spacing should be "${parameterDefaultValueSpacing}"`;
397
- }
398
- break;
399
- }
400
- case 'JsdocTypeUnion':
401
- {
402
- const typeNode = /** @type {import('jsdoc-type-pratt-parser').UnionResult} */nde;
403
- /* c8 ignore next -- Guard */
404
- if ((typeNode.meta?.spacing ?? ' ') !== unionSpacing) {
405
- typeNode.meta = {
406
- spacing: unionSpacing
407
- };
408
- errorMessage = `Inconsistent "${unionSpacing}" union spacing usage`;
409
- }
410
- break;
411
- }
412
- default:
413
- break;
414
- }
415
- if (errorMessage) {
416
- errorMessages.push(errorMessage);
417
- }
418
- });
419
- const differentResult = tag.type !== typeBracketSpacing + (0, _jsdoccomment.stringify)(parsedType) + typeBracketSpacing;
420
- if (errorMessages.length && differentResult) {
421
- for (const errorMessage of errorMessages) {
422
- utils.reportJSDoc(errorMessage, tag, enableFixer ? fix : null);
423
- }
424
- // Stringification may have been equal previously (and thus no error reported)
425
- // because the stringification doesn't preserve everything
426
- } else if (differentResult) {
427
- utils.reportJSDoc('There was an error with type formatting', tag, enableFixer ? fix : null);
428
- }
429
- };
430
- const tags = utils.getPresentTags(['param', 'property', 'returns', 'this', 'throws', 'type', 'typedef', 'yields']);
431
- for (const tag of tags) {
432
- if (tag.type) {
433
- checkTypeFormats(tag);
434
- }
435
- }
436
- }, {
437
- iterateAllJsdocs: true,
438
- meta: {
439
- docs: {
440
- description: 'Formats JSDoc type values.',
441
- url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header'
442
- },
443
- fixable: 'code',
444
- schema: [{
445
- additionalProperties: false,
446
- properties: {
447
- arrayBrackets: {
448
- description: 'Determines how array generics are represented. Set to `angle` for the style `Array<type>` or `square` for the style `type[]`. Defaults to "square".',
449
- enum: ['angle', 'square'],
450
- type: 'string'
451
- },
452
- arrowFunctionPostReturnMarkerSpacing: {
453
- description: 'The space character (if any) to use after return markers (`=>`). Defaults to " ".',
454
- type: 'string'
455
- },
456
- arrowFunctionPreReturnMarkerSpacing: {
457
- description: 'The space character (if any) to use before return markers (`=>`). Defaults to " ".',
458
- type: 'string'
459
- },
460
- enableFixer: {
461
- description: 'Whether to enable the fixer. Defaults to `true`.',
462
- type: 'boolean'
463
- },
464
- functionOrClassParameterSpacing: {
465
- description: 'The space character (if any) to use between function or class parameters. Defaults to " ".',
466
- type: 'string'
467
- },
468
- functionOrClassPostGenericSpacing: {
469
- description: 'The space character (if any) to use after a generic expression in a function or class. Defaults to "".',
470
- type: 'string'
471
- },
472
- functionOrClassPostReturnMarkerSpacing: {
473
- description: 'The space character (if any) to use after return markers (`:`). Defaults to "".',
474
- type: 'string'
475
- },
476
- functionOrClassPreReturnMarkerSpacing: {
477
- description: 'The space character (if any) to use before return markers (`:`). Defaults to "".',
478
- type: 'string'
479
- },
480
- functionOrClassTypeParameterSpacing: {
481
- description: 'The space character (if any) to use between type parameters in a function or class. Defaults to " ".',
482
- type: 'string'
483
- },
484
- genericAndTupleElementSpacing: {
485
- description: 'The space character (if any) to use between elements in generics and tuples. Defaults to " ".',
486
- type: 'string'
487
- },
488
- genericDot: {
489
- description: 'Boolean value of whether to use a dot before the angled brackets of a generic (e.g., `SomeType.<AnotherType>`). Defaults to `false`.',
490
- type: 'boolean'
491
- },
492
- keyValuePostColonSpacing: {
493
- description: 'The amount of spacing (if any) after the colon of a key-value or object-field pair. Defaults to " ".',
494
- type: 'string'
495
- },
496
- keyValuePostKeySpacing: {
497
- description: 'The amount of spacing (if any) immediately after keys in a key-value or object-field pair. Defaults to "".',
498
- type: 'string'
499
- },
500
- keyValuePostOptionalSpacing: {
501
- description: 'The amount of spacing (if any) after the optional operator (`?`) in a key-value or object-field pair. Defaults to "".',
502
- type: 'string'
503
- },
504
- keyValuePostVariadicSpacing: {
505
- description: 'The amount of spacing (if any) after a variadic operator (`...`) in a key-value pair. Defaults to "".',
506
- type: 'string'
507
- },
508
- methodQuotes: {
509
- description: 'The style of quotation mark for surrounding method names when quoted. Defaults to `double`',
510
- enum: ['double', 'single'],
511
- type: 'string'
512
- },
513
- objectFieldIndent: {
514
- description: `A string indicating the whitespace to be added on each line preceding an
515
- object property-value field. Defaults to the empty string.`,
516
- type: 'string'
517
- },
518
- objectFieldQuote: {
519
- description: `Whether and how object field properties should be quoted (e.g., \`{"a": string}\`).
520
- Set to \`single\`, \`double\`, or \`null\`. Defaults to \`null\` (no quotes unless
521
- required due to special characters within the field). Digits will be kept as is,
522
- regardless of setting (they can either represent a digit or a string digit).`,
523
- enum: ['double', 'single', null]
524
- },
525
- objectFieldSeparator: {
526
- description: `For object properties, specify whether a "semicolon", "comma", "linebreak",
527
- "semicolon-and-linebreak", or "comma-and-linebreak" should be used after
528
- each object property-value pair.
529
-
530
- Defaults to \`"comma"\`.`,
531
- enum: ['comma', 'comma-and-linebreak', 'linebreak', 'semicolon', 'semicolon-and-linebreak'],
532
- type: 'string'
533
- },
534
- objectFieldSeparatorOptionalLinebreak: {
535
- description: `Whether \`objectFieldSeparator\` set to \`"semicolon-and-linebreak"\` or
536
- \`"comma-and-linebreak"\` should be allowed to optionally drop the linebreak.
537
-
538
- Defaults to \`true\`.`,
539
- type: 'boolean'
540
- },
541
- objectFieldSeparatorTrailingPunctuation: {
542
- description: `If \`separatorForSingleObjectField\` is not in effect (i.e., if it is \`false\`
543
- or there are multiple property-value object fields present), this property
544
- will determine whether to add punctuation corresponding to the
545
- \`objectFieldSeparator\` (e.g., a semicolon) to the final object field.
546
- Defaults to \`false\`.`,
547
- type: 'boolean'
548
- },
549
- objectTypeBracketSpacing: {
550
- description: 'The space character (if any) to add after an object\'s initial curly bracket and before its ending curly bracket',
551
- type: 'string'
552
- },
553
- parameterDefaultValueSpacing: {
554
- description: 'The space character (if any) to use between the equal signs of a default value. Defaults to " ".',
555
- type: 'string'
556
- },
557
- postMethodNameSpacing: {
558
- description: 'The space character (if any) to add after a method name. Defaults to "".',
559
- type: 'string'
560
- },
561
- postNewSpacing: {
562
- description: 'The space character (if any) to add after "new" in a constructor. Defaults to " ".',
563
- type: 'string'
564
- },
565
- // propertyQuotes: {
566
- // description: `Whether and how namepath properties should be quoted (e.g., \`ab."cd"."ef"\`).
567
- // Set to \`single\`, \`double\`, or \`null\`. Defaults to \`null\` (no quotes unless
568
- // required due to whitespace within the property).`,
569
- // enum: [
570
- // 'double',
571
- // 'single',
572
- // null,
573
- // ],
574
- // },
575
- separatorForSingleObjectField: {
576
- description: `Whether to apply the \`objectFieldSeparator\` (e.g., a semicolon) when there
577
- is only one property-value object field present. Defaults to \`false\`.`,
578
- type: 'boolean'
579
- },
580
- stringQuotes: {
581
- description: `How string literals should be quoted (e.g., \`"abc"\`). Set to \`single\`
582
- or \`double\`. Defaults to 'double'.`,
583
- enum: ['double', 'single'],
584
- type: 'string'
585
- },
586
- trailingPunctuationMultilineOnly: {
587
- description: 'If `objectFieldSeparatorTrailingPunctuation` is set, this will determine whether the trailing puncutation is only added when the type is multiline',
588
- type: 'boolean'
589
- },
590
- typeBracketSpacing: {
591
- description: `A string of spaces that will be added immediately after the type's initial
592
- curly bracket and immediately before its ending curly bracket. Defaults
593
- to the empty string.`,
594
- type: 'string'
595
- },
596
- unionSpacing: {
597
- description: 'Determines the spacing to add to unions (`|`). Defaults to a single space (`" "`).',
598
- type: 'string'
599
- }
600
- },
601
- type: 'object'
602
- }],
603
- type: 'suggestion'
604
- }
605
- });
606
- module.exports = exports.default;
607
- //# sourceMappingURL=typeFormatting.cjs.map