dprint_config/typescript.rs
1//! Configuration for the dprint TypeScript / JavaScript plugin.
2//!
3//! See: <https://dprint.dev/plugins/typescript/config/>
4
5use alloc::collections::BTreeMap;
6use alloc::string::String;
7use alloc::vec::Vec;
8
9use schemars::JsonSchema;
10use serde::{Deserialize, Serialize};
11use serde_json::Value;
12
13/// See: <https://dprint.dev/plugins/typescript/config/>
14#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
15pub enum BracePosition {
16 /// Maintains the brace being on the next line or the same line.
17 #[serde(rename = "maintain")]
18 Maintain,
19 /// Forces the brace to be on the same line.
20 #[serde(rename = "sameLine")]
21 SameLine,
22 /// Forces the brace to be on the next line.
23 #[serde(rename = "nextLine")]
24 NextLine,
25 /// Forces the brace to be on the next line if the same line is hanging, but otherwise uses the same line.
26 #[serde(rename = "sameLineUnlessHanging")]
27 SameLineUnlessHanging,
28}
29
30/// See: <https://dprint.dev/plugins/typescript/config/>
31#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
32pub enum ForceMultiLine {
33 #[serde(rename = "always")]
34 Always,
35 #[serde(rename = "never")]
36 Never,
37 /// Force multiple lines only if importing more than one thing.
38 #[serde(rename = "whenMultiple")]
39 WhenMultiple,
40}
41
42/// See: <https://dprint.dev/plugins/typescript/config/>
43#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
44pub enum MemberSpacing {
45 /// Forces a new line between members.
46 #[serde(rename = "newLine")]
47 NewLine,
48 /// Forces a blank line between members.
49 #[serde(rename = "blankLine")]
50 BlankLine,
51 /// Maintains whether a newline or blankline is used.
52 #[serde(rename = "maintain")]
53 Maintain,
54}
55
56/// See: <https://dprint.dev/plugins/typescript/config/>
57#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
58pub enum MultiLineParens {
59 /// Never wrap JSX with parentheses.
60 #[serde(rename = "never")]
61 Never,
62 /// Prefer wrapping with parentheses in most scenarios, except in function arguments and JSX attributes.
63 #[serde(rename = "prefer")]
64 Prefer,
65 /// Always wrap JSX with parentheses if it spans multiple lines.
66 #[serde(rename = "always")]
67 Always,
68}
69
70/// See: <https://dprint.dev/plugins/typescript/config/>
71#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
72pub enum NewLineKind {
73 /// For each file, uses the last newline kind found in the file.
74 #[serde(rename = "auto")]
75 Auto,
76 /// Uses carriage return, line feed.
77 #[serde(rename = "crlf")]
78 Crlf,
79 /// Uses line feed.
80 #[serde(rename = "lf")]
81 Lf,
82 /// Uses the system standard (ex. crlf on Windows).
83 #[serde(rename = "system")]
84 System,
85}
86
87/// See: <https://dprint.dev/plugins/typescript/config/>
88#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
89pub enum OperatorPosition {
90 /// Maintains the position of the expression.
91 #[serde(rename = "maintain")]
92 Maintain,
93 /// Forces the whole statement to be on one line.
94 #[serde(rename = "sameLine")]
95 SameLine,
96 /// Forces the expression to be on the next line.
97 #[serde(rename = "nextLine")]
98 NextLine,
99}
100
101/// See: <https://dprint.dev/plugins/typescript/config/>
102#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
103pub enum PreferHanging {
104 /// Always prefers hanging regardless of the number of elements.
105 #[serde(rename = "always")]
106 Always,
107 /// Only prefers hanging if there is a single item.
108 #[serde(rename = "onlySingleItem")]
109 OnlySingleItem,
110 /// Never prefers hanging.
111 #[serde(rename = "never")]
112 Never,
113}
114
115/// See: <https://dprint.dev/plugins/typescript/config/>
116#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
117pub enum QuoteProps {
118 /// Remove unnecessary quotes around property names.
119 #[serde(rename = "asNeeded")]
120 AsNeeded,
121 /// Same as 'asNeeded', but if one property requires quotes then quote them all.
122 #[serde(rename = "consistent")]
123 Consistent,
124 /// Preserve quotes around property names.
125 #[serde(rename = "preserve")]
126 Preserve,
127}
128
129/// See: <https://dprint.dev/plugins/typescript/config/>
130#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
131pub enum QuoteStyle {
132 /// Always uses double quotes.
133 #[serde(rename = "alwaysDouble")]
134 AlwaysDouble,
135 /// Always uses single quotes.
136 #[serde(rename = "alwaysSingle")]
137 AlwaysSingle,
138 /// Prefers using double quotes except in scenarios where the string contains more double quotes than single quotes.
139 #[serde(rename = "preferDouble")]
140 PreferDouble,
141 /// Prefers using single quotes except in scenarios where the string contains more single quotes than double quotes.
142 #[serde(rename = "preferSingle")]
143 PreferSingle,
144}
145
146/// See: <https://dprint.dev/plugins/typescript/config/>
147#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
148pub enum QuoteStyleKind {
149 /// Prefers using double quotes except in scenarios where the string contains more double quotes than single quotes.
150 #[serde(rename = "preferDouble")]
151 PreferDouble,
152 /// Prefers using single quotes except in scenarios where the string contains more single quotes than double quotes.
153 #[serde(rename = "preferSingle")]
154 PreferSingle,
155}
156
157/// See: <https://dprint.dev/plugins/typescript/config/>
158#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
159pub enum SemiColons {
160 /// Always uses semi-colons where applicable.
161 #[serde(rename = "always")]
162 Always,
163 /// Prefers semi-colons, but doesn't add one in certain scenarios such as for the last member of a single-line type literal.
164 #[serde(rename = "prefer")]
165 Prefer,
166 /// Uses automatic semi-colon insertion. Only adds a semi-colon at the start of some expression statements when necessary. Read more: <https://standardjs.com/rules.html#semicolons>
167 #[serde(rename = "asi")]
168 Asi,
169}
170
171/// See: <https://dprint.dev/plugins/typescript/config/>
172#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
173pub enum SeparatorKind {
174 /// Use semi-colons.
175 #[serde(rename = "semiColon")]
176 SemiColon,
177 /// Use commas.
178 #[serde(rename = "comma")]
179 Comma,
180}
181
182/// See: <https://dprint.dev/plugins/typescript/config/>
183#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
184pub enum SortImportDeclarations {
185 /// Maintains the current ordering.
186 #[serde(rename = "maintain")]
187 Maintain,
188 /// Alphabetically and case sensitive.
189 #[serde(rename = "caseSensitive")]
190 CaseSensitive,
191 /// Alphabetically and case insensitive.
192 #[serde(rename = "caseInsensitive")]
193 CaseInsensitive,
194}
195
196/// See: <https://dprint.dev/plugins/typescript/config/>
197#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
198pub enum SortTypeOnlyExports {
199 /// Puts type-only named imports and exports first.
200 #[serde(rename = "first")]
201 First,
202 /// Puts type-only named imports and exports last.
203 #[serde(rename = "last")]
204 Last,
205 /// Does not sort based on if a type-only named import or export.
206 #[serde(rename = "none")]
207 None,
208}
209
210/// See: <https://dprint.dev/plugins/typescript/config/>
211#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
212pub enum TrailingCommas {
213 /// Trailing commas should not be used.
214 #[serde(rename = "never")]
215 Never,
216 /// Trailing commas should always be used.
217 #[serde(rename = "always")]
218 Always,
219 /// Trailing commas should only be used in multi-line scenarios.
220 #[serde(rename = "onlyMultiLine")]
221 OnlyMultiLine,
222}
223
224/// See: <https://dprint.dev/plugins/typescript/config/>
225#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
226pub enum UseBraces {
227 /// Uses braces if they're used. Doesn't use braces if they're not used.
228 #[serde(rename = "maintain")]
229 Maintain,
230 /// Uses braces when the body is on a different line.
231 #[serde(rename = "whenNotSingleLine")]
232 WhenNotSingleLine,
233 /// Forces the use of braces. Will add them if they aren't used.
234 #[serde(rename = "always")]
235 Always,
236 /// Forces no braces when the header is one line and body is one line. Otherwise forces braces.
237 #[serde(rename = "preferNone")]
238 PreferNone,
239}
240
241/// See: <https://dprint.dev/plugins/typescript/config/>
242#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
243pub enum UseParentheses {
244 /// Forces parentheses.
245 #[serde(rename = "force")]
246 Force,
247 /// Maintains the current state of the parentheses.
248 #[serde(rename = "maintain")]
249 Maintain,
250 /// Prefers not using parentheses when possible.
251 #[serde(rename = "preferNone")]
252 PreferNone,
253}
254
255/// Configuration for the dprint [TypeScript / JavaScript](https://dprint.dev/plugins/typescript/config/) plugin.
256///
257/// See: <https://dprint.dev/plugins/typescript/config/>
258#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
259#[schemars(title = "TypeScript / JavaScript Plugin Configuration")]
260pub struct TypeScriptConfig {
261 /// Whether the configuration is not allowed to be overridden or extended.
262 #[serde(default, skip_serializing_if = "Option::is_none")]
263 pub locked: Option<bool>,
264
265 /// File patterns to associate with this plugin.
266 #[serde(default, skip_serializing_if = "Option::is_none")]
267 pub associations: Option<Vec<String>>,
268
269 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
270 ///
271 /// Default: `"never"`
272 ///
273 /// See: <https://dprint.dev/plugins/typescript/config/#argumentspreferHanging>
274 #[serde(
275 default,
276 rename = "arguments.preferHanging",
277 skip_serializing_if = "Option::is_none"
278 )]
279 pub arguments_prefer_hanging: Option<PreferHanging>,
280
281 /// If code should revert back from being on multiple lines to being on a single line when able.
282 ///
283 /// Default: `false`
284 ///
285 /// See: <https://dprint.dev/plugins/typescript/config/#argumentspreferSingleLine>
286 #[serde(
287 default,
288 rename = "arguments.preferSingleLine",
289 skip_serializing_if = "Option::is_none"
290 )]
291 pub arguments_prefer_single_line: Option<bool>,
292
293 /// Whether to place spaces around enclosed expressions.
294 ///
295 /// Default: `false`
296 ///
297 /// See: <https://dprint.dev/plugins/typescript/config/#argumentsspaceAround>
298 #[serde(
299 default,
300 rename = "arguments.spaceAround",
301 skip_serializing_if = "Option::is_none"
302 )]
303 pub arguments_space_around: Option<bool>,
304
305 /// If trailing commas should be used.
306 ///
307 /// Default: `"onlyMultiLine"`
308 ///
309 /// See: <https://dprint.dev/plugins/typescript/config/#argumentstrailingCommas>
310 #[serde(
311 default,
312 rename = "arguments.trailingCommas",
313 skip_serializing_if = "Option::is_none"
314 )]
315 pub arguments_trailing_commas: Option<TrailingCommas>,
316
317 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
318 ///
319 /// Default: `"never"`
320 ///
321 /// See: <https://dprint.dev/plugins/typescript/config/#arrayExpressionpreferHanging>
322 #[serde(
323 default,
324 rename = "arrayExpression.preferHanging",
325 skip_serializing_if = "Option::is_none"
326 )]
327 pub array_expression_prefer_hanging: Option<PreferHanging>,
328
329 /// If code should revert back from being on multiple lines to being on a single line when able.
330 ///
331 /// Default: `false`
332 ///
333 /// See: <https://dprint.dev/plugins/typescript/config/#arrayExpressionpreferSingleLine>
334 #[serde(
335 default,
336 rename = "arrayExpression.preferSingleLine",
337 skip_serializing_if = "Option::is_none"
338 )]
339 pub array_expression_prefer_single_line: Option<bool>,
340
341 /// Whether to place spaces around enclosed expressions.
342 ///
343 /// Default: `false`
344 ///
345 /// See: <https://dprint.dev/plugins/typescript/config/#arrayExpressionspaceAround>
346 #[serde(
347 default,
348 rename = "arrayExpression.spaceAround",
349 skip_serializing_if = "Option::is_none"
350 )]
351 pub array_expression_space_around: Option<bool>,
352
353 /// If trailing commas should be used.
354 ///
355 /// Default: `"onlyMultiLine"`
356 ///
357 /// See: <https://dprint.dev/plugins/typescript/config/#arrayExpressiontrailingCommas>
358 #[serde(
359 default,
360 rename = "arrayExpression.trailingCommas",
361 skip_serializing_if = "Option::is_none"
362 )]
363 pub array_expression_trailing_commas: Option<TrailingCommas>,
364
365 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
366 ///
367 /// Default: `false`
368 ///
369 /// See: <https://dprint.dev/plugins/typescript/config/#arrayPatternpreferHanging>
370 #[serde(
371 default,
372 rename = "arrayPattern.preferHanging",
373 skip_serializing_if = "Option::is_none"
374 )]
375 pub array_pattern_prefer_hanging: Option<bool>,
376
377 /// If code should revert back from being on multiple lines to being on a single line when able.
378 ///
379 /// Default: `false`
380 ///
381 /// See: <https://dprint.dev/plugins/typescript/config/#arrayPatternpreferSingleLine>
382 #[serde(
383 default,
384 rename = "arrayPattern.preferSingleLine",
385 skip_serializing_if = "Option::is_none"
386 )]
387 pub array_pattern_prefer_single_line: Option<bool>,
388
389 /// Whether to place spaces around enclosed expressions.
390 ///
391 /// Default: `false`
392 ///
393 /// See: <https://dprint.dev/plugins/typescript/config/#arrayPatternspaceAround>
394 #[serde(
395 default,
396 rename = "arrayPattern.spaceAround",
397 skip_serializing_if = "Option::is_none"
398 )]
399 pub array_pattern_space_around: Option<bool>,
400
401 /// If trailing commas should be used.
402 ///
403 /// Default: `"onlyMultiLine"`
404 ///
405 /// See: <https://dprint.dev/plugins/typescript/config/#arrayPatterntrailingCommas>
406 #[serde(
407 default,
408 rename = "arrayPattern.trailingCommas",
409 skip_serializing_if = "Option::is_none"
410 )]
411 pub array_pattern_trailing_commas: Option<TrailingCommas>,
412
413 /// Where to place the opening brace.
414 ///
415 /// Default: `"sameLineUnlessHanging"`
416 ///
417 /// See: <https://dprint.dev/plugins/typescript/config/#arrowFunctionbracePosition>
418 #[serde(
419 default,
420 rename = "arrowFunction.bracePosition",
421 skip_serializing_if = "Option::is_none"
422 )]
423 pub arrow_function_brace_position: Option<BracePosition>,
424
425 /// Whether to use parentheses around a single parameter in an arrow function.
426 ///
427 /// Default: `"maintain"`
428 ///
429 /// See: <https://dprint.dev/plugins/typescript/config/#arrowFunctionuseParentheses>
430 #[serde(
431 default,
432 rename = "arrowFunction.useParentheses",
433 skip_serializing_if = "Option::is_none"
434 )]
435 pub arrow_function_use_parentheses: Option<UseParentheses>,
436
437 /// Whether to force a line per expression when spanning multiple lines.
438 ///
439 /// Default: `false`
440 ///
441 /// See: <https://dprint.dev/plugins/typescript/config/#binaryExpressionlinePerExpression>
442 #[serde(
443 default,
444 rename = "binaryExpression.linePerExpression",
445 skip_serializing_if = "Option::is_none"
446 )]
447 pub binary_expression_line_per_expression: Option<bool>,
448
449 /// Where to place the operator for expressions that span multiple lines.
450 ///
451 /// Default: `"nextLine"`
452 ///
453 /// See: <https://dprint.dev/plugins/typescript/config/#binaryExpressionoperatorPosition>
454 #[serde(
455 default,
456 rename = "binaryExpression.operatorPosition",
457 skip_serializing_if = "Option::is_none"
458 )]
459 pub binary_expression_operator_position: Option<OperatorPosition>,
460
461 /// If code should revert back from being on multiple lines to being on a single line when able.
462 ///
463 /// Default: `false`
464 ///
465 /// See: <https://dprint.dev/plugins/typescript/config/#binaryExpressionpreferSingleLine>
466 #[serde(
467 default,
468 rename = "binaryExpression.preferSingleLine",
469 skip_serializing_if = "Option::is_none"
470 )]
471 pub binary_expression_prefer_single_line: Option<bool>,
472
473 /// Whether to surround the operator in a binary expression with spaces.
474 ///
475 /// Default: `true`
476 ///
477 /// See: <https://dprint.dev/plugins/typescript/config/#binaryExpressionspaceSurroundingBitwiseAndArithmeticOperator>
478 #[serde(
479 default,
480 rename = "binaryExpression.spaceSurroundingBitwiseAndArithmeticOperator",
481 skip_serializing_if = "Option::is_none"
482 )]
483 pub binary_expression_space_surrounding_bitwise_and_arithmetic_operator: Option<bool>,
484
485 /// Where to place the opening brace.
486 ///
487 /// Default: `"sameLineUnlessHanging"`
488 ///
489 /// See: <https://dprint.dev/plugins/typescript/config/#bracePosition>
490 #[serde(
491 default,
492 rename = "bracePosition",
493 skip_serializing_if = "Option::is_none"
494 )]
495 pub brace_position: Option<BracePosition>,
496
497 /// Whether to place spaces around enclosed expressions.
498 ///
499 /// Default: `false`
500 ///
501 /// See: <https://dprint.dev/plugins/typescript/config/#catchClausespaceAround>
502 #[serde(
503 default,
504 rename = "catchClause.spaceAround",
505 skip_serializing_if = "Option::is_none"
506 )]
507 pub catch_clause_space_around: Option<bool>,
508
509 /// Where to place the opening brace.
510 ///
511 /// Default: `"sameLineUnlessHanging"`
512 ///
513 /// See: <https://dprint.dev/plugins/typescript/config/#classDeclarationbracePosition>
514 #[serde(
515 default,
516 rename = "classDeclaration.bracePosition",
517 skip_serializing_if = "Option::is_none"
518 )]
519 pub class_declaration_brace_position: Option<BracePosition>,
520
521 /// Where to place the opening brace.
522 ///
523 /// Default: `"sameLineUnlessHanging"`
524 ///
525 /// See: <https://dprint.dev/plugins/typescript/config/#classExpressionbracePosition>
526 #[serde(
527 default,
528 rename = "classExpression.bracePosition",
529 skip_serializing_if = "Option::is_none"
530 )]
531 pub class_expression_brace_position: Option<BracePosition>,
532
533 /// Forces a space after the double slash in a comment line.
534 ///
535 /// Default: `true`
536 ///
537 /// See: <https://dprint.dev/plugins/typescript/config/#commentLineforceSpaceAfterSlashes>
538 #[serde(
539 default,
540 rename = "commentLine.forceSpaceAfterSlashes",
541 skip_serializing_if = "Option::is_none"
542 )]
543 pub comment_line_force_space_after_slashes: Option<bool>,
544
545 /// If code should revert back from being on multiple lines to being on a single line when able.
546 ///
547 /// Default: `false`
548 ///
549 /// See: <https://dprint.dev/plugins/typescript/config/#computedpreferSingleLine>
550 #[serde(
551 default,
552 rename = "computed.preferSingleLine",
553 skip_serializing_if = "Option::is_none"
554 )]
555 pub computed_prefer_single_line: Option<bool>,
556
557 /// Where to place the operator for expressions that span multiple lines.
558 ///
559 /// Default: `"nextLine"`
560 ///
561 /// See: <https://dprint.dev/plugins/typescript/config/#conditionalExpressionoperatorPosition>
562 #[serde(
563 default,
564 rename = "conditionalExpression.operatorPosition",
565 skip_serializing_if = "Option::is_none"
566 )]
567 pub conditional_expression_operator_position: Option<OperatorPosition>,
568
569 /// If code should revert back from being on multiple lines to being on a single line when able.
570 ///
571 /// Default: `false`
572 ///
573 /// See: <https://dprint.dev/plugins/typescript/config/#conditionalExpressionpreferSingleLine>
574 #[serde(
575 default,
576 rename = "conditionalExpression.preferSingleLine",
577 skip_serializing_if = "Option::is_none"
578 )]
579 pub conditional_expression_prefer_single_line: Option<bool>,
580
581 /// Where to place the operator for expressions that span multiple lines.
582 ///
583 /// Default: `"nextLine"`
584 ///
585 /// See: <https://dprint.dev/plugins/typescript/config/#conditionalTypeoperatorPosition>
586 #[serde(
587 default,
588 rename = "conditionalType.operatorPosition",
589 skip_serializing_if = "Option::is_none"
590 )]
591 pub conditional_type_operator_position: Option<OperatorPosition>,
592
593 /// If code should revert back from being on multiple lines to being on a single line when able.
594 ///
595 /// Default: `false`
596 ///
597 /// See: <https://dprint.dev/plugins/typescript/config/#conditionalTypepreferSingleLine>
598 #[serde(
599 default,
600 rename = "conditionalType.preferSingleLine",
601 skip_serializing_if = "Option::is_none"
602 )]
603 pub conditional_type_prefer_single_line: Option<bool>,
604
605 /// Whether to add a space after the `new` keyword in a construct signature.
606 ///
607 /// Default: `false`
608 ///
609 /// See: <https://dprint.dev/plugins/typescript/config/#constructSignaturespaceAfterNewKeyword>
610 #[serde(
611 default,
612 rename = "constructSignature.spaceAfterNewKeyword",
613 skip_serializing_if = "Option::is_none"
614 )]
615 pub construct_signature_space_after_new_keyword: Option<bool>,
616
617 /// Where to place the opening brace.
618 ///
619 /// Default: `"sameLineUnlessHanging"`
620 ///
621 /// See: <https://dprint.dev/plugins/typescript/config/#constructorbracePosition>
622 #[serde(
623 default,
624 rename = "constructor.bracePosition",
625 skip_serializing_if = "Option::is_none"
626 )]
627 pub constructor_brace_position: Option<BracePosition>,
628
629 /// Whether to add a space before the parentheses of a constructor.
630 ///
631 /// Default: `false`
632 ///
633 /// See: <https://dprint.dev/plugins/typescript/config/#constructorspaceBeforeParentheses>
634 #[serde(
635 default,
636 rename = "constructor.spaceBeforeParentheses",
637 skip_serializing_if = "Option::is_none"
638 )]
639 pub constructor_space_before_parentheses: Option<bool>,
640
641 /// Whether to add a space after the `new` keyword in a constructor type.
642 ///
643 /// Default: `false`
644 ///
645 /// See: <https://dprint.dev/plugins/typescript/config/#constructorTypespaceAfterNewKeyword>
646 #[serde(
647 default,
648 rename = "constructorType.spaceAfterNewKeyword",
649 skip_serializing_if = "Option::is_none"
650 )]
651 pub constructor_type_space_after_new_keyword: Option<bool>,
652
653 /// If code should revert back from being on multiple lines to being on a single line when able.
654 ///
655 /// Default: `false`
656 ///
657 /// See: <https://dprint.dev/plugins/typescript/config/#decoratorspreferSingleLine>
658 #[serde(
659 default,
660 rename = "decorators.preferSingleLine",
661 skip_serializing_if = "Option::is_none"
662 )]
663 pub decorators_prefer_single_line: Option<bool>,
664
665 /// Top level configuration that sets the configuration to what is used in Deno.
666 ///
667 /// Default: `false`
668 ///
669 /// See: <https://dprint.dev/plugins/typescript/config/#deno>
670 #[serde(default, skip_serializing_if = "Option::is_none")]
671 pub deno: Option<bool>,
672
673 /// Where to place the opening brace.
674 ///
675 /// Default: `"sameLineUnlessHanging"`
676 ///
677 /// See: <https://dprint.dev/plugins/typescript/config/#doWhileStatementbracePosition>
678 #[serde(
679 default,
680 rename = "doWhileStatement.bracePosition",
681 skip_serializing_if = "Option::is_none"
682 )]
683 pub do_while_statement_brace_position: Option<BracePosition>,
684
685 /// Where to place the next control flow within a control flow statement.
686 ///
687 /// Default: `"sameLine"`
688 ///
689 /// See: <https://dprint.dev/plugins/typescript/config/#doWhileStatementnextControlFlowPosition>
690 #[serde(
691 default,
692 rename = "doWhileStatement.nextControlFlowPosition",
693 skip_serializing_if = "Option::is_none"
694 )]
695 pub do_while_statement_next_control_flow_position: Option<OperatorPosition>,
696
697 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
698 ///
699 /// Default: `false`
700 ///
701 /// See: <https://dprint.dev/plugins/typescript/config/#doWhileStatementpreferHanging>
702 #[serde(
703 default,
704 rename = "doWhileStatement.preferHanging",
705 skip_serializing_if = "Option::is_none"
706 )]
707 pub do_while_statement_prefer_hanging: Option<bool>,
708
709 /// Whether to add a space after the `while` keyword in a do while statement.
710 ///
711 /// Default: `true`
712 ///
713 /// See: <https://dprint.dev/plugins/typescript/config/#doWhileStatementspaceAfterWhileKeyword>
714 #[serde(
715 default,
716 rename = "doWhileStatement.spaceAfterWhileKeyword",
717 skip_serializing_if = "Option::is_none"
718 )]
719 pub do_while_statement_space_after_while_keyword: Option<bool>,
720
721 /// Whether to place spaces around enclosed expressions.
722 ///
723 /// Default: `false`
724 ///
725 /// See: <https://dprint.dev/plugins/typescript/config/#doWhileStatementspaceAround>
726 #[serde(
727 default,
728 rename = "doWhileStatement.spaceAround",
729 skip_serializing_if = "Option::is_none"
730 )]
731 pub do_while_statement_space_around: Option<bool>,
732
733 /// Where to place the opening brace.
734 ///
735 /// Default: `"sameLineUnlessHanging"`
736 ///
737 /// See: <https://dprint.dev/plugins/typescript/config/#enumDeclarationbracePosition>
738 #[serde(
739 default,
740 rename = "enumDeclaration.bracePosition",
741 skip_serializing_if = "Option::is_none"
742 )]
743 pub enum_declaration_brace_position: Option<BracePosition>,
744
745 /// How to space the members of an enum.
746 ///
747 /// Default: `"maintain"`
748 ///
749 /// See: <https://dprint.dev/plugins/typescript/config/#enumDeclarationmemberSpacing>
750 #[serde(
751 default,
752 rename = "enumDeclaration.memberSpacing",
753 skip_serializing_if = "Option::is_none"
754 )]
755 pub enum_declaration_member_spacing: Option<MemberSpacing>,
756
757 /// If trailing commas should be used.
758 ///
759 /// Default: `"onlyMultiLine"`
760 ///
761 /// See: <https://dprint.dev/plugins/typescript/config/#enumDeclarationtrailingCommas>
762 #[serde(
763 default,
764 rename = "enumDeclaration.trailingCommas",
765 skip_serializing_if = "Option::is_none"
766 )]
767 pub enum_declaration_trailing_commas: Option<TrailingCommas>,
768
769 /// If code import/export specifiers should be forced to be on multiple lines.
770 ///
771 /// Default: `"never"`
772 ///
773 /// See: <https://dprint.dev/plugins/typescript/config/#exportDeclarationforceMultiLine>
774 #[serde(
775 default,
776 rename = "exportDeclaration.forceMultiLine",
777 skip_serializing_if = "Option::is_none"
778 )]
779 pub export_declaration_force_multi_line: Option<ForceMultiLine>,
780
781 /// If code should be forced to be on a single line if able.
782 ///
783 /// Default: `false`
784 ///
785 /// See: <https://dprint.dev/plugins/typescript/config/#exportDeclarationforceSingleLine>
786 #[serde(
787 default,
788 rename = "exportDeclaration.forceSingleLine",
789 skip_serializing_if = "Option::is_none"
790 )]
791 pub export_declaration_force_single_line: Option<bool>,
792
793 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
794 ///
795 /// Default: `false`
796 ///
797 /// See: <https://dprint.dev/plugins/typescript/config/#exportDeclarationpreferHanging>
798 #[serde(
799 default,
800 rename = "exportDeclaration.preferHanging",
801 skip_serializing_if = "Option::is_none"
802 )]
803 pub export_declaration_prefer_hanging: Option<bool>,
804
805 /// If code should revert back from being on multiple lines to being on a single line when able.
806 ///
807 /// Default: `false`
808 ///
809 /// See: <https://dprint.dev/plugins/typescript/config/#exportDeclarationpreferSingleLine>
810 #[serde(
811 default,
812 rename = "exportDeclaration.preferSingleLine",
813 skip_serializing_if = "Option::is_none"
814 )]
815 pub export_declaration_prefer_single_line: Option<bool>,
816
817 /// The kind of sort ordering to use.
818 ///
819 /// Default: `"caseInsensitive"`
820 ///
821 /// See: <https://dprint.dev/plugins/typescript/config/#exportDeclarationsortNamedExports>
822 #[serde(
823 default,
824 rename = "exportDeclaration.sortNamedExports",
825 skip_serializing_if = "Option::is_none"
826 )]
827 pub export_declaration_sort_named_exports: Option<SortImportDeclarations>,
828
829 /// The kind of sort ordering to use for typed imports and exports.
830 ///
831 /// Default: `"none"`
832 ///
833 /// See: <https://dprint.dev/plugins/typescript/config/#exportDeclarationsortTypeOnlyExports>
834 #[serde(
835 default,
836 rename = "exportDeclaration.sortTypeOnlyExports",
837 skip_serializing_if = "Option::is_none"
838 )]
839 pub export_declaration_sort_type_only_exports: Option<SortTypeOnlyExports>,
840
841 /// Whether to add spaces around named exports in an export declaration.
842 ///
843 /// Default: `true`
844 ///
845 /// See: <https://dprint.dev/plugins/typescript/config/#exportDeclarationspaceSurroundingNamedExports>
846 #[serde(
847 default,
848 rename = "exportDeclaration.spaceSurroundingNamedExports",
849 skip_serializing_if = "Option::is_none"
850 )]
851 pub export_declaration_space_surrounding_named_exports: Option<bool>,
852
853 /// If trailing commas should be used.
854 ///
855 /// Default: `"onlyMultiLine"`
856 ///
857 /// See: <https://dprint.dev/plugins/typescript/config/#exportDeclarationtrailingCommas>
858 #[serde(
859 default,
860 rename = "exportDeclaration.trailingCommas",
861 skip_serializing_if = "Option::is_none"
862 )]
863 pub export_declaration_trailing_commas: Option<TrailingCommas>,
864
865 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
866 ///
867 /// Default: `false`
868 ///
869 /// See: <https://dprint.dev/plugins/typescript/config/#extendsClausepreferHanging>
870 #[serde(
871 default,
872 rename = "extendsClause.preferHanging",
873 skip_serializing_if = "Option::is_none"
874 )]
875 pub extends_clause_prefer_hanging: Option<bool>,
876
877 /// Where to place the opening brace.
878 ///
879 /// Default: `"sameLineUnlessHanging"`
880 ///
881 /// See: <https://dprint.dev/plugins/typescript/config/#forInStatementbracePosition>
882 #[serde(
883 default,
884 rename = "forInStatement.bracePosition",
885 skip_serializing_if = "Option::is_none"
886 )]
887 pub for_in_statement_brace_position: Option<BracePosition>,
888
889 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
890 ///
891 /// Default: `false`
892 ///
893 /// See: <https://dprint.dev/plugins/typescript/config/#forInStatementpreferHanging>
894 #[serde(
895 default,
896 rename = "forInStatement.preferHanging",
897 skip_serializing_if = "Option::is_none"
898 )]
899 pub for_in_statement_prefer_hanging: Option<bool>,
900
901 /// Where to place the expression of a statement that could possibly be on one line (ex. `if (true) console.log(5);`).
902 ///
903 /// Default: `"maintain"`
904 ///
905 /// See: <https://dprint.dev/plugins/typescript/config/#forInStatementsingleBodyPosition>
906 #[serde(
907 default,
908 rename = "forInStatement.singleBodyPosition",
909 skip_serializing_if = "Option::is_none"
910 )]
911 pub for_in_statement_single_body_position: Option<OperatorPosition>,
912
913 /// Whether to add a space after the `for` keyword in a "for in" statement.
914 ///
915 /// Default: `true`
916 ///
917 /// See: <https://dprint.dev/plugins/typescript/config/#forInStatementspaceAfterForKeyword>
918 #[serde(
919 default,
920 rename = "forInStatement.spaceAfterForKeyword",
921 skip_serializing_if = "Option::is_none"
922 )]
923 pub for_in_statement_space_after_for_keyword: Option<bool>,
924
925 /// Whether to place spaces around enclosed expressions.
926 ///
927 /// Default: `false`
928 ///
929 /// See: <https://dprint.dev/plugins/typescript/config/#forInStatementspaceAround>
930 #[serde(
931 default,
932 rename = "forInStatement.spaceAround",
933 skip_serializing_if = "Option::is_none"
934 )]
935 pub for_in_statement_space_around: Option<bool>,
936
937 /// If braces should be used or not.
938 ///
939 /// Default: `"whenNotSingleLine"`
940 ///
941 /// See: <https://dprint.dev/plugins/typescript/config/#forInStatementuseBraces>
942 #[serde(
943 default,
944 rename = "forInStatement.useBraces",
945 skip_serializing_if = "Option::is_none"
946 )]
947 pub for_in_statement_use_braces: Option<UseBraces>,
948
949 /// Where to place the opening brace.
950 ///
951 /// Default: `"sameLineUnlessHanging"`
952 ///
953 /// See: <https://dprint.dev/plugins/typescript/config/#forOfStatementbracePosition>
954 #[serde(
955 default,
956 rename = "forOfStatement.bracePosition",
957 skip_serializing_if = "Option::is_none"
958 )]
959 pub for_of_statement_brace_position: Option<BracePosition>,
960
961 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
962 ///
963 /// Default: `false`
964 ///
965 /// See: <https://dprint.dev/plugins/typescript/config/#forOfStatementpreferHanging>
966 #[serde(
967 default,
968 rename = "forOfStatement.preferHanging",
969 skip_serializing_if = "Option::is_none"
970 )]
971 pub for_of_statement_prefer_hanging: Option<bool>,
972
973 /// Where to place the expression of a statement that could possibly be on one line (ex. `if (true) console.log(5);`).
974 ///
975 /// Default: `"maintain"`
976 ///
977 /// See: <https://dprint.dev/plugins/typescript/config/#forOfStatementsingleBodyPosition>
978 #[serde(
979 default,
980 rename = "forOfStatement.singleBodyPosition",
981 skip_serializing_if = "Option::is_none"
982 )]
983 pub for_of_statement_single_body_position: Option<OperatorPosition>,
984
985 /// Whether to add a space after the `for` keyword in a "for of" statement.
986 ///
987 /// Default: `true`
988 ///
989 /// See: <https://dprint.dev/plugins/typescript/config/#forOfStatementspaceAfterForKeyword>
990 #[serde(
991 default,
992 rename = "forOfStatement.spaceAfterForKeyword",
993 skip_serializing_if = "Option::is_none"
994 )]
995 pub for_of_statement_space_after_for_keyword: Option<bool>,
996
997 /// Whether to place spaces around enclosed expressions.
998 ///
999 /// Default: `false`
1000 ///
1001 /// See: <https://dprint.dev/plugins/typescript/config/#forOfStatementspaceAround>
1002 #[serde(
1003 default,
1004 rename = "forOfStatement.spaceAround",
1005 skip_serializing_if = "Option::is_none"
1006 )]
1007 pub for_of_statement_space_around: Option<bool>,
1008
1009 /// If braces should be used or not.
1010 ///
1011 /// Default: `"whenNotSingleLine"`
1012 ///
1013 /// See: <https://dprint.dev/plugins/typescript/config/#forOfStatementuseBraces>
1014 #[serde(
1015 default,
1016 rename = "forOfStatement.useBraces",
1017 skip_serializing_if = "Option::is_none"
1018 )]
1019 pub for_of_statement_use_braces: Option<UseBraces>,
1020
1021 /// Where to place the opening brace.
1022 ///
1023 /// Default: `"sameLineUnlessHanging"`
1024 ///
1025 /// See: <https://dprint.dev/plugins/typescript/config/#forStatementbracePosition>
1026 #[serde(
1027 default,
1028 rename = "forStatement.bracePosition",
1029 skip_serializing_if = "Option::is_none"
1030 )]
1031 pub for_statement_brace_position: Option<BracePosition>,
1032
1033 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1034 ///
1035 /// Default: `false`
1036 ///
1037 /// See: <https://dprint.dev/plugins/typescript/config/#forStatementpreferHanging>
1038 #[serde(
1039 default,
1040 rename = "forStatement.preferHanging",
1041 skip_serializing_if = "Option::is_none"
1042 )]
1043 pub for_statement_prefer_hanging: Option<bool>,
1044
1045 /// If code should revert back from being on multiple lines to being on a single line when able.
1046 ///
1047 /// Default: `false`
1048 ///
1049 /// See: <https://dprint.dev/plugins/typescript/config/#forStatementpreferSingleLine>
1050 #[serde(
1051 default,
1052 rename = "forStatement.preferSingleLine",
1053 skip_serializing_if = "Option::is_none"
1054 )]
1055 pub for_statement_prefer_single_line: Option<bool>,
1056
1057 /// Where to place the expression of a statement that could possibly be on one line (ex. `if (true) console.log(5);`).
1058 ///
1059 /// Default: `"maintain"`
1060 ///
1061 /// See: <https://dprint.dev/plugins/typescript/config/#forStatementsingleBodyPosition>
1062 #[serde(
1063 default,
1064 rename = "forStatement.singleBodyPosition",
1065 skip_serializing_if = "Option::is_none"
1066 )]
1067 pub for_statement_single_body_position: Option<OperatorPosition>,
1068
1069 /// Whether to add a space after the `for` keyword in a "for" statement.
1070 ///
1071 /// Default: `true`
1072 ///
1073 /// See: <https://dprint.dev/plugins/typescript/config/#forStatementspaceAfterForKeyword>
1074 #[serde(
1075 default,
1076 rename = "forStatement.spaceAfterForKeyword",
1077 skip_serializing_if = "Option::is_none"
1078 )]
1079 pub for_statement_space_after_for_keyword: Option<bool>,
1080
1081 /// Whether to add a space after the semi-colons in a "for" statement.
1082 ///
1083 /// Default: `true`
1084 ///
1085 /// See: <https://dprint.dev/plugins/typescript/config/#forStatementspaceAfterSemiColons>
1086 #[serde(
1087 default,
1088 rename = "forStatement.spaceAfterSemiColons",
1089 skip_serializing_if = "Option::is_none"
1090 )]
1091 pub for_statement_space_after_semi_colons: Option<bool>,
1092
1093 /// Whether to place spaces around enclosed expressions.
1094 ///
1095 /// Default: `false`
1096 ///
1097 /// See: <https://dprint.dev/plugins/typescript/config/#forStatementspaceAround>
1098 #[serde(
1099 default,
1100 rename = "forStatement.spaceAround",
1101 skip_serializing_if = "Option::is_none"
1102 )]
1103 pub for_statement_space_around: Option<bool>,
1104
1105 /// If braces should be used or not.
1106 ///
1107 /// Default: `"whenNotSingleLine"`
1108 ///
1109 /// See: <https://dprint.dev/plugins/typescript/config/#forStatementuseBraces>
1110 #[serde(
1111 default,
1112 rename = "forStatement.useBraces",
1113 skip_serializing_if = "Option::is_none"
1114 )]
1115 pub for_statement_use_braces: Option<UseBraces>,
1116
1117 /// Where to place the opening brace.
1118 ///
1119 /// Default: `"sameLineUnlessHanging"`
1120 ///
1121 /// See: <https://dprint.dev/plugins/typescript/config/#functionDeclarationbracePosition>
1122 #[serde(
1123 default,
1124 rename = "functionDeclaration.bracePosition",
1125 skip_serializing_if = "Option::is_none"
1126 )]
1127 pub function_declaration_brace_position: Option<BracePosition>,
1128
1129 /// Whether to add a space before the parentheses of a function declaration.
1130 ///
1131 /// Default: `false`
1132 ///
1133 /// See: <https://dprint.dev/plugins/typescript/config/#functionDeclarationspaceBeforeParentheses>
1134 #[serde(
1135 default,
1136 rename = "functionDeclaration.spaceBeforeParentheses",
1137 skip_serializing_if = "Option::is_none"
1138 )]
1139 pub function_declaration_space_before_parentheses: Option<bool>,
1140
1141 /// Where to place the opening brace.
1142 ///
1143 /// Default: `"sameLineUnlessHanging"`
1144 ///
1145 /// See: <https://dprint.dev/plugins/typescript/config/#functionExpressionbracePosition>
1146 #[serde(
1147 default,
1148 rename = "functionExpression.bracePosition",
1149 skip_serializing_if = "Option::is_none"
1150 )]
1151 pub function_expression_brace_position: Option<BracePosition>,
1152
1153 /// Whether to add a space after the function keyword of a function expression.
1154 ///
1155 /// Default: `false`
1156 ///
1157 /// See: <https://dprint.dev/plugins/typescript/config/#functionExpressionspaceAfterFunctionKeyword>
1158 #[serde(
1159 default,
1160 rename = "functionExpression.spaceAfterFunctionKeyword",
1161 skip_serializing_if = "Option::is_none"
1162 )]
1163 pub function_expression_space_after_function_keyword: Option<bool>,
1164
1165 /// Whether to add a space before the parentheses of a function expression.
1166 ///
1167 /// Default: `false`
1168 ///
1169 /// See: <https://dprint.dev/plugins/typescript/config/#functionExpressionspaceBeforeParentheses>
1170 #[serde(
1171 default,
1172 rename = "functionExpression.spaceBeforeParentheses",
1173 skip_serializing_if = "Option::is_none"
1174 )]
1175 pub function_expression_space_before_parentheses: Option<bool>,
1176
1177 /// Where to place the opening brace.
1178 ///
1179 /// Default: `"sameLineUnlessHanging"`
1180 ///
1181 /// See: <https://dprint.dev/plugins/typescript/config/#getAccessorbracePosition>
1182 #[serde(
1183 default,
1184 rename = "getAccessor.bracePosition",
1185 skip_serializing_if = "Option::is_none"
1186 )]
1187 pub get_accessor_brace_position: Option<BracePosition>,
1188
1189 /// Whether to add a space before the parentheses of a get accessor.
1190 ///
1191 /// Default: `false`
1192 ///
1193 /// See: <https://dprint.dev/plugins/typescript/config/#getAccessorspaceBeforeParentheses>
1194 #[serde(
1195 default,
1196 rename = "getAccessor.spaceBeforeParentheses",
1197 skip_serializing_if = "Option::is_none"
1198 )]
1199 pub get_accessor_space_before_parentheses: Option<bool>,
1200
1201 /// Where to place the opening brace.
1202 ///
1203 /// Default: `"sameLineUnlessHanging"`
1204 ///
1205 /// See: <https://dprint.dev/plugins/typescript/config/#ifStatementbracePosition>
1206 #[serde(
1207 default,
1208 rename = "ifStatement.bracePosition",
1209 skip_serializing_if = "Option::is_none"
1210 )]
1211 pub if_statement_brace_position: Option<BracePosition>,
1212
1213 /// Where to place the next control flow within a control flow statement.
1214 ///
1215 /// Default: `"sameLine"`
1216 ///
1217 /// See: <https://dprint.dev/plugins/typescript/config/#ifStatementnextControlFlowPosition>
1218 #[serde(
1219 default,
1220 rename = "ifStatement.nextControlFlowPosition",
1221 skip_serializing_if = "Option::is_none"
1222 )]
1223 pub if_statement_next_control_flow_position: Option<OperatorPosition>,
1224
1225 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1226 ///
1227 /// Default: `false`
1228 ///
1229 /// See: <https://dprint.dev/plugins/typescript/config/#ifStatementpreferHanging>
1230 #[serde(
1231 default,
1232 rename = "ifStatement.preferHanging",
1233 skip_serializing_if = "Option::is_none"
1234 )]
1235 pub if_statement_prefer_hanging: Option<bool>,
1236
1237 /// Where to place the expression of a statement that could possibly be on one line (ex. `if (true) console.log(5);`).
1238 ///
1239 /// Default: `"maintain"`
1240 ///
1241 /// See: <https://dprint.dev/plugins/typescript/config/#ifStatementsingleBodyPosition>
1242 #[serde(
1243 default,
1244 rename = "ifStatement.singleBodyPosition",
1245 skip_serializing_if = "Option::is_none"
1246 )]
1247 pub if_statement_single_body_position: Option<OperatorPosition>,
1248
1249 /// Whether to add a space after the `if` keyword in an "if" statement.
1250 ///
1251 /// Default: `true`
1252 ///
1253 /// See: <https://dprint.dev/plugins/typescript/config/#ifStatementspaceAfterIfKeyword>
1254 #[serde(
1255 default,
1256 rename = "ifStatement.spaceAfterIfKeyword",
1257 skip_serializing_if = "Option::is_none"
1258 )]
1259 pub if_statement_space_after_if_keyword: Option<bool>,
1260
1261 /// Whether to place spaces around enclosed expressions.
1262 ///
1263 /// Default: `false`
1264 ///
1265 /// See: <https://dprint.dev/plugins/typescript/config/#ifStatementspaceAround>
1266 #[serde(
1267 default,
1268 rename = "ifStatement.spaceAround",
1269 skip_serializing_if = "Option::is_none"
1270 )]
1271 pub if_statement_space_around: Option<bool>,
1272
1273 /// If braces should be used or not.
1274 ///
1275 /// Default: `"whenNotSingleLine"`
1276 ///
1277 /// See: <https://dprint.dev/plugins/typescript/config/#ifStatementuseBraces>
1278 #[serde(
1279 default,
1280 rename = "ifStatement.useBraces",
1281 skip_serializing_if = "Option::is_none"
1282 )]
1283 pub if_statement_use_braces: Option<UseBraces>,
1284
1285 /// The text to use for a file ignore comment (ex. `// dprint-ignore-file`).
1286 ///
1287 /// Default: `"dprint-ignore-file"`
1288 ///
1289 /// See: <https://dprint.dev/plugins/typescript/config/#ignoreFileCommentText>
1290 #[serde(
1291 default,
1292 rename = "ignoreFileCommentText",
1293 skip_serializing_if = "Option::is_none"
1294 )]
1295 pub ignore_file_comment_text: Option<String>,
1296
1297 /// The text to use for an ignore comment (ex. `// dprint-ignore`).
1298 ///
1299 /// Default: `"dprint-ignore"`
1300 ///
1301 /// See: <https://dprint.dev/plugins/typescript/config/#ignoreNodeCommentText>
1302 #[serde(
1303 default,
1304 rename = "ignoreNodeCommentText",
1305 skip_serializing_if = "Option::is_none"
1306 )]
1307 pub ignore_node_comment_text: Option<String>,
1308
1309 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1310 ///
1311 /// Default: `false`
1312 ///
1313 /// See: <https://dprint.dev/plugins/typescript/config/#implementsClausepreferHanging>
1314 #[serde(
1315 default,
1316 rename = "implementsClause.preferHanging",
1317 skip_serializing_if = "Option::is_none"
1318 )]
1319 pub implements_clause_prefer_hanging: Option<bool>,
1320
1321 /// If code import/export specifiers should be forced to be on multiple lines.
1322 ///
1323 /// Default: `"never"`
1324 ///
1325 /// See: <https://dprint.dev/plugins/typescript/config/#importDeclarationforceMultiLine>
1326 #[serde(
1327 default,
1328 rename = "importDeclaration.forceMultiLine",
1329 skip_serializing_if = "Option::is_none"
1330 )]
1331 pub import_declaration_force_multi_line: Option<ForceMultiLine>,
1332
1333 /// If code should be forced to be on a single line if able.
1334 ///
1335 /// Default: `false`
1336 ///
1337 /// See: <https://dprint.dev/plugins/typescript/config/#importDeclarationforceSingleLine>
1338 #[serde(
1339 default,
1340 rename = "importDeclaration.forceSingleLine",
1341 skip_serializing_if = "Option::is_none"
1342 )]
1343 pub import_declaration_force_single_line: Option<bool>,
1344
1345 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1346 ///
1347 /// Default: `false`
1348 ///
1349 /// See: <https://dprint.dev/plugins/typescript/config/#importDeclarationpreferHanging>
1350 #[serde(
1351 default,
1352 rename = "importDeclaration.preferHanging",
1353 skip_serializing_if = "Option::is_none"
1354 )]
1355 pub import_declaration_prefer_hanging: Option<bool>,
1356
1357 /// If code should revert back from being on multiple lines to being on a single line when able.
1358 ///
1359 /// Default: `false`
1360 ///
1361 /// See: <https://dprint.dev/plugins/typescript/config/#importDeclarationpreferSingleLine>
1362 #[serde(
1363 default,
1364 rename = "importDeclaration.preferSingleLine",
1365 skip_serializing_if = "Option::is_none"
1366 )]
1367 pub import_declaration_prefer_single_line: Option<bool>,
1368
1369 /// The kind of sort ordering to use.
1370 ///
1371 /// Default: `"caseInsensitive"`
1372 ///
1373 /// See: <https://dprint.dev/plugins/typescript/config/#importDeclarationsortNamedImports>
1374 #[serde(
1375 default,
1376 rename = "importDeclaration.sortNamedImports",
1377 skip_serializing_if = "Option::is_none"
1378 )]
1379 pub import_declaration_sort_named_imports: Option<SortImportDeclarations>,
1380
1381 /// The kind of sort ordering to use for typed imports and exports.
1382 ///
1383 /// Default: `"none"`
1384 ///
1385 /// See: <https://dprint.dev/plugins/typescript/config/#importDeclarationsortTypeOnlyImports>
1386 #[serde(
1387 default,
1388 rename = "importDeclaration.sortTypeOnlyImports",
1389 skip_serializing_if = "Option::is_none"
1390 )]
1391 pub import_declaration_sort_type_only_imports: Option<SortTypeOnlyExports>,
1392
1393 /// Whether to add spaces around named imports in an import declaration.
1394 ///
1395 /// Default: `true`
1396 ///
1397 /// See: <https://dprint.dev/plugins/typescript/config/#importDeclarationspaceSurroundingNamedImports>
1398 #[serde(
1399 default,
1400 rename = "importDeclaration.spaceSurroundingNamedImports",
1401 skip_serializing_if = "Option::is_none"
1402 )]
1403 pub import_declaration_space_surrounding_named_imports: Option<bool>,
1404
1405 /// If trailing commas should be used.
1406 ///
1407 /// Default: `"onlyMultiLine"`
1408 ///
1409 /// See: <https://dprint.dev/plugins/typescript/config/#importDeclarationtrailingCommas>
1410 #[serde(
1411 default,
1412 rename = "importDeclaration.trailingCommas",
1413 skip_serializing_if = "Option::is_none"
1414 )]
1415 pub import_declaration_trailing_commas: Option<TrailingCommas>,
1416
1417 /// The number of columns for an indent.
1418 ///
1419 /// Default: `2`
1420 ///
1421 /// See: <https://dprint.dev/plugins/typescript/config/#indentWidth>
1422 #[serde(
1423 default,
1424 rename = "indentWidth",
1425 skip_serializing_if = "Option::is_none"
1426 )]
1427 pub indent_width: Option<u32>,
1428
1429 /// Where to place the opening brace.
1430 ///
1431 /// Default: `"sameLineUnlessHanging"`
1432 ///
1433 /// See: <https://dprint.dev/plugins/typescript/config/#interfaceDeclarationbracePosition>
1434 #[serde(
1435 default,
1436 rename = "interfaceDeclaration.bracePosition",
1437 skip_serializing_if = "Option::is_none"
1438 )]
1439 pub interface_declaration_brace_position: Option<BracePosition>,
1440
1441 /// If the end angle bracket of a jsx open element or self closing element should be on the same or next line when the attributes span multiple lines.
1442 ///
1443 /// Default: `"nextLine"`
1444 ///
1445 /// See: <https://dprint.dev/plugins/typescript/config/#jsxbracketPosition>
1446 #[serde(
1447 default,
1448 rename = "jsx.bracketPosition",
1449 skip_serializing_if = "Option::is_none"
1450 )]
1451 pub jsx_bracket_position: Option<OperatorPosition>,
1452
1453 /// Forces newlines surrounding the content of JSX elements.
1454 ///
1455 /// Default: `false`
1456 ///
1457 /// See: <https://dprint.dev/plugins/typescript/config/#jsxforceNewLinesSurroundingContent>
1458 #[serde(
1459 default,
1460 rename = "jsx.forceNewLinesSurroundingContent",
1461 skip_serializing_if = "Option::is_none"
1462 )]
1463 pub jsx_force_new_lines_surrounding_content: Option<bool>,
1464
1465 /// Surrounds the top-most JSX element or fragment in parentheses when it spans multiple lines.
1466 ///
1467 /// Default: `"prefer"`
1468 ///
1469 /// See: <https://dprint.dev/plugins/typescript/config/#jsxmultiLineParens>
1470 #[serde(
1471 default,
1472 rename = "jsx.multiLineParens",
1473 skip_serializing_if = "Option::is_none"
1474 )]
1475 pub jsx_multi_line_parens: Option<MultiLineParens>,
1476
1477 /// How to use single or double quotes in JSX attributes.
1478 ///
1479 /// Default: `"preferDouble"`
1480 ///
1481 /// See: <https://dprint.dev/plugins/typescript/config/#jsxquoteStyle>
1482 #[serde(
1483 default,
1484 rename = "jsx.quoteStyle",
1485 skip_serializing_if = "Option::is_none"
1486 )]
1487 pub jsx_quote_style: Option<QuoteStyleKind>,
1488
1489 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1490 ///
1491 /// Default: `false`
1492 ///
1493 /// See: <https://dprint.dev/plugins/typescript/config/#jsxAttributespreferHanging>
1494 #[serde(
1495 default,
1496 rename = "jsxAttributes.preferHanging",
1497 skip_serializing_if = "Option::is_none"
1498 )]
1499 pub jsx_attributes_prefer_hanging: Option<bool>,
1500
1501 /// If code should revert back from being on multiple lines to being on a single line when able.
1502 ///
1503 /// Default: `false`
1504 ///
1505 /// See: <https://dprint.dev/plugins/typescript/config/#jsxAttributespreferSingleLine>
1506 #[serde(
1507 default,
1508 rename = "jsxAttributes.preferSingleLine",
1509 skip_serializing_if = "Option::is_none"
1510 )]
1511 pub jsx_attributes_prefer_single_line: Option<bool>,
1512
1513 /// If code should revert back from being on multiple lines to being on a single line when able.
1514 ///
1515 /// Default: `false`
1516 ///
1517 /// See: <https://dprint.dev/plugins/typescript/config/#jsxElementpreferSingleLine>
1518 #[serde(
1519 default,
1520 rename = "jsxElement.preferSingleLine",
1521 skip_serializing_if = "Option::is_none"
1522 )]
1523 pub jsx_element_prefer_single_line: Option<bool>,
1524
1525 /// Whether to add a space surrounding the expression of a JSX container.
1526 ///
1527 /// Default: `false`
1528 ///
1529 /// See: <https://dprint.dev/plugins/typescript/config/#jsxExpressionContainerspaceSurroundingExpression>
1530 #[serde(
1531 default,
1532 rename = "jsxExpressionContainer.spaceSurroundingExpression",
1533 skip_serializing_if = "Option::is_none"
1534 )]
1535 pub jsx_expression_container_space_surrounding_expression: Option<bool>,
1536
1537 /// If the end angle bracket of a jsx open element or self closing element should be on the same or next line when the attributes span multiple lines.
1538 ///
1539 /// Default: `"nextLine"`
1540 ///
1541 /// See: <https://dprint.dev/plugins/typescript/config/#jsxOpeningElementbracketPosition>
1542 #[serde(
1543 default,
1544 rename = "jsxOpeningElement.bracketPosition",
1545 skip_serializing_if = "Option::is_none"
1546 )]
1547 pub jsx_opening_element_bracket_position: Option<OperatorPosition>,
1548
1549 /// If the end angle bracket of a jsx open element or self closing element should be on the same or next line when the attributes span multiple lines.
1550 ///
1551 /// Default: `"nextLine"`
1552 ///
1553 /// See: <https://dprint.dev/plugins/typescript/config/#jsxSelfClosingElementbracketPosition>
1554 #[serde(
1555 default,
1556 rename = "jsxSelfClosingElement.bracketPosition",
1557 skip_serializing_if = "Option::is_none"
1558 )]
1559 pub jsx_self_closing_element_bracket_position: Option<OperatorPosition>,
1560
1561 /// Whether to add a space before a JSX element's slash when self closing.
1562 ///
1563 /// Default: `true`
1564 ///
1565 /// See: <https://dprint.dev/plugins/typescript/config/#jsxSelfClosingElementspaceBeforeSlash>
1566 #[serde(
1567 default,
1568 rename = "jsxSelfClosingElement.spaceBeforeSlash",
1569 skip_serializing_if = "Option::is_none"
1570 )]
1571 pub jsx_self_closing_element_space_before_slash: Option<bool>,
1572
1573 /// The width of a line the printer will try to stay under. Note that the printer may exceed this width in certain cases.
1574 ///
1575 /// Default: `120`
1576 ///
1577 /// See: <https://dprint.dev/plugins/typescript/config/#lineWidth>
1578 #[serde(default, rename = "lineWidth", skip_serializing_if = "Option::is_none")]
1579 pub line_width: Option<u32>,
1580
1581 /// If code should revert back from being on multiple lines to being on a single line when able.
1582 ///
1583 /// Default: `false`
1584 ///
1585 /// See: <https://dprint.dev/plugins/typescript/config/#mappedTypepreferSingleLine>
1586 #[serde(
1587 default,
1588 rename = "mappedType.preferSingleLine",
1589 skip_serializing_if = "Option::is_none"
1590 )]
1591 pub mapped_type_prefer_single_line: Option<bool>,
1592
1593 /// Whether to force a line per expression when spanning multiple lines.
1594 ///
1595 /// Default: `false`
1596 ///
1597 /// See: <https://dprint.dev/plugins/typescript/config/#memberExpressionlinePerExpression>
1598 #[serde(
1599 default,
1600 rename = "memberExpression.linePerExpression",
1601 skip_serializing_if = "Option::is_none"
1602 )]
1603 pub member_expression_line_per_expression: Option<bool>,
1604
1605 /// If code should revert back from being on multiple lines to being on a single line when able.
1606 ///
1607 /// Default: `false`
1608 ///
1609 /// See: <https://dprint.dev/plugins/typescript/config/#memberExpressionpreferSingleLine>
1610 #[serde(
1611 default,
1612 rename = "memberExpression.preferSingleLine",
1613 skip_serializing_if = "Option::is_none"
1614 )]
1615 pub member_expression_prefer_single_line: Option<bool>,
1616
1617 /// Where to place the opening brace.
1618 ///
1619 /// Default: `"sameLineUnlessHanging"`
1620 ///
1621 /// See: <https://dprint.dev/plugins/typescript/config/#methodbracePosition>
1622 #[serde(
1623 default,
1624 rename = "method.bracePosition",
1625 skip_serializing_if = "Option::is_none"
1626 )]
1627 pub method_brace_position: Option<BracePosition>,
1628
1629 /// Whether to add a space before the parentheses of a method.
1630 ///
1631 /// Default: `false`
1632 ///
1633 /// See: <https://dprint.dev/plugins/typescript/config/#methodspaceBeforeParentheses>
1634 #[serde(
1635 default,
1636 rename = "method.spaceBeforeParentheses",
1637 skip_serializing_if = "Option::is_none"
1638 )]
1639 pub method_space_before_parentheses: Option<bool>,
1640
1641 /// The kind of sort ordering to use.
1642 ///
1643 /// Default: `"caseInsensitive"`
1644 ///
1645 /// See: <https://dprint.dev/plugins/typescript/config/#modulesortExportDeclarations>
1646 #[serde(
1647 default,
1648 rename = "module.sortExportDeclarations",
1649 skip_serializing_if = "Option::is_none"
1650 )]
1651 pub module_sort_export_declarations: Option<SortImportDeclarations>,
1652
1653 /// The kind of sort ordering to use.
1654 ///
1655 /// Default: `"caseInsensitive"`
1656 ///
1657 /// See: <https://dprint.dev/plugins/typescript/config/#modulesortImportDeclarations>
1658 #[serde(
1659 default,
1660 rename = "module.sortImportDeclarations",
1661 skip_serializing_if = "Option::is_none"
1662 )]
1663 pub module_sort_import_declarations: Option<SortImportDeclarations>,
1664
1665 /// Where to place the opening brace.
1666 ///
1667 /// Default: `"sameLineUnlessHanging"`
1668 ///
1669 /// See: <https://dprint.dev/plugins/typescript/config/#moduleDeclarationbracePosition>
1670 #[serde(
1671 default,
1672 rename = "moduleDeclaration.bracePosition",
1673 skip_serializing_if = "Option::is_none"
1674 )]
1675 pub module_declaration_brace_position: Option<BracePosition>,
1676
1677 /// The kind of newline to use.
1678 ///
1679 /// Default: `"lf"`
1680 ///
1681 /// See: <https://dprint.dev/plugins/typescript/config/#newLineKind>
1682 #[serde(
1683 default,
1684 rename = "newLineKind",
1685 skip_serializing_if = "Option::is_none"
1686 )]
1687 pub new_line_kind: Option<NewLineKind>,
1688
1689 /// Where to place the next control flow within a control flow statement.
1690 ///
1691 /// Default: `"sameLine"`
1692 ///
1693 /// See: <https://dprint.dev/plugins/typescript/config/#nextControlFlowPosition>
1694 #[serde(
1695 default,
1696 rename = "nextControlFlowPosition",
1697 skip_serializing_if = "Option::is_none"
1698 )]
1699 pub next_control_flow_position: Option<OperatorPosition>,
1700
1701 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1702 ///
1703 /// Default: `false`
1704 ///
1705 /// See: <https://dprint.dev/plugins/typescript/config/#objectExpressionpreferHanging>
1706 #[serde(
1707 default,
1708 rename = "objectExpression.preferHanging",
1709 skip_serializing_if = "Option::is_none"
1710 )]
1711 pub object_expression_prefer_hanging: Option<bool>,
1712
1713 /// If code should revert back from being on multiple lines to being on a single line when able.
1714 ///
1715 /// Default: `false`
1716 ///
1717 /// See: <https://dprint.dev/plugins/typescript/config/#objectExpressionpreferSingleLine>
1718 #[serde(
1719 default,
1720 rename = "objectExpression.preferSingleLine",
1721 skip_serializing_if = "Option::is_none"
1722 )]
1723 pub object_expression_prefer_single_line: Option<bool>,
1724
1725 /// Whether to add a space surrounding the properties of a single line object expression.
1726 ///
1727 /// Default: `true`
1728 ///
1729 /// See: <https://dprint.dev/plugins/typescript/config/#objectExpressionspaceSurroundingProperties>
1730 #[serde(
1731 default,
1732 rename = "objectExpression.spaceSurroundingProperties",
1733 skip_serializing_if = "Option::is_none"
1734 )]
1735 pub object_expression_space_surrounding_properties: Option<bool>,
1736
1737 /// If trailing commas should be used.
1738 ///
1739 /// Default: `"onlyMultiLine"`
1740 ///
1741 /// See: <https://dprint.dev/plugins/typescript/config/#objectExpressiontrailingCommas>
1742 #[serde(
1743 default,
1744 rename = "objectExpression.trailingCommas",
1745 skip_serializing_if = "Option::is_none"
1746 )]
1747 pub object_expression_trailing_commas: Option<TrailingCommas>,
1748
1749 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1750 ///
1751 /// Default: `false`
1752 ///
1753 /// See: <https://dprint.dev/plugins/typescript/config/#objectPatternpreferHanging>
1754 #[serde(
1755 default,
1756 rename = "objectPattern.preferHanging",
1757 skip_serializing_if = "Option::is_none"
1758 )]
1759 pub object_pattern_prefer_hanging: Option<bool>,
1760
1761 /// If code should revert back from being on multiple lines to being on a single line when able.
1762 ///
1763 /// Default: `false`
1764 ///
1765 /// See: <https://dprint.dev/plugins/typescript/config/#objectPatternpreferSingleLine>
1766 #[serde(
1767 default,
1768 rename = "objectPattern.preferSingleLine",
1769 skip_serializing_if = "Option::is_none"
1770 )]
1771 pub object_pattern_prefer_single_line: Option<bool>,
1772
1773 /// Whether to add a space surrounding the properties of a single line object pattern.
1774 ///
1775 /// Default: `true`
1776 ///
1777 /// See: <https://dprint.dev/plugins/typescript/config/#objectPatternspaceSurroundingProperties>
1778 #[serde(
1779 default,
1780 rename = "objectPattern.spaceSurroundingProperties",
1781 skip_serializing_if = "Option::is_none"
1782 )]
1783 pub object_pattern_space_surrounding_properties: Option<bool>,
1784
1785 /// If trailing commas should be used.
1786 ///
1787 /// Default: `"onlyMultiLine"`
1788 ///
1789 /// See: <https://dprint.dev/plugins/typescript/config/#objectPatterntrailingCommas>
1790 #[serde(
1791 default,
1792 rename = "objectPattern.trailingCommas",
1793 skip_serializing_if = "Option::is_none"
1794 )]
1795 pub object_pattern_trailing_commas: Option<TrailingCommas>,
1796
1797 /// Where to place the operator for expressions that span multiple lines.
1798 ///
1799 /// Default: `"nextLine"`
1800 ///
1801 /// See: <https://dprint.dev/plugins/typescript/config/#operatorPosition>
1802 #[serde(
1803 default,
1804 rename = "operatorPosition",
1805 skip_serializing_if = "Option::is_none"
1806 )]
1807 pub operator_position: Option<OperatorPosition>,
1808
1809 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1810 ///
1811 /// Default: `"never"`
1812 ///
1813 /// See: <https://dprint.dev/plugins/typescript/config/#parameterspreferHanging>
1814 #[serde(
1815 default,
1816 rename = "parameters.preferHanging",
1817 skip_serializing_if = "Option::is_none"
1818 )]
1819 pub parameters_prefer_hanging: Option<PreferHanging>,
1820
1821 /// If code should revert back from being on multiple lines to being on a single line when able.
1822 ///
1823 /// Default: `false`
1824 ///
1825 /// See: <https://dprint.dev/plugins/typescript/config/#parameterspreferSingleLine>
1826 #[serde(
1827 default,
1828 rename = "parameters.preferSingleLine",
1829 skip_serializing_if = "Option::is_none"
1830 )]
1831 pub parameters_prefer_single_line: Option<bool>,
1832
1833 /// Whether to place spaces around enclosed expressions.
1834 ///
1835 /// Default: `false`
1836 ///
1837 /// See: <https://dprint.dev/plugins/typescript/config/#parametersspaceAround>
1838 #[serde(
1839 default,
1840 rename = "parameters.spaceAround",
1841 skip_serializing_if = "Option::is_none"
1842 )]
1843 pub parameters_space_around: Option<bool>,
1844
1845 /// If trailing commas should be used.
1846 ///
1847 /// Default: `"onlyMultiLine"`
1848 ///
1849 /// See: <https://dprint.dev/plugins/typescript/config/#parameterstrailingCommas>
1850 #[serde(
1851 default,
1852 rename = "parameters.trailingCommas",
1853 skip_serializing_if = "Option::is_none"
1854 )]
1855 pub parameters_trailing_commas: Option<TrailingCommas>,
1856
1857 /// Whether to place spaces around enclosed expressions.
1858 ///
1859 /// Default: `false`
1860 ///
1861 /// See: <https://dprint.dev/plugins/typescript/config/#parenExpressionspaceAround>
1862 #[serde(
1863 default,
1864 rename = "parenExpression.spaceAround",
1865 skip_serializing_if = "Option::is_none"
1866 )]
1867 pub paren_expression_space_around: Option<bool>,
1868
1869 /// If code should revert back from being on multiple lines to being on a single line when able.
1870 ///
1871 /// Default: `false`
1872 ///
1873 /// See: <https://dprint.dev/plugins/typescript/config/#parenthesespreferSingleLine>
1874 #[serde(
1875 default,
1876 rename = "parentheses.preferSingleLine",
1877 skip_serializing_if = "Option::is_none"
1878 )]
1879 pub parentheses_prefer_single_line: Option<bool>,
1880
1881 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1882 ///
1883 /// Default: `false`
1884 ///
1885 /// See: <https://dprint.dev/plugins/typescript/config/#preferHanging>
1886 #[serde(
1887 default,
1888 rename = "preferHanging",
1889 skip_serializing_if = "Option::is_none"
1890 )]
1891 pub prefer_hanging: Option<bool>,
1892
1893 /// If code should revert back from being on multiple lines to being on a single line when able.
1894 ///
1895 /// Default: `false`
1896 ///
1897 /// See: <https://dprint.dev/plugins/typescript/config/#preferSingleLine>
1898 #[serde(
1899 default,
1900 rename = "preferSingleLine",
1901 skip_serializing_if = "Option::is_none"
1902 )]
1903 pub prefer_single_line: Option<bool>,
1904
1905 /// Change when properties in objects are quoted.
1906 ///
1907 /// Default: `"preserve"`
1908 ///
1909 /// See: <https://dprint.dev/plugins/typescript/config/#quoteProps>
1910 #[serde(
1911 default,
1912 rename = "quoteProps",
1913 skip_serializing_if = "Option::is_none"
1914 )]
1915 pub quote_props: Option<QuoteProps>,
1916
1917 /// How to use single or double quotes.
1918 ///
1919 /// Default: `"alwaysDouble"`
1920 ///
1921 /// See: <https://dprint.dev/plugins/typescript/config/#quoteStyle>
1922 #[serde(
1923 default,
1924 rename = "quoteStyle",
1925 skip_serializing_if = "Option::is_none"
1926 )]
1927 pub quote_style: Option<QuoteStyle>,
1928
1929 /// How semi-colons should be used.
1930 ///
1931 /// Default: `"prefer"`
1932 ///
1933 /// See: <https://dprint.dev/plugins/typescript/config/#semiColons>
1934 #[serde(
1935 default,
1936 rename = "semiColons",
1937 skip_serializing_if = "Option::is_none"
1938 )]
1939 pub semi_colons: Option<SemiColons>,
1940
1941 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
1942 ///
1943 /// Default: `false`
1944 ///
1945 /// See: <https://dprint.dev/plugins/typescript/config/#sequenceExpressionpreferHanging>
1946 #[serde(
1947 default,
1948 rename = "sequenceExpression.preferHanging",
1949 skip_serializing_if = "Option::is_none"
1950 )]
1951 pub sequence_expression_prefer_hanging: Option<bool>,
1952
1953 /// Where to place the opening brace.
1954 ///
1955 /// Default: `"sameLineUnlessHanging"`
1956 ///
1957 /// See: <https://dprint.dev/plugins/typescript/config/#setAccessorbracePosition>
1958 #[serde(
1959 default,
1960 rename = "setAccessor.bracePosition",
1961 skip_serializing_if = "Option::is_none"
1962 )]
1963 pub set_accessor_brace_position: Option<BracePosition>,
1964
1965 /// Whether to add a space before the parentheses of a set accessor.
1966 ///
1967 /// Default: `false`
1968 ///
1969 /// See: <https://dprint.dev/plugins/typescript/config/#setAccessorspaceBeforeParentheses>
1970 #[serde(
1971 default,
1972 rename = "setAccessor.spaceBeforeParentheses",
1973 skip_serializing_if = "Option::is_none"
1974 )]
1975 pub set_accessor_space_before_parentheses: Option<bool>,
1976
1977 /// Where to place the expression of a statement that could possibly be on one line (ex. `if (true) console.log(5);`).
1978 ///
1979 /// Default: `"maintain"`
1980 ///
1981 /// See: <https://dprint.dev/plugins/typescript/config/#singleBodyPosition>
1982 #[serde(
1983 default,
1984 rename = "singleBodyPosition",
1985 skip_serializing_if = "Option::is_none"
1986 )]
1987 pub single_body_position: Option<OperatorPosition>,
1988
1989 /// Whether to place spaces around enclosed expressions.
1990 ///
1991 /// Default: `false`
1992 ///
1993 /// See: <https://dprint.dev/plugins/typescript/config/#spaceAround>
1994 #[serde(
1995 default,
1996 rename = "spaceAround",
1997 skip_serializing_if = "Option::is_none"
1998 )]
1999 pub space_around: Option<bool>,
2000
2001 /// Whether to add a space surrounding the properties of single line object-like nodes.
2002 ///
2003 /// Default: `true`
2004 ///
2005 /// See: <https://dprint.dev/plugins/typescript/config/#spaceSurroundingProperties>
2006 #[serde(
2007 default,
2008 rename = "spaceSurroundingProperties",
2009 skip_serializing_if = "Option::is_none"
2010 )]
2011 pub space_surrounding_properties: Option<bool>,
2012
2013 /// Where to place the opening brace.
2014 ///
2015 /// Default: `"sameLineUnlessHanging"`
2016 ///
2017 /// See: <https://dprint.dev/plugins/typescript/config/#staticBlockbracePosition>
2018 #[serde(
2019 default,
2020 rename = "staticBlock.bracePosition",
2021 skip_serializing_if = "Option::is_none"
2022 )]
2023 pub static_block_brace_position: Option<BracePosition>,
2024
2025 /// Where to place the opening brace.
2026 ///
2027 /// Default: `"sameLineUnlessHanging"`
2028 ///
2029 /// See: <https://dprint.dev/plugins/typescript/config/#switchCasebracePosition>
2030 #[serde(
2031 default,
2032 rename = "switchCase.bracePosition",
2033 skip_serializing_if = "Option::is_none"
2034 )]
2035 pub switch_case_brace_position: Option<BracePosition>,
2036
2037 /// Where to place the opening brace.
2038 ///
2039 /// Default: `"sameLineUnlessHanging"`
2040 ///
2041 /// See: <https://dprint.dev/plugins/typescript/config/#switchStatementbracePosition>
2042 #[serde(
2043 default,
2044 rename = "switchStatement.bracePosition",
2045 skip_serializing_if = "Option::is_none"
2046 )]
2047 pub switch_statement_brace_position: Option<BracePosition>,
2048
2049 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
2050 ///
2051 /// Default: `false`
2052 ///
2053 /// See: <https://dprint.dev/plugins/typescript/config/#switchStatementpreferHanging>
2054 #[serde(
2055 default,
2056 rename = "switchStatement.preferHanging",
2057 skip_serializing_if = "Option::is_none"
2058 )]
2059 pub switch_statement_prefer_hanging: Option<bool>,
2060
2061 /// Whether to place spaces around enclosed expressions.
2062 ///
2063 /// Default: `false`
2064 ///
2065 /// See: <https://dprint.dev/plugins/typescript/config/#switchStatementspaceAround>
2066 #[serde(
2067 default,
2068 rename = "switchStatement.spaceAround",
2069 skip_serializing_if = "Option::is_none"
2070 )]
2071 pub switch_statement_space_around: Option<bool>,
2072
2073 /// Whether to add a space before the literal in a tagged template.
2074 ///
2075 /// Default: `false`
2076 ///
2077 /// See: <https://dprint.dev/plugins/typescript/config/#taggedTemplatespaceBeforeLiteral>
2078 #[serde(
2079 default,
2080 rename = "taggedTemplate.spaceBeforeLiteral",
2081 skip_serializing_if = "Option::is_none"
2082 )]
2083 pub tagged_template_space_before_literal: Option<bool>,
2084
2085 /// If trailing commas should be used.
2086 ///
2087 /// Default: `"onlyMultiLine"`
2088 ///
2089 /// See: <https://dprint.dev/plugins/typescript/config/#trailingCommas>
2090 #[serde(
2091 default,
2092 rename = "trailingCommas",
2093 skip_serializing_if = "Option::is_none"
2094 )]
2095 pub trailing_commas: Option<TrailingCommas>,
2096
2097 /// Where to place the opening brace.
2098 ///
2099 /// Default: `"sameLineUnlessHanging"`
2100 ///
2101 /// See: <https://dprint.dev/plugins/typescript/config/#tryStatementbracePosition>
2102 #[serde(
2103 default,
2104 rename = "tryStatement.bracePosition",
2105 skip_serializing_if = "Option::is_none"
2106 )]
2107 pub try_statement_brace_position: Option<BracePosition>,
2108
2109 /// Where to place the next control flow within a control flow statement.
2110 ///
2111 /// Default: `"sameLine"`
2112 ///
2113 /// See: <https://dprint.dev/plugins/typescript/config/#tryStatementnextControlFlowPosition>
2114 #[serde(
2115 default,
2116 rename = "tryStatement.nextControlFlowPosition",
2117 skip_serializing_if = "Option::is_none"
2118 )]
2119 pub try_statement_next_control_flow_position: Option<OperatorPosition>,
2120
2121 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
2122 ///
2123 /// Default: `"never"`
2124 ///
2125 /// See: <https://dprint.dev/plugins/typescript/config/#tupleTypepreferHanging>
2126 #[serde(
2127 default,
2128 rename = "tupleType.preferHanging",
2129 skip_serializing_if = "Option::is_none"
2130 )]
2131 pub tuple_type_prefer_hanging: Option<PreferHanging>,
2132
2133 /// If code should revert back from being on multiple lines to being on a single line when able.
2134 ///
2135 /// Default: `false`
2136 ///
2137 /// See: <https://dprint.dev/plugins/typescript/config/#tupleTypepreferSingleLine>
2138 #[serde(
2139 default,
2140 rename = "tupleType.preferSingleLine",
2141 skip_serializing_if = "Option::is_none"
2142 )]
2143 pub tuple_type_prefer_single_line: Option<bool>,
2144
2145 /// Whether to place spaces around enclosed expressions.
2146 ///
2147 /// Default: `false`
2148 ///
2149 /// See: <https://dprint.dev/plugins/typescript/config/#tupleTypespaceAround>
2150 #[serde(
2151 default,
2152 rename = "tupleType.spaceAround",
2153 skip_serializing_if = "Option::is_none"
2154 )]
2155 pub tuple_type_space_around: Option<bool>,
2156
2157 /// If trailing commas should be used.
2158 ///
2159 /// Default: `"onlyMultiLine"`
2160 ///
2161 /// See: <https://dprint.dev/plugins/typescript/config/#tupleTypetrailingCommas>
2162 #[serde(
2163 default,
2164 rename = "tupleType.trailingCommas",
2165 skip_serializing_if = "Option::is_none"
2166 )]
2167 pub tuple_type_trailing_commas: Option<TrailingCommas>,
2168
2169 /// Whether to add a space before the colon of a type annotation.
2170 ///
2171 /// Default: `false`
2172 ///
2173 /// See: <https://dprint.dev/plugins/typescript/config/#typeAnnotationspaceBeforeColon>
2174 #[serde(
2175 default,
2176 rename = "typeAnnotation.spaceBeforeColon",
2177 skip_serializing_if = "Option::is_none"
2178 )]
2179 pub type_annotation_space_before_colon: Option<bool>,
2180
2181 /// Whether to add a space before the expression in a type assertion.
2182 ///
2183 /// Default: `true`
2184 ///
2185 /// See: <https://dprint.dev/plugins/typescript/config/#typeAssertionspaceBeforeExpression>
2186 #[serde(
2187 default,
2188 rename = "typeAssertion.spaceBeforeExpression",
2189 skip_serializing_if = "Option::is_none"
2190 )]
2191 pub type_assertion_space_before_expression: Option<bool>,
2192
2193 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
2194 ///
2195 /// Default: `false`
2196 ///
2197 /// See: <https://dprint.dev/plugins/typescript/config/#typeLiteralpreferHanging>
2198 #[serde(
2199 default,
2200 rename = "typeLiteral.preferHanging",
2201 skip_serializing_if = "Option::is_none"
2202 )]
2203 pub type_literal_prefer_hanging: Option<bool>,
2204
2205 /// If code should revert back from being on multiple lines to being on a single line when able.
2206 ///
2207 /// Default: `false`
2208 ///
2209 /// See: <https://dprint.dev/plugins/typescript/config/#typeLiteralpreferSingleLine>
2210 #[serde(
2211 default,
2212 rename = "typeLiteral.preferSingleLine",
2213 skip_serializing_if = "Option::is_none"
2214 )]
2215 pub type_literal_prefer_single_line: Option<bool>,
2216
2217 /// The kind of separator to use in type literals.
2218 ///
2219 /// Default: `"semiColon"`
2220 ///
2221 /// See: <https://dprint.dev/plugins/typescript/config/#typeLiteralseparatorKind>
2222 #[serde(
2223 default,
2224 rename = "typeLiteral.separatorKind",
2225 skip_serializing_if = "Option::is_none"
2226 )]
2227 pub type_literal_separator_kind: Option<SeparatorKind>,
2228
2229 /// The kind of separator to use in type literals.
2230 ///
2231 /// Default: `"semiColon"`
2232 ///
2233 /// See: <https://dprint.dev/plugins/typescript/config/#typeLiteralseparatorKindmultiLine>
2234 #[serde(
2235 default,
2236 rename = "typeLiteral.separatorKind.multiLine",
2237 skip_serializing_if = "Option::is_none"
2238 )]
2239 pub type_literal_separator_kind_multi_line: Option<SeparatorKind>,
2240
2241 /// The kind of separator to use in type literals.
2242 ///
2243 /// Default: `"semiColon"`
2244 ///
2245 /// See: <https://dprint.dev/plugins/typescript/config/#typeLiteralseparatorKindsingleLine>
2246 #[serde(
2247 default,
2248 rename = "typeLiteral.separatorKind.singleLine",
2249 skip_serializing_if = "Option::is_none"
2250 )]
2251 pub type_literal_separator_kind_single_line: Option<SeparatorKind>,
2252
2253 /// Whether to add a space surrounding the properties of a single line type literal.
2254 ///
2255 /// Default: `true`
2256 ///
2257 /// See: <https://dprint.dev/plugins/typescript/config/#typeLiteralspaceSurroundingProperties>
2258 #[serde(
2259 default,
2260 rename = "typeLiteral.spaceSurroundingProperties",
2261 skip_serializing_if = "Option::is_none"
2262 )]
2263 pub type_literal_space_surrounding_properties: Option<bool>,
2264
2265 /// If trailing commas should be used.
2266 ///
2267 /// Default: `"onlyMultiLine"`
2268 ///
2269 /// See: <https://dprint.dev/plugins/typescript/config/#typeLiteraltrailingCommas>
2270 #[serde(
2271 default,
2272 rename = "typeLiteral.trailingCommas",
2273 skip_serializing_if = "Option::is_none"
2274 )]
2275 pub type_literal_trailing_commas: Option<TrailingCommas>,
2276
2277 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
2278 ///
2279 /// Default: `"never"`
2280 ///
2281 /// See: <https://dprint.dev/plugins/typescript/config/#typeParameterspreferHanging>
2282 #[serde(
2283 default,
2284 rename = "typeParameters.preferHanging",
2285 skip_serializing_if = "Option::is_none"
2286 )]
2287 pub type_parameters_prefer_hanging: Option<PreferHanging>,
2288
2289 /// If code should revert back from being on multiple lines to being on a single line when able.
2290 ///
2291 /// Default: `false`
2292 ///
2293 /// See: <https://dprint.dev/plugins/typescript/config/#typeParameterspreferSingleLine>
2294 #[serde(
2295 default,
2296 rename = "typeParameters.preferSingleLine",
2297 skip_serializing_if = "Option::is_none"
2298 )]
2299 pub type_parameters_prefer_single_line: Option<bool>,
2300
2301 /// If trailing commas should be used.
2302 ///
2303 /// Default: `"onlyMultiLine"`
2304 ///
2305 /// See: <https://dprint.dev/plugins/typescript/config/#typeParameterstrailingCommas>
2306 #[serde(
2307 default,
2308 rename = "typeParameters.trailingCommas",
2309 skip_serializing_if = "Option::is_none"
2310 )]
2311 pub type_parameters_trailing_commas: Option<TrailingCommas>,
2312
2313 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
2314 ///
2315 /// Default: `false`
2316 ///
2317 /// See: <https://dprint.dev/plugins/typescript/config/#unionAndIntersectionTypepreferHanging>
2318 #[serde(
2319 default,
2320 rename = "unionAndIntersectionType.preferHanging",
2321 skip_serializing_if = "Option::is_none"
2322 )]
2323 pub union_and_intersection_type_prefer_hanging: Option<bool>,
2324
2325 /// If code should revert back from being on multiple lines to being on a single line when able.
2326 ///
2327 /// Default: `false`
2328 ///
2329 /// See: <https://dprint.dev/plugins/typescript/config/#unionAndIntersectionTypepreferSingleLine>
2330 #[serde(
2331 default,
2332 rename = "unionAndIntersectionType.preferSingleLine",
2333 skip_serializing_if = "Option::is_none"
2334 )]
2335 pub union_and_intersection_type_prefer_single_line: Option<bool>,
2336
2337 /// If braces should be used or not.
2338 ///
2339 /// Default: `"whenNotSingleLine"`
2340 ///
2341 /// See: <https://dprint.dev/plugins/typescript/config/#useBraces>
2342 #[serde(default, rename = "useBraces", skip_serializing_if = "Option::is_none")]
2343 pub use_braces: Option<UseBraces>,
2344
2345 /// Whether to use tabs (true) or spaces (false).
2346 ///
2347 /// Default: `false`
2348 ///
2349 /// See: <https://dprint.dev/plugins/typescript/config/#useTabs>
2350 #[serde(default, rename = "useTabs", skip_serializing_if = "Option::is_none")]
2351 pub use_tabs: Option<bool>,
2352
2353 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
2354 ///
2355 /// Default: `false`
2356 ///
2357 /// See: <https://dprint.dev/plugins/typescript/config/#variableStatementpreferHanging>
2358 #[serde(
2359 default,
2360 rename = "variableStatement.preferHanging",
2361 skip_serializing_if = "Option::is_none"
2362 )]
2363 pub variable_statement_prefer_hanging: Option<bool>,
2364
2365 /// If code should revert back from being on multiple lines to being on a single line when able.
2366 ///
2367 /// Default: `false`
2368 ///
2369 /// See: <https://dprint.dev/plugins/typescript/config/#variableStatementpreferSingleLine>
2370 #[serde(
2371 default,
2372 rename = "variableStatement.preferSingleLine",
2373 skip_serializing_if = "Option::is_none"
2374 )]
2375 pub variable_statement_prefer_single_line: Option<bool>,
2376
2377 /// Where to place the opening brace.
2378 ///
2379 /// Default: `"sameLineUnlessHanging"`
2380 ///
2381 /// See: <https://dprint.dev/plugins/typescript/config/#whileStatementbracePosition>
2382 #[serde(
2383 default,
2384 rename = "whileStatement.bracePosition",
2385 skip_serializing_if = "Option::is_none"
2386 )]
2387 pub while_statement_brace_position: Option<BracePosition>,
2388
2389 /// Set to prefer hanging indentation when exceeding the line width instead of making code split up on multiple lines.
2390 ///
2391 /// Default: `false`
2392 ///
2393 /// See: <https://dprint.dev/plugins/typescript/config/#whileStatementpreferHanging>
2394 #[serde(
2395 default,
2396 rename = "whileStatement.preferHanging",
2397 skip_serializing_if = "Option::is_none"
2398 )]
2399 pub while_statement_prefer_hanging: Option<bool>,
2400
2401 /// Where to place the expression of a statement that could possibly be on one line (ex. `if (true) console.log(5);`).
2402 ///
2403 /// Default: `"maintain"`
2404 ///
2405 /// See: <https://dprint.dev/plugins/typescript/config/#whileStatementsingleBodyPosition>
2406 #[serde(
2407 default,
2408 rename = "whileStatement.singleBodyPosition",
2409 skip_serializing_if = "Option::is_none"
2410 )]
2411 pub while_statement_single_body_position: Option<OperatorPosition>,
2412
2413 /// Whether to add a space after the `while` keyword in a while statement.
2414 ///
2415 /// Default: `true`
2416 ///
2417 /// See: <https://dprint.dev/plugins/typescript/config/#whileStatementspaceAfterWhileKeyword>
2418 #[serde(
2419 default,
2420 rename = "whileStatement.spaceAfterWhileKeyword",
2421 skip_serializing_if = "Option::is_none"
2422 )]
2423 pub while_statement_space_after_while_keyword: Option<bool>,
2424
2425 /// Whether to place spaces around enclosed expressions.
2426 ///
2427 /// Default: `false`
2428 ///
2429 /// See: <https://dprint.dev/plugins/typescript/config/#whileStatementspaceAround>
2430 #[serde(
2431 default,
2432 rename = "whileStatement.spaceAround",
2433 skip_serializing_if = "Option::is_none"
2434 )]
2435 pub while_statement_space_around: Option<bool>,
2436
2437 /// If braces should be used or not.
2438 ///
2439 /// Default: `"whenNotSingleLine"`
2440 ///
2441 /// See: <https://dprint.dev/plugins/typescript/config/#whileStatementuseBraces>
2442 #[serde(
2443 default,
2444 rename = "whileStatement.useBraces",
2445 skip_serializing_if = "Option::is_none"
2446 )]
2447 pub while_statement_use_braces: Option<UseBraces>,
2448
2449 /// Additional plugin-specific settings not covered by the typed fields.
2450 #[serde(flatten)]
2451 pub extra: BTreeMap<String, Value>,
2452}