@@ -22,30 +22,48 @@ A single options object has the following properties.
2222
2323Determines how array generics are represented. Set to ` angle ` for the style ` Array<type> ` or ` square ` for the style ` type[] ` . Defaults to "square".
2424
25- <a name =" user-content-type-formatting-options-defaultvaluespacing " ></a >
26- <a name =" type-formatting-options-defaultvaluespacing " ></a >
27- ### <code >defaultValueSpacing</code >
28-
29- The space character (if any) to use between the equal signs of a default value
30-
31- <a name =" user-content-type-formatting-options-elementspacing " ></a >
32- <a name =" type-formatting-options-elementspacing " ></a >
33- ### <code >elementSpacing</code >
34-
35- The space character (if any) to use between elements in generics and tuples
36-
3725<a name =" user-content-type-formatting-options-enablefixer " ></a >
3826<a name =" type-formatting-options-enablefixer " ></a >
3927### <code >enableFixer</code >
4028
4129Whether to enable the fixer. Defaults to ` true ` .
4230
31+ <a name =" user-content-type-formatting-options-genericandtupleelementspacing " ></a >
32+ <a name =" type-formatting-options-genericandtupleelementspacing " ></a >
33+ ### <code >genericAndTupleElementSpacing</code >
34+
35+ The space character (if any) to use between elements in generics and tuples
36+
4337<a name =" user-content-type-formatting-options-genericdot " ></a >
4438<a name =" type-formatting-options-genericdot " ></a >
4539### <code >genericDot</code >
4640
4741Boolean value of whether to use a dot before the angled brackets of a generic (e.g., ` SomeType.<AnotherType> ` ). Defaults to ` false ` .
4842
43+ <a name =" user-content-type-formatting-options-keyvaluepostcolonspacing " ></a >
44+ <a name =" type-formatting-options-keyvaluepostcolonspacing " ></a >
45+ ### <code >keyValuePostColonSpacing</code >
46+
47+ The amount of spacing (if any) after the colon of a key-value or object-field pair
48+
49+ <a name =" user-content-type-formatting-options-keyvaluepostkeyspacing " ></a >
50+ <a name =" type-formatting-options-keyvaluepostkeyspacing " ></a >
51+ ### <code >keyValuePostKeySpacing</code >
52+
53+ The amount of spacing (if any) immediately after keys in a key-value or object-field pair
54+
55+ <a name =" user-content-type-formatting-options-keyvaluepostoptionalspacing " ></a >
56+ <a name =" type-formatting-options-keyvaluepostoptionalspacing " ></a >
57+ ### <code >keyValuePostOptionalSpacing</code >
58+
59+ The amount of spacing (if any) after the optional operator (` ? ` ) in a key-value or object-field pair
60+
61+ <a name =" user-content-type-formatting-options-keyvaluepostvariadicspacing " ></a >
62+ <a name =" type-formatting-options-keyvaluepostvariadicspacing " ></a >
63+ ### <code >keyValuePostVariadicSpacing</code >
64+
65+ The amount of spacing (if any) after a variadic operator (` ... ` ) in a key-value pair
66+
4967<a name =" user-content-type-formatting-options-objectfieldindent " ></a >
5068<a name =" type-formatting-options-objectfieldindent " ></a >
5169### <code >objectFieldIndent</code >
@@ -91,6 +109,12 @@ will determine whether to add punctuation corresponding to the
91109` objectFieldSeparator ` (e.g., a semicolon) to the final object field.
92110Defaults to ` false ` .
93111
112+ <a name =" user-content-type-formatting-options-parameterdefaultvaluespacing " ></a >
113+ <a name =" type-formatting-options-parameterdefaultvaluespacing " ></a >
114+ ### <code >parameterDefaultValueSpacing</code >
115+
116+ The space character (if any) to use between the equal signs of a default value
117+
94118<a name =" user-content-type-formatting-options-separatorforsingleobjectfield " ></a >
95119<a name =" type-formatting-options-separatorforsingleobjectfield " ></a >
96120### <code >separatorForSingleObjectField</code >
@@ -126,7 +150,7 @@ Determines the spacing to add to unions (`|`). Defaults to a single space (`" "`
126150| Tags| ` param ` , ` property ` , ` returns ` , ` this ` , ` throws ` , ` type ` , ` typedef ` , ` yields ` |
127151| Recommended| false|
128152| Settings| ` mode ` |
129- | Options| ` arrayBrackets ` , ` defaultValueSpacing ` , ` elementSpacing ` , ` enableFixer ` , ` genericDot ` , ` objectFieldIndent ` , ` objectFieldQuote ` , ` objectFieldSeparator ` , ` objectFieldSeparatorOptionalLinebreak ` , ` objectFieldSeparatorTrailingPunctuation ` , ` separatorForSingleObjectField ` , ` stringQuotes ` , ` typeBracketSpacing ` , ` unionSpacing ` |
153+ | Options| ` arrayBrackets ` , ` enableFixer ` , ` genericAndTupleElementSpacing ` , ` genericDot ` , ` keyValuePostColonSpacing ` , ` keyValuePostKeySpacing ` , ` keyValuePostOptionalSpacing ` , ` keyValuePostVariadicSpacing ` , ` objectFieldIndent ` , ` objectFieldQuote ` , ` objectFieldSeparator ` , ` objectFieldSeparatorOptionalLinebreak ` , ` objectFieldSeparatorTrailingPunctuation ` , ` parameterDefaultValueSpacing ` , ` separatorForSingleObjectField ` , ` stringQuotes ` , ` typeBracketSpacing ` , ` unionSpacing ` |
130154
131155<a name =" user-content-type-formatting-failing-examples " ></a >
132156<a name =" type-formatting-failing-examples " ></a >
@@ -304,20 +328,56 @@ The following patterns are considered problems:
304328/**
305329 * @param {SomeType<T, U>} cfg
306330 */
307- // "jsdoc/type-formatting": ["error"|"warn", {"elementSpacing ":""}]
331+ // "jsdoc/type-formatting": ["error"|"warn", {"genericAndTupleElementSpacing ":""}]
308332// Message: Element spacing should be ""
309333
310334/**
311335 * @param {[string, number]} cfg
312336 */
313- // "jsdoc/type-formatting": ["error"|"warn", {"elementSpacing ":""}]
337+ // "jsdoc/type-formatting": ["error"|"warn", {"genericAndTupleElementSpacing ":""}]
314338// Message: Element spacing should be ""
315339
316340/**
317341 * @param {<T, U extends V = string, W = string>(x: T) => U} cfg
318342 */
319- // "jsdoc/type-formatting": ["error"|"warn", {"defaultValueSpacing ":""}]
343+ // "jsdoc/type-formatting": ["error"|"warn", {"parameterDefaultValueSpacing ":""}]
320344// Message: Default value spacing should be ""
345+
346+ /**
347+ * @param {{a: 3}} cfg
348+ */
349+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostColonSpacing":""}]
350+ // Message: Post colon spacing should be ""
351+
352+ /**
353+ * @param {{a: 3}} cfg
354+ */
355+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostKeySpacing":" "}]
356+ // Message: Post key spacing should be " "
357+
358+ /**
359+ * @param {{a?: 3}} cfg
360+ */
361+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostOptionalSpacing":" "}]
362+ // Message: Post optional (`?`) spacing should be " "
363+
364+ /**
365+ * @param {[a: 3]} cfg
366+ */
367+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostColonSpacing":""}]
368+ // Message: Post colon spacing should be ""
369+
370+ /**
371+ * @param {[a: 3]} cfg
372+ */
373+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostKeySpacing":" "}]
374+ // Message: Post key spacing should be " "
375+
376+ /**
377+ * @param {[a?: 3]} cfg
378+ */
379+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostOptionalSpacing":" "}]
380+ // Message: Post optional (`?`) spacing should be " "
321381````
322382
323383
@@ -401,16 +461,46 @@ The following patterns are not considered problems:
401461/**
402462 * @param {SomeType<T,U>} cfg
403463 */
404- // "jsdoc/type-formatting": ["error"|"warn", {"elementSpacing ":""}]
464+ // "jsdoc/type-formatting": ["error"|"warn", {"genericAndTupleElementSpacing ":""}]
405465
406466/**
407467 * @param {[string,number]} cfg
408468 */
409- // "jsdoc/type-formatting": ["error"|"warn", {"elementSpacing ":""}]
469+ // "jsdoc/type-formatting": ["error"|"warn", {"genericAndTupleElementSpacing ":""}]
410470
411471/**
412472 * @param {<T, U extends V=string, W=string>(x: T) => U} cfg
413473 */
414- // "jsdoc/type-formatting": ["error"|"warn", {"defaultValueSpacing":""}]
474+ // "jsdoc/type-formatting": ["error"|"warn", {"parameterDefaultValueSpacing":""}]
475+
476+ /**
477+ * @param {{a:3}} cfg
478+ */
479+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostColonSpacing":""}]
480+
481+ /**
482+ * @param {{a : 3}} cfg
483+ */
484+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostKeySpacing":" "}]
485+
486+ /**
487+ * @param {{a? : 3}} cfg
488+ */
489+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostOptionalSpacing":" "}]
490+
491+ /**
492+ * @param {[a:3]} cfg
493+ */
494+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostColonSpacing":""}]
495+
496+ /**
497+ * @param {[a : 3]} cfg
498+ */
499+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostKeySpacing":" "}]
500+
501+ /**
502+ * @param {[a? : 3]} cfg
503+ */
504+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostOptionalSpacing":" "}]
415505````
416506
0 commit comments