@@ -22,17 +22,59 @@ 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-arrowfunctionpostreturnmarkerspacing " ></a >
26+ <a name =" type-formatting-options-arrowfunctionpostreturnmarkerspacing " ></a >
27+ ### <code >arrowFunctionPostReturnMarkerSpacing</code >
28+
29+ The space character (if any) to use after return markers (` => ` ). Defaults to " ".
30+
31+ <a name =" user-content-type-formatting-options-arrowfunctionprereturnmarkerspacing " ></a >
32+ <a name =" type-formatting-options-arrowfunctionprereturnmarkerspacing " ></a >
33+ ### <code >arrowFunctionPreReturnMarkerSpacing</code >
34+
35+ The space character (if any) to use before return markers (` => ` ). Defaults to " ".
36+
2537<a name =" user-content-type-formatting-options-enablefixer " ></a >
2638<a name =" type-formatting-options-enablefixer " ></a >
2739### <code >enableFixer</code >
2840
2941Whether to enable the fixer. Defaults to ` true ` .
3042
43+ <a name =" user-content-type-formatting-options-functionorclassparameterspacing " ></a >
44+ <a name =" type-formatting-options-functionorclassparameterspacing " ></a >
45+ ### <code >functionOrClassParameterSpacing</code >
46+
47+ The space character (if any) to use between function or class parameters. Defaults to " ".
48+
49+ <a name =" user-content-type-formatting-options-functionorclasspostgenericspacing " ></a >
50+ <a name =" type-formatting-options-functionorclasspostgenericspacing " ></a >
51+ ### <code >functionOrClassPostGenericSpacing</code >
52+
53+ The space character (if any) to use after a generic expression in a function or class. Defaults to "".
54+
55+ <a name =" user-content-type-formatting-options-functionorclasspostreturnmarkerspacing " ></a >
56+ <a name =" type-formatting-options-functionorclasspostreturnmarkerspacing " ></a >
57+ ### <code >functionOrClassPostReturnMarkerSpacing</code >
58+
59+ The space character (if any) to use after return markers (` : ` ). Defaults to "".
60+
61+ <a name =" user-content-type-formatting-options-functionorclassprereturnmarkerspacing " ></a >
62+ <a name =" type-formatting-options-functionorclassprereturnmarkerspacing " ></a >
63+ ### <code >functionOrClassPreReturnMarkerSpacing</code >
64+
65+ The space character (if any) to use before return markers (` : ` ). Defaults to "".
66+
67+ <a name =" user-content-type-formatting-options-functionorclasstypeparameterspacing " ></a >
68+ <a name =" type-formatting-options-functionorclasstypeparameterspacing " ></a >
69+ ### <code >functionOrClassTypeParameterSpacing</code >
70+
71+ The space character (if any) to use between type parameters in a function or class. Defaults to " ".
72+
3173<a name =" user-content-type-formatting-options-genericandtupleelementspacing " ></a >
3274<a name =" type-formatting-options-genericandtupleelementspacing " ></a >
3375### <code >genericAndTupleElementSpacing</code >
3476
35- The space character (if any) to use between elements in generics and tuples
77+ The space character (if any) to use between elements in generics and tuples. Defaults to " ".
3678
3779<a name =" user-content-type-formatting-options-genericdot " ></a >
3880<a name =" type-formatting-options-genericdot " ></a >
@@ -44,25 +86,31 @@ Boolean value of whether to use a dot before the angled brackets of a generic (e
4486<a name =" type-formatting-options-keyvaluepostcolonspacing " ></a >
4587### <code >keyValuePostColonSpacing</code >
4688
47- The amount of spacing (if any) after the colon of a key-value or object-field pair
89+ The amount of spacing (if any) after the colon of a key-value or object-field pair. Defaults to " ".
4890
4991<a name =" user-content-type-formatting-options-keyvaluepostkeyspacing " ></a >
5092<a name =" type-formatting-options-keyvaluepostkeyspacing " ></a >
5193### <code >keyValuePostKeySpacing</code >
5294
53- The amount of spacing (if any) immediately after keys in a key-value or object-field pair
95+ The amount of spacing (if any) immediately after keys in a key-value or object-field pair. Defaults to "".
5496
5597<a name =" user-content-type-formatting-options-keyvaluepostoptionalspacing " ></a >
5698<a name =" type-formatting-options-keyvaluepostoptionalspacing " ></a >
5799### <code >keyValuePostOptionalSpacing</code >
58100
59- The amount of spacing (if any) after the optional operator (` ? ` ) in a key-value or object-field pair
101+ The amount of spacing (if any) after the optional operator (` ? ` ) in a key-value or object-field pair. Defaults to "".
60102
61103<a name =" user-content-type-formatting-options-keyvaluepostvariadicspacing " ></a >
62104<a name =" type-formatting-options-keyvaluepostvariadicspacing " ></a >
63105### <code >keyValuePostVariadicSpacing</code >
64106
65- The amount of spacing (if any) after a variadic operator (` ... ` ) in a key-value pair
107+ The amount of spacing (if any) after a variadic operator (` ... ` ) in a key-value pair. Defaults to "".
108+
109+ <a name =" user-content-type-formatting-options-methodquotes " ></a >
110+ <a name =" type-formatting-options-methodquotes " ></a >
111+ ### <code >methodQuotes</code >
112+
113+ The style of quotation mark for surrounding method names when quoted. Defaults to ` double `
66114
67115<a name =" user-content-type-formatting-options-objectfieldindent " ></a >
68116<a name =" type-formatting-options-objectfieldindent " ></a >
@@ -113,7 +161,19 @@ Defaults to `false`.
113161<a name =" type-formatting-options-parameterdefaultvaluespacing " ></a >
114162### <code >parameterDefaultValueSpacing</code >
115163
116- The space character (if any) to use between the equal signs of a default value
164+ The space character (if any) to use between the equal signs of a default value. Defaults to " ".
165+
166+ <a name =" user-content-type-formatting-options-postmethodnamespacing " ></a >
167+ <a name =" type-formatting-options-postmethodnamespacing " ></a >
168+ ### <code >postMethodNameSpacing</code >
169+
170+ The space character (if any) to add after a method name. Defaults to "".
171+
172+ <a name =" user-content-type-formatting-options-postnewspacing " ></a >
173+ <a name =" type-formatting-options-postnewspacing " ></a >
174+ ### <code >postNewSpacing</code >
175+
176+ The space character (if any) to add after "new" in a constructor. Defaults to " ".
117177
118178<a name =" user-content-type-formatting-options-separatorforsingleobjectfield " ></a >
119179<a name =" type-formatting-options-separatorforsingleobjectfield " ></a >
@@ -150,7 +210,7 @@ Determines the spacing to add to unions (`|`). Defaults to a single space (`" "`
150210| Tags| ` param ` , ` property ` , ` returns ` , ` this ` , ` throws ` , ` type ` , ` typedef ` , ` yields ` |
151211| Recommended| false|
152212| Settings| ` mode ` |
153- | Options| ` arrayBrackets ` , ` enableFixer ` , ` genericAndTupleElementSpacing ` , ` genericDot ` , ` keyValuePostColonSpacing ` , ` keyValuePostKeySpacing ` , ` keyValuePostOptionalSpacing ` , ` keyValuePostVariadicSpacing ` , ` objectFieldIndent ` , ` objectFieldQuote ` , ` objectFieldSeparator ` , ` objectFieldSeparatorOptionalLinebreak ` , ` objectFieldSeparatorTrailingPunctuation ` , ` parameterDefaultValueSpacing ` , ` separatorForSingleObjectField ` , ` stringQuotes ` , ` typeBracketSpacing ` , ` unionSpacing ` |
213+ | Options| ` arrayBrackets ` , ` arrowFunctionPostReturnMarkerSpacing ` , ` arrowFunctionPreReturnMarkerSpacing ` , ` enableFixer ` , ` functionOrClassParameterSpacing ` , ` functionOrClassPostGenericSpacing ` , ` functionOrClassPostReturnMarkerSpacing ` , ` functionOrClassPreReturnMarkerSpacing ` , ` functionOrClassTypeParameterSpacing ` , ` genericAndTupleElementSpacing ` , ` genericDot ` , ` keyValuePostColonSpacing ` , ` keyValuePostKeySpacing ` , ` keyValuePostOptionalSpacing ` , ` keyValuePostVariadicSpacing ` , ` methodQuotes ` , ` objectFieldIndent ` , ` objectFieldQuote ` , ` objectFieldSeparator ` , ` objectFieldSeparatorOptionalLinebreak ` , ` objectFieldSeparatorTrailingPunctuation ` , ` parameterDefaultValueSpacing ` , ` postMethodNameSpacing ` , ` postNewSpacing ` , ` separatorForSingleObjectField ` , ` stringQuotes ` , ` typeBracketSpacing ` , ` unionSpacing ` |
154214
155215<a name =" user-content-type-formatting-failing-examples " ></a >
156216<a name =" type-formatting-failing-examples " ></a >
@@ -378,6 +438,72 @@ The following patterns are considered problems:
378438 */
379439// "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostOptionalSpacing":" "}]
380440// Message: Post optional (`?`) spacing should be " "
441+
442+ /**
443+ * @param {() => void} cfg
444+ */
445+ // "jsdoc/type-formatting": ["error"|"warn", {"arrowFunctionPostReturnMarkerSpacing":""}]
446+ // Message: Post-return-marker spacing should be ""
447+
448+ /**
449+ * @param {() => void} cfg
450+ */
451+ // "jsdoc/type-formatting": ["error"|"warn", {"arrowFunctionPreReturnMarkerSpacing":""}]
452+ // Message: Pre-return-marker spacing should be ""
453+
454+ /**
455+ * @param {{hello(): void}} cfg
456+ */
457+ // "jsdoc/type-formatting": ["error"|"warn", {"postMethodNameSpacing":" "}]
458+ // Message: Post-method-name spacing should be " "
459+
460+ /**
461+ * @param {{new (): void}} cfg
462+ */
463+ // "jsdoc/type-formatting": ["error"|"warn", {"postNewSpacing":""}]
464+ // Message: Post-`new` spacing should be ""
465+
466+ /**
467+ * @param {function(): void} cfg
468+ */
469+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassPreReturnMarkerSpacing":" "}]
470+ // Message: Pre-return-marker spacing should be " "
471+
472+ /**
473+ * @param {{new (): void}} cfg
474+ */
475+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassPostReturnMarkerSpacing":""}]
476+ // Message: Post-return-marker spacing should be ""
477+
478+ /**
479+ * @param {{method(a: string, b: number): void}} cfg
480+ */
481+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassParameterSpacing":""}]
482+ // Message: Parameter spacing should be ""
483+
484+ /**
485+ * @param {{method<T>(a: T, b: number): void}} cfg
486+ */
487+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassPostGenericSpacing":" "}]
488+ // Message: Post-generic spacing should be " "
489+
490+ /**
491+ * @param {{method<T, U>(a: T, b: U): void}} cfg
492+ */
493+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassTypeParameterSpacing":""}]
494+ // Message: Type parameter spacing should be ""
495+
496+ /**
497+ * @param {{'some-method'(a: string, b: number): void}} cfg
498+ */
499+ // "jsdoc/type-formatting": ["error"|"warn", {"methodQuotes":"double"}]
500+ // Message: Method quoting style should be "double"
501+
502+ /**
503+ * @param {[a: string, ...b: number]} cfg
504+ */
505+ // "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostVariadicSpacing":" "}]
506+ // Message: Post variadic (`...`) spacing should be " "
381507````
382508
383509
@@ -463,6 +589,11 @@ The following patterns are not considered problems:
463589 */
464590// "jsdoc/type-formatting": ["error"|"warn", {"genericAndTupleElementSpacing":""}]
465591
592+ /**
593+ * @param {SomeType<T, U>} cfg
594+ */
595+ // "jsdoc/type-formatting": ["error"|"warn", {"genericAndTupleElementSpacing":" "}]
596+
466597/**
467598 * @param {[string,number]} cfg
468599 */
@@ -502,5 +633,60 @@ The following patterns are not considered problems:
502633 * @param {[a? : 3]} cfg
503634 */
504635// "jsdoc/type-formatting": ["error"|"warn", {"keyValuePostOptionalSpacing":" "}]
636+
637+ /**
638+ * @param {() =>void} cfg
639+ */
640+ // "jsdoc/type-formatting": ["error"|"warn", {"arrowFunctionPostReturnMarkerSpacing":""}]
641+
642+ /**
643+ * @param {()=> void} cfg
644+ */
645+ // "jsdoc/type-formatting": ["error"|"warn", {"arrowFunctionPreReturnMarkerSpacing":""}]
646+
647+ /**
648+ * @param {{hello (): void}} cfg
649+ */
650+ // "jsdoc/type-formatting": ["error"|"warn", {"postMethodNameSpacing":" "}]
651+
652+ /**
653+ * @param {{new(): void}} cfg
654+ */
655+ // "jsdoc/type-formatting": ["error"|"warn", {"postNewSpacing":""}]
656+
657+ /**
658+ * @param {{new (): void}} cfg
659+ */
660+ // "jsdoc/type-formatting": ["error"|"warn", {"postNewSpacing":" "}]
661+
662+ /**
663+ * @param {function() : void} cfg
664+ */
665+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassPreReturnMarkerSpacing":" "}]
666+
667+ /**
668+ * @param {{new ():void}} cfg
669+ */
670+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassPostReturnMarkerSpacing":""}]
671+
672+ /**
673+ * @param {{method(a: string,b: number): void}} cfg
674+ */
675+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassParameterSpacing":""}]
676+
677+ /**
678+ * @param {{method<T> (a: T, b: number): void}} cfg
679+ */
680+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassPostGenericSpacing":" "}]
681+
682+ /**
683+ * @param {{method<T,U>(a: T, b: U): void}} cfg
684+ */
685+ // "jsdoc/type-formatting": ["error"|"warn", {"functionOrClassTypeParameterSpacing":""}]
686+
687+ /**
688+ * @param {{"some-method"(a: string, b: number): void}} cfg
689+ */
690+ // "jsdoc/type-formatting": ["error"|"warn", {"methodQuotes":"double"}]
505691````
506692
0 commit comments