@@ -22,6 +22,18 @@ 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+
2537<a name =" user-content-type-formatting-options-enablefixer " ></a >
2638<a name =" type-formatting-options-enablefixer " ></a >
2739### <code >enableFixer</code >
@@ -114,7 +126,7 @@ Determines the spacing to add to unions (`|`). Defaults to a single space (`" "`
114126| Tags| ` param ` , ` property ` , ` returns ` , ` this ` , ` throws ` , ` type ` , ` typedef ` , ` yields ` |
115127| Recommended| false|
116128| Settings| ` mode ` |
117- | Options| ` arrayBrackets ` , ` enableFixer ` , ` genericDot ` , ` objectFieldIndent ` , ` objectFieldQuote ` , ` objectFieldSeparator ` , ` objectFieldSeparatorOptionalLinebreak ` , ` objectFieldSeparatorTrailingPunctuation ` , ` separatorForSingleObjectField ` , ` stringQuotes ` , ` typeBracketSpacing ` , ` unionSpacing ` |
129+ | Options| ` arrayBrackets ` , ` defaultValueSpacing ` , ` elementSpacing ` , ` enableFixer ` , ` genericDot ` , ` objectFieldIndent ` , ` objectFieldQuote ` , ` objectFieldSeparator ` , ` objectFieldSeparatorOptionalLinebreak ` , ` objectFieldSeparatorTrailingPunctuation ` , ` separatorForSingleObjectField ` , ` stringQuotes ` , ` typeBracketSpacing ` , ` unionSpacing ` |
118130
119131<a name =" user-content-type-formatting-failing-examples " ></a >
120132<a name =" type-formatting-failing-examples " ></a >
@@ -288,6 +300,24 @@ The following patterns are considered problems:
288300 */
289301// "jsdoc/type-formatting": ["error"|"warn", {"objectFieldIndent":" ","objectFieldSeparator":"semicolon-and-linebreak","objectFieldSeparatorOptionalLinebreak":true}]
290302// Message: Inconsistent semicolon-and-linebreak separator usage
303+
304+ /**
305+ * @param {SomeType<T, U>} cfg
306+ */
307+ // "jsdoc/type-formatting": ["error"|"warn", {"elementSpacing":""}]
308+ // Message: Element spacing should be ""
309+
310+ /**
311+ * @param {[string, number]} cfg
312+ */
313+ // "jsdoc/type-formatting": ["error"|"warn", {"elementSpacing":""}]
314+ // Message: Element spacing should be ""
315+
316+ /**
317+ * @param {<T, U extends V = string, W = string>(x: T) => U} cfg
318+ */
319+ // "jsdoc/type-formatting": ["error"|"warn", {"defaultValueSpacing":""}]
320+ // Message: Default value spacing should be ""
291321````
292322
293323
@@ -367,5 +397,20 @@ The following patterns are not considered problems:
367397 * }} cfg
368398 */
369399// "jsdoc/type-formatting": ["error"|"warn", {"objectFieldIndent":" ","objectFieldSeparator":"semicolon-and-linebreak","objectFieldSeparatorOptionalLinebreak":true}]
400+
401+ /**
402+ * @param {SomeType<T,U>} cfg
403+ */
404+ // "jsdoc/type-formatting": ["error"|"warn", {"elementSpacing":""}]
405+
406+ /**
407+ * @param {[string,number]} cfg
408+ */
409+ // "jsdoc/type-formatting": ["error"|"warn", {"elementSpacing":""}]
410+
411+ /**
412+ * @param {<T, U extends V=string, W=string>(x: T) => U} cfg
413+ */
414+ // "jsdoc/type-formatting": ["error"|"warn", {"defaultValueSpacing":""}]
370415````
371416
0 commit comments