@@ -17,6 +17,7 @@ export default iterateJsdoc(({
1717} ) => {
1818 const {
1919 arrayBrackets = 'square' ,
20+ elementSpacing = ' ' ,
2021 enableFixer = true ,
2122 genericDot = false ,
2223 objectFieldIndent = '' ,
@@ -226,6 +227,9 @@ export default iterateJsdoc(({
226227 } else if ( typeNode . meta . dot !== genericDot ) {
227228 typeNode . meta . dot = genericDot ;
228229 errorMessage = `Dot usage should be ${ genericDot } ` ;
230+ } else if ( ( typeNode . meta . elementSpacing ?? ' ' ) !== elementSpacing ) {
231+ typeNode . meta . elementSpacing = elementSpacing ;
232+ errorMessage = `Element spacing should be "${ elementSpacing } "` ;
229233 }
230234
231235 break ;
@@ -277,6 +281,16 @@ export default iterateJsdoc(({
277281 break ;
278282 }
279283
284+ case 'JsdocTypeStringValue' : {
285+ const typeNode = /** @type {import('jsdoc-type-pratt-parser').StringValueResult } */ ( nde ) ;
286+ if ( typeNode . meta . quote !== stringQuotes ) {
287+ typeNode . meta . quote = stringQuotes ;
288+ errorMessage = `Inconsistent ${ stringQuotes } string quotes usage` ;
289+ }
290+
291+ break ;
292+ }
293+
280294 // Only suitable for namepaths (and would need changes); see https://github.com/gajus/eslint-plugin-jsdoc/issues/1524
281295 // case 'JsdocTypeProperty': {
282296 // const typeNode = /** @type {import('jsdoc-type-pratt-parser').PropertyResult } */ (nde);
@@ -292,11 +306,13 @@ export default iterateJsdoc(({
292306 // break;
293307 // }
294308
295- case 'JsdocTypeStringValue' : {
296- const typeNode = /** @type {import('jsdoc-type-pratt-parser').StringValueResult } */ ( nde ) ;
297- if ( typeNode . meta . quote !== stringQuotes ) {
298- typeNode . meta . quote = stringQuotes ;
299- errorMessage = `Inconsistent ${ stringQuotes } string quotes usage` ;
309+ case 'JsdocTypeTuple' : {
310+ const typeNode = /** @type {import('jsdoc-type-pratt-parser').TupleResult } */ ( nde ) ;
311+ if ( ( typeNode . meta ?. elementSpacing ?? ' ' ) !== elementSpacing ) {
312+ typeNode . meta = {
313+ elementSpacing,
314+ } ;
315+ errorMessage = `Element spacing should be "${ elementSpacing } "` ;
300316 }
301317
302318 break ;
@@ -377,6 +393,10 @@ export default iterateJsdoc(({
377393 ] ,
378394 type : 'string' ,
379395 } ,
396+ elementSpacing : {
397+ description : 'The space character (if any) to use between elements in generics and tuples' ,
398+ type : 'string' ,
399+ } ,
380400 enableFixer : {
381401 description : 'Whether to enable the fixer. Defaults to `true`.' ,
382402 type : 'boolean' ,
0 commit comments