eslint-plugin-jsdoc 55.2.0 → 55.4.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.
@@ -0,0 +1,333 @@
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 }; }
10
+ var _default = exports.default = (0, _iterateJsdoc.default)(({
11
+ context,
12
+ indent,
13
+ jsdoc,
14
+ settings,
15
+ utils
16
+ }) => {
17
+ const {
18
+ arrayBrackets = 'square',
19
+ enableFixer = true,
20
+ genericDot = false,
21
+ objectFieldIndent = '',
22
+ objectFieldQuote = null,
23
+ objectFieldSeparator = 'comma',
24
+ objectFieldSeparatorTrailingPunctuation = false,
25
+ propertyQuotes = null,
26
+ separatorForSingleObjectField = false,
27
+ stringQuotes = 'single',
28
+ typeBracketSpacing = '',
29
+ unionSpacing = ' '
30
+ } = context.options[0] || {};
31
+ const {
32
+ mode
33
+ } = settings;
34
+
35
+ /**
36
+ * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag
37
+ */
38
+ const checkTypeFormats = tag => {
39
+ const potentialType = tag.type;
40
+ let parsedType;
41
+ try {
42
+ parsedType = mode === 'permissive' ? (0, _jsdoccomment.tryParse)(/** @type {string} */potentialType) : (0, _jsdoccomment.parse)(/** @type {string} */potentialType, mode);
43
+ } catch {
44
+ return;
45
+ }
46
+ const fix = () => {
47
+ const typeLines = (0, _jsdoccomment.stringify)(parsedType).split('\n');
48
+ const firstTypeLine = typeLines.shift();
49
+ const lastTypeLine = typeLines.pop();
50
+ const beginNameOrDescIdx = tag.source.findIndex(({
51
+ tokens
52
+ }) => {
53
+ return tokens.name || tokens.description;
54
+ });
55
+ const nameAndDesc = beginNameOrDescIdx === -1 ? null : tag.source.slice(beginNameOrDescIdx);
56
+ const initialNumber = tag.source[0].number;
57
+ const src = [
58
+ // Get inevitably present tag from first `tag.source`
59
+ {
60
+ number: initialNumber,
61
+ source: '',
62
+ tokens: {
63
+ ...tag.source[0].tokens,
64
+ ...(typeLines.length || lastTypeLine ? {
65
+ end: '',
66
+ name: '',
67
+ postName: '',
68
+ postType: ''
69
+ } : {}),
70
+ type: '{' + typeBracketSpacing + firstTypeLine + (!typeLines.length && lastTypeLine === undefined ? typeBracketSpacing + '}' : '')
71
+ }
72
+ },
73
+ // Get any intervening type lines
74
+ ...(typeLines.length ? typeLines.map((typeLine, idx) => {
75
+ return {
76
+ number: initialNumber + idx + 1,
77
+ source: '',
78
+ tokens: {
79
+ // Grab any delimiter info from first item
80
+ ...tag.source[0].tokens,
81
+ delimiter: tag.source[0].tokens.delimiter === '/**' ? '*' : tag.source[0].tokens.delimiter,
82
+ end: '',
83
+ name: '',
84
+ postName: '',
85
+ postTag: '',
86
+ postType: '',
87
+ start: indent + ' ',
88
+ tag: '',
89
+ type: typeLine
90
+ }
91
+ };
92
+ }) : [])];
93
+
94
+ // Merge any final type line and name and description
95
+ if (
96
+ // Name and description may be already included if present with the tag
97
+ nameAndDesc && beginNameOrDescIdx > 0) {
98
+ src.push({
99
+ number: src.length + 1,
100
+ source: '',
101
+ tokens: {
102
+ ...nameAndDesc[0].tokens,
103
+ type: lastTypeLine + typeBracketSpacing + '}'
104
+ }
105
+ });
106
+ if (
107
+ // Get any remaining description lines
108
+ nameAndDesc.length > 1) {
109
+ src.push(...nameAndDesc.slice(1).map(({
110
+ source,
111
+ tokens
112
+ }, idx) => {
113
+ return {
114
+ number: src.length + idx + 2,
115
+ source,
116
+ tokens
117
+ };
118
+ }));
119
+ }
120
+ } else if (nameAndDesc) {
121
+ if (lastTypeLine) {
122
+ src.push({
123
+ number: src.length + 1,
124
+ source: '',
125
+ tokens: {
126
+ ...nameAndDesc[0].tokens,
127
+ delimiter: nameAndDesc[0].tokens.delimiter === '/**' ? '*' : nameAndDesc[0].tokens.delimiter,
128
+ postTag: '',
129
+ start: indent + ' ',
130
+ tag: '',
131
+ type: lastTypeLine + typeBracketSpacing + '}'
132
+ }
133
+ });
134
+ }
135
+ if (
136
+ // Get any remaining description lines
137
+ nameAndDesc.length > 1) {
138
+ src.push(...nameAndDesc.slice(1).map(({
139
+ source,
140
+ tokens
141
+ }, idx) => {
142
+ return {
143
+ number: src.length + idx + 2,
144
+ source,
145
+ tokens
146
+ };
147
+ }));
148
+ }
149
+ }
150
+ tag.source = src;
151
+
152
+ // Properly rewire `jsdoc.source`
153
+ const firstTagIdx = jsdoc.source.findIndex(({
154
+ tokens: {
155
+ tag: tg
156
+ }
157
+ }) => {
158
+ return tg;
159
+ });
160
+ const initialEndSource = jsdoc.source.find(({
161
+ tokens: {
162
+ end
163
+ }
164
+ }) => {
165
+ return end;
166
+ });
167
+ jsdoc.source = [...jsdoc.source.slice(0, firstTagIdx), ...jsdoc.tags.flatMap(({
168
+ source
169
+ }) => {
170
+ return source;
171
+ })];
172
+ if (initialEndSource && !jsdoc.source.at(-1)?.tokens?.end) {
173
+ jsdoc.source.push(initialEndSource);
174
+ }
175
+ };
176
+
177
+ /** @type {string[]} */
178
+ const errorMessages = [];
179
+ if (typeBracketSpacing && (!tag.type.startsWith(typeBracketSpacing) || !tag.type.endsWith(typeBracketSpacing))) {
180
+ errorMessages.push(`Must have initial and final "${typeBracketSpacing}" spacing`);
181
+ } else if (!typeBracketSpacing && (/^\s/v.test(tag.type) || /\s$/v.test(tag.type))) {
182
+ errorMessages.push('Must have no initial spacing');
183
+ }
184
+
185
+ // eslint-disable-next-line complexity -- Todo
186
+ (0, _jsdoccomment.traverse)(parsedType, nde => {
187
+ let errorMessage = '';
188
+ switch (nde.type) {
189
+ case 'JsdocTypeGeneric':
190
+ {
191
+ const typeNode = /** @type {import('jsdoc-type-pratt-parser').GenericResult} */nde;
192
+ if ('value' in typeNode.left && typeNode.left.value === 'Array') {
193
+ if (typeNode.meta.brackets !== arrayBrackets) {
194
+ typeNode.meta.brackets = arrayBrackets;
195
+ errorMessage = `Array bracket style should be ${arrayBrackets}`;
196
+ }
197
+ } else if (typeNode.meta.dot !== genericDot) {
198
+ typeNode.meta.dot = genericDot;
199
+ errorMessage = `Dot usage should be ${genericDot}`;
200
+ }
201
+ break;
202
+ }
203
+ case 'JsdocTypeObject':
204
+ {
205
+ const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */nde;
206
+ if (/* c8 ignore next -- Guard */
207
+ (typeNode.meta.separator ?? 'comma') !== objectFieldSeparator || (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField || (typeNode.meta.propertyIndent ?? '') !== objectFieldIndent || (typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation) {
208
+ typeNode.meta.separator = objectFieldSeparator;
209
+ typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;
210
+ typeNode.meta.propertyIndent = objectFieldIndent;
211
+ typeNode.meta.trailingPunctuation = objectFieldSeparatorTrailingPunctuation;
212
+ errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;
213
+ }
214
+ break;
215
+ }
216
+ case 'JsdocTypeObjectField':
217
+ {
218
+ const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectFieldResult} */nde;
219
+ if ((objectFieldQuote || typeof typeNode.key === 'string' && !/\s/v.test(typeNode.key)) && typeNode.meta.quote !== (objectFieldQuote ?? undefined)) {
220
+ typeNode.meta.quote = objectFieldQuote ?? undefined;
221
+ errorMessage = `Inconsistent object field quotes ${objectFieldQuote}`;
222
+ }
223
+ break;
224
+ }
225
+ case 'JsdocTypeProperty':
226
+ {
227
+ const typeNode = /** @type {import('jsdoc-type-pratt-parser').PropertyResult} */nde;
228
+ if ((propertyQuotes || typeof typeNode.value === 'string' && !/\s/v.test(typeNode.value)) && typeNode.meta.quote !== (propertyQuotes ?? undefined)) {
229
+ typeNode.meta.quote = propertyQuotes ?? undefined;
230
+ errorMessage = `Inconsistent ${propertyQuotes} property quotes usage`;
231
+ }
232
+ break;
233
+ }
234
+ case 'JsdocTypeStringValue':
235
+ {
236
+ const typeNode = /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */nde;
237
+ if (typeNode.meta.quote !== stringQuotes) {
238
+ typeNode.meta.quote = stringQuotes;
239
+ errorMessage = `Inconsistent ${stringQuotes} string quotes usage`;
240
+ }
241
+ break;
242
+ }
243
+ case 'JsdocTypeUnion':
244
+ {
245
+ const typeNode = /** @type {import('jsdoc-type-pratt-parser').UnionResult} */nde;
246
+ /* c8 ignore next -- Guard */
247
+ if ((typeNode.meta?.spacing ?? ' ') !== unionSpacing) {
248
+ typeNode.meta = {
249
+ spacing: unionSpacing
250
+ };
251
+ errorMessage = `Inconsistent "${unionSpacing}" union spacing usage`;
252
+ }
253
+ break;
254
+ }
255
+ default:
256
+ break;
257
+ }
258
+ if (errorMessage) {
259
+ errorMessages.push(errorMessage);
260
+ }
261
+ });
262
+ const differentResult = tag.type !== typeBracketSpacing + (0, _jsdoccomment.stringify)(parsedType) + typeBracketSpacing;
263
+ if (errorMessages.length && differentResult) {
264
+ for (const errorMessage of errorMessages) {
265
+ utils.reportJSDoc(errorMessage, tag, enableFixer ? fix : null);
266
+ }
267
+ // Stringification may have been equal previously (and thus no error reported)
268
+ // because the stringification doesn't preserve everything
269
+ } else if (differentResult) {
270
+ utils.reportJSDoc('There was an error with type formatting', tag, enableFixer ? fix : null);
271
+ }
272
+ };
273
+ const tags = utils.getPresentTags(['param', 'returns', 'type', 'typedef']);
274
+ for (const tag of tags) {
275
+ if (tag.type) {
276
+ checkTypeFormats(tag);
277
+ }
278
+ }
279
+ }, {
280
+ iterateAllJsdocs: true,
281
+ meta: {
282
+ docs: {
283
+ description: 'Formats JSDoc type values.',
284
+ url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header'
285
+ },
286
+ fixable: 'code',
287
+ schema: [{
288
+ additionalProperties: false,
289
+ properties: {
290
+ arrayBrackets: {
291
+ enum: ['angle', 'square']
292
+ },
293
+ enableFixer: {
294
+ type: 'boolean'
295
+ },
296
+ genericDot: {
297
+ type: 'boolean'
298
+ },
299
+ objectFieldIndent: {
300
+ type: 'string'
301
+ },
302
+ objectFieldQuote: {
303
+ enum: ['double', 'single', null]
304
+ },
305
+ objectFieldSeparator: {
306
+ enum: ['comma', 'comma-and-linebreak', 'linebreak', 'semicolon', 'semicolon-and-linebreak']
307
+ },
308
+ objectFieldSeparatorTrailingPunctuation: {
309
+ type: 'boolean'
310
+ },
311
+ propertyQuotes: {
312
+ enum: ['double', 'single', null]
313
+ },
314
+ separatorForSingleObjectField: {
315
+ type: 'boolean'
316
+ },
317
+ stringQuotes: {
318
+ enum: ['double', 'single']
319
+ },
320
+ typeBracketSpacing: {
321
+ type: 'string'
322
+ },
323
+ unionSpacing: {
324
+ type: 'string'
325
+ }
326
+ },
327
+ type: 'object'
328
+ }],
329
+ type: 'suggestion'
330
+ }
331
+ });
332
+ module.exports = exports.default;
333
+ //# sourceMappingURL=typeFormatting.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeFormatting.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_jsdoccomment","e","__esModule","default","_default","exports","iterateJsdoc","context","indent","jsdoc","settings","utils","arrayBrackets","enableFixer","genericDot","objectFieldIndent","objectFieldQuote","objectFieldSeparator","objectFieldSeparatorTrailingPunctuation","propertyQuotes","separatorForSingleObjectField","stringQuotes","typeBracketSpacing","unionSpacing","options","mode","checkTypeFormats","tag","potentialType","type","parsedType","tryParseType","parseType","fix","typeLines","stringify","split","firstTypeLine","shift","lastTypeLine","pop","beginNameOrDescIdx","source","findIndex","tokens","name","description","nameAndDesc","slice","initialNumber","number","src","length","end","postName","postType","undefined","map","typeLine","idx","delimiter","postTag","start","push","firstTagIdx","tg","initialEndSource","find","tags","flatMap","at","errorMessages","startsWith","endsWith","test","traverse","nde","errorMessage","typeNode","left","value","meta","brackets","dot","separator","propertyIndent","trailingPunctuation","key","quote","spacing","differentResult","reportJSDoc","getPresentTags","iterateAllJsdocs","docs","url","fixable","schema","additionalProperties","properties","enum","module"],"sources":["../../src/rules/typeFormatting.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n parse as parseType,\n stringify,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n settings,\n utils,\n}) => {\n const {\n arrayBrackets = 'square',\n enableFixer = true,\n genericDot = false,\n objectFieldIndent = '',\n objectFieldQuote = null,\n objectFieldSeparator = 'comma',\n objectFieldSeparatorTrailingPunctuation = false,\n propertyQuotes = null,\n separatorForSingleObjectField = false,\n stringQuotes = 'single',\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 const typeLines = stringify(parsedType).split('\\n');\n const firstTypeLine = typeLines.shift();\n const lastTypeLine = typeLines.pop();\n\n const beginNameOrDescIdx = tag.source.findIndex(({\n tokens,\n }) => {\n return tokens.name || tokens.description;\n });\n\n const nameAndDesc = beginNameOrDescIdx === -1 ?\n null :\n tag.source.slice(beginNameOrDescIdx);\n\n const initialNumber = tag.source[0].number;\n const src = [\n // Get inevitably present tag from first `tag.source`\n {\n number: initialNumber,\n source: '',\n tokens: {\n ...tag.source[0].tokens,\n ...(typeLines.length || lastTypeLine ? {\n end: '',\n name: '',\n postName: '',\n postType: '',\n } : {}),\n type: '{' + typeBracketSpacing + firstTypeLine + (!typeLines.length && lastTypeLine === undefined ? typeBracketSpacing + '}' : ''),\n },\n },\n // Get any intervening type lines\n ...(typeLines.length ? typeLines.map((typeLine, idx) => {\n return {\n number: initialNumber + idx + 1,\n source: '',\n tokens: {\n // Grab any delimiter info from first item\n ...tag.source[0].tokens,\n delimiter: tag.source[0].tokens.delimiter === '/**' ? '*' : tag.source[0].tokens.delimiter,\n end: '',\n name: '',\n postName: '',\n postTag: '',\n postType: '',\n start: indent + ' ',\n tag: '',\n type: typeLine,\n },\n };\n }) : []),\n ];\n\n // Merge any final type line and name and description\n if (\n // Name and description may be already included if present with the tag\n nameAndDesc && beginNameOrDescIdx > 0\n ) {\n src.push({\n number: src.length + 1,\n source: '',\n tokens: {\n ...nameAndDesc[0].tokens,\n type: lastTypeLine + typeBracketSpacing + '}',\n },\n });\n\n if (\n // Get any remaining description lines\n nameAndDesc.length > 1\n ) {\n src.push(\n ...nameAndDesc.slice(1).map(({\n source,\n tokens,\n }, idx) => {\n return {\n number: src.length + idx + 2,\n source,\n tokens,\n };\n }),\n );\n }\n } else if (nameAndDesc) {\n if (lastTypeLine) {\n src.push({\n number: src.length + 1,\n source: '',\n tokens: {\n ...nameAndDesc[0].tokens,\n delimiter: nameAndDesc[0].tokens.delimiter === '/**' ? '*' : nameAndDesc[0].tokens.delimiter,\n postTag: '',\n start: indent + ' ',\n tag: '',\n type: lastTypeLine + typeBracketSpacing + '}',\n },\n });\n }\n\n if (\n // Get any remaining description lines\n nameAndDesc.length > 1\n ) {\n src.push(\n ...nameAndDesc.slice(1).map(({\n source,\n tokens,\n }, idx) => {\n return {\n number: src.length + idx + 2,\n source,\n tokens,\n };\n }),\n );\n }\n }\n\n tag.source = src;\n\n // Properly rewire `jsdoc.source`\n const firstTagIdx = jsdoc.source.findIndex(({\n tokens: {\n tag: tg,\n },\n }) => {\n return tg;\n });\n\n const initialEndSource = jsdoc.source.find(({\n tokens: {\n end,\n },\n }) => {\n return end;\n });\n\n jsdoc.source = [\n ...jsdoc.source.slice(0, firstTagIdx),\n ...jsdoc.tags.flatMap(({\n source,\n }) => {\n return source;\n }),\n ];\n\n if (initialEndSource && !jsdoc.source.at(-1)?.tokens?.end) {\n jsdoc.source.push(initialEndSource);\n }\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 switch (nde.type) {\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 }\n\n break;\n }\n\n case 'JsdocTypeObject': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */ (nde);\n if (\n /* c8 ignore next -- Guard */\n (typeNode.meta.separator ?? 'comma') !== objectFieldSeparator ||\n (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField ||\n (typeNode.meta.propertyIndent ?? '') !== objectFieldIndent ||\n (typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation\n ) {\n typeNode.meta.separator = objectFieldSeparator;\n typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;\n typeNode.meta.propertyIndent = objectFieldIndent;\n typeNode.meta.trailingPunctuation = objectFieldSeparatorTrailingPunctuation;\n errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;\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' && !(/\\s/v).test(typeNode.key))) &&\n typeNode.meta.quote !== (objectFieldQuote ?? undefined)\n ) {\n typeNode.meta.quote = objectFieldQuote ?? undefined;\n errorMessage = `Inconsistent object field quotes ${objectFieldQuote}`;\n }\n\n break;\n }\n\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 '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 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 'returns',\n 'type',\n 'typedef',\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 enum: [\n 'angle',\n 'square',\n ],\n },\n enableFixer: {\n type: 'boolean',\n },\n genericDot: {\n type: 'boolean',\n },\n objectFieldIndent: {\n type: 'string',\n },\n objectFieldQuote: {\n enum: [\n 'double',\n 'single',\n null,\n ],\n },\n objectFieldSeparator: {\n enum: [\n 'comma',\n 'comma-and-linebreak',\n 'linebreak',\n 'semicolon',\n 'semicolon-and-linebreak',\n ],\n },\n objectFieldSeparatorTrailingPunctuation: {\n type: 'boolean',\n },\n propertyQuotes: {\n enum: [\n 'double',\n 'single',\n null,\n ],\n },\n separatorForSingleObjectField: {\n type: 'boolean',\n },\n stringQuotes: {\n enum: [\n 'double',\n 'single',\n ],\n },\n typeBracketSpacing: {\n type: 'string',\n },\n unionSpacing: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAK8B,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEf,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM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ACR,CAAC;QACDR,YAAY,EAAE;UACZ+E,IAAI,EAAE,CACJ,QAAQ,EACR,QAAQ;QAEZ,CAAC;QACD9E,kBAAkB,EAAE;UAClBO,IAAI,EAAE;QACR,CAAC;QACDN,YAAY,EAAE;UACZM,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAwE,MAAA,CAAAhG,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("eslint").Rule.RuleModule;
2
+ export default _default;
3
+ //# sourceMappingURL=typeFormatting.d.ts.map
package/dist/rules.d.ts CHANGED
@@ -756,6 +756,25 @@ export interface Rules {
756
756
  }
757
757
  ];
758
758
 
759
+ "jsdoc/type-formatting":
760
+ | []
761
+ | [
762
+ {
763
+ arrayBrackets?: "angle" | "square";
764
+ enableFixer?: boolean;
765
+ genericDot?: boolean;
766
+ objectFieldIndent?: string;
767
+ objectFieldQuote?: "double" | "single" | null;
768
+ objectFieldSeparator?: "comma" | "comma-and-linebreak" | "linebreak" | "semicolon" | "semicolon-and-linebreak";
769
+ objectFieldSeparatorTrailingPunctuation?: boolean;
770
+ propertyQuotes?: "double" | "single" | null;
771
+ separatorForSingleObjectField?: boolean;
772
+ stringQuotes?: "double" | "single";
773
+ typeBracketSpacing?: string;
774
+ unionSpacing?: string;
775
+ }
776
+ ];
777
+
759
778
  "jsdoc/valid-types":
760
779
  | []
761
780
  | [
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "http://gajus.com"
6
6
  },
7
7
  "dependencies": {
8
- "@es-joy/jsdoccomment": "~0.57.0",
8
+ "@es-joy/jsdoccomment": "~0.58.0",
9
9
  "are-docs-informative": "^0.0.2",
10
10
  "comment-parser": "1.4.1",
11
11
  "debug": "^4.4.1",
@@ -56,7 +56,7 @@
56
56
  "glob": "^11.0.3",
57
57
  "globals": "^16.4.0",
58
58
  "husky": "^9.1.7",
59
- "jsdoc-type-pratt-parser": "^5.2.0",
59
+ "jsdoc-type-pratt-parser": "^5.4.0",
60
60
  "json-schema": "^0.4.0",
61
61
  "json-schema-to-typescript": "^15.0.4",
62
62
  "lint-staged": "^16.1.6",
@@ -64,7 +64,7 @@
64
64
  "open-editor": "^5.1.0",
65
65
  "replace": "^1.2.2",
66
66
  "rimraf": "^6.0.1",
67
- "semantic-release": "^24.2.7",
67
+ "semantic-release": "^24.2.8",
68
68
  "typescript": "5.9.2",
69
69
  "typescript-eslint": "^8.43.0"
70
70
  },
@@ -160,5 +160,5 @@
160
160
  "test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
161
161
  "test-index": "pnpm run test-no-cov test/rules/index.js"
162
162
  },
163
- "version": "55.2.0"
163
+ "version": "55.4.0"
164
164
  }
package/src/index-cjs.js CHANGED
@@ -57,6 +57,7 @@ import requireYieldsCheck from './rules/requireYieldsCheck.js';
57
57
  import sortTags from './rules/sortTags.js';
58
58
  import tagLines from './rules/tagLines.js';
59
59
  import textEscaping from './rules/textEscaping.js';
60
+ import typeFormatting from './rules/typeFormatting.js';
60
61
  import validTypes from './rules/validTypes.js';
61
62
 
62
63
  /* eslint-disable jsdoc/valid-types -- Bug */
@@ -129,6 +130,7 @@ index.rules = {
129
130
  'sort-tags': sortTags,
130
131
  'tag-lines': tagLines,
131
132
  'text-escaping': textEscaping,
133
+ 'type-formatting': typeFormatting,
132
134
  'valid-types': validTypes,
133
135
  };
134
136
 
@@ -206,6 +208,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
206
208
  'jsdoc/sort-tags': 'off',
207
209
  'jsdoc/tag-lines': warnOrError,
208
210
  'jsdoc/text-escaping': 'off',
211
+ 'jsdoc/type-formatting': 'off',
209
212
  'jsdoc/valid-types': warnOrError,
210
213
  },
211
214
  };
package/src/index.js CHANGED
@@ -63,6 +63,7 @@ import requireYieldsCheck from './rules/requireYieldsCheck.js';
63
63
  import sortTags from './rules/sortTags.js';
64
64
  import tagLines from './rules/tagLines.js';
65
65
  import textEscaping from './rules/textEscaping.js';
66
+ import typeFormatting from './rules/typeFormatting.js';
66
67
  import validTypes from './rules/validTypes.js';
67
68
 
68
69
  /* eslint-disable jsdoc/valid-types -- Bug */
@@ -135,6 +136,7 @@ index.rules = {
135
136
  'sort-tags': sortTags,
136
137
  'tag-lines': tagLines,
137
138
  'text-escaping': textEscaping,
139
+ 'type-formatting': typeFormatting,
138
140
  'valid-types': validTypes,
139
141
  };
140
142
 
@@ -212,6 +214,7 @@ const createRecommendedRuleset = (warnOrError, flatName) => {
212
214
  'jsdoc/sort-tags': 'off',
213
215
  'jsdoc/tag-lines': warnOrError,
214
216
  'jsdoc/text-escaping': 'off',
217
+ 'jsdoc/type-formatting': 'off',
215
218
  'jsdoc/valid-types': warnOrError,
216
219
  },
217
220
  };