dprint_plugin_typescript/configuration/
types.rs

1use dprint_core::configuration::*;
2use dprint_core::generate_str_to_from;
3use serde::Deserialize;
4use serde::Serialize;
5
6#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub enum PreferHanging {
9  /// Always prefer multi-line indentation
10  Never,
11  /// Prefer hanging indentation for sequences with only a single item, but if there are multiple
12  /// items then use multi-line indentation
13  OnlySingleItem,
14  /// Always prefer hanging indentation
15  Always,
16}
17
18generate_str_to_from![PreferHanging, [Never, "never"], [OnlySingleItem, "onlySingleItem"], [Always, "always"]];
19
20/// Semi colon possibilities.
21#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
22#[serde(rename_all = "camelCase")]
23pub enum SemiColons {
24  /// Always uses semi-colons where applicable.
25  Always,
26  /// Prefers to use semi-colons, but doesn't add one in certain scenarios
27  /// such as for the last member of a single-line type literal.
28  Prefer,
29  /// Uses automatic semi-colon insertion. Only adds a semi-colon at the start
30  /// of some expression statements when necessary.
31  Asi,
32}
33
34impl SemiColons {
35  /// Gets if this option is "Always" or "Prefer".
36  pub(crate) fn is_true(&self) -> bool {
37    match self {
38      SemiColons::Always | SemiColons::Prefer => true,
39      SemiColons::Asi => false,
40    }
41  }
42}
43
44generate_str_to_from![SemiColons, [Always, "always"], [Prefer, "prefer"], [Asi, "asi"]];
45
46/// Trailing comma possibilities.
47#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
48#[serde(rename_all = "camelCase")]
49pub enum TrailingCommas {
50  /// Trailing commas should not be used.
51  Never,
52  /// Trailing commas should always be used.
53  Always,
54  /// Trailing commas should only be used in multi-line scenarios.
55  OnlyMultiLine,
56}
57
58generate_str_to_from![TrailingCommas, [Always, "always"], [Never, "never"], [OnlyMultiLine, "onlyMultiLine"]];
59
60/// Force multilines possibilities.
61#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
62#[serde(rename_all = "camelCase")]
63pub enum ForceMultiLine {
64  /// Multiline imports/exports should not be forced.
65  Never,
66  /// Always force multiline imports/exports.
67  Always,
68  /// Mulitline imports/exports should be forced only when importing/exporting multiple items.
69  WhenMultiple,
70}
71
72generate_str_to_from![ForceMultiLine, [Always, "always"], [Never, "never"], [WhenMultiple, "whenMultiple"]];
73
74/// Where to place the opening brace.
75#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
76#[serde(rename_all = "camelCase")]
77pub enum BracePosition {
78  /// Maintains the brace being on the next line or the same line.
79  Maintain,
80  /// Forces the brace to be on the same line.
81  SameLine,
82  /// Forces the brace to be on the next line.
83  NextLine,
84  /// Forces the brace to be on the next line if the same line is hanging, but otherwise uses the same line.
85  SameLineUnlessHanging,
86}
87
88generate_str_to_from![
89  BracePosition,
90  [Maintain, "maintain"],
91  [SameLine, "sameLine"],
92  [NextLine, "nextLine"],
93  [SameLineUnlessHanging, "sameLineUnlessHanging"]
94];
95
96/// How to space members.
97#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
98#[serde(rename_all = "camelCase")]
99pub enum MemberSpacing {
100  /// Maintains whether a newline or blankline is used.
101  Maintain,
102  /// Forces a new line between members.
103  #[serde(rename = "newLine")]
104  NewLine,
105  /// Forces a blank line between members.
106  #[serde(rename = "blankLine")]
107  BlankLine,
108}
109
110generate_str_to_from![MemberSpacing, [Maintain, "maintain"], [BlankLine, "blankLine"], [NewLine, "newLine"]];
111
112/// Where to place the next control flow within a control flow statement.
113#[derive(Debug, Clone, PartialEq, Copy, Serialize, Deserialize)]
114#[serde(rename_all = "camelCase")]
115pub enum NextControlFlowPosition {
116  /// Maintains the next control flow being on the next line or the same line.
117  Maintain,
118  /// Forces the next control flow to be on the same line.
119  SameLine,
120  /// Forces the next control flow to be on the next line.
121  NextLine,
122}
123
124generate_str_to_from![NextControlFlowPosition, [Maintain, "maintain"], [SameLine, "sameLine"], [NextLine, "nextLine"]];
125
126/// Where to place the operator for expressions that span multiple lines.
127#[derive(Debug, Clone, PartialEq, Copy, Serialize, Deserialize)]
128#[serde(rename_all = "camelCase")]
129pub enum OperatorPosition {
130  /// Maintains the operator being on the next line or the same line.
131  Maintain,
132  /// Forces the operator to be on the same line.
133  SameLine,
134  /// Forces the operator to be on the next line.
135  NextLine,
136}
137
138generate_str_to_from![OperatorPosition, [Maintain, "maintain"], [SameLine, "sameLine"], [NextLine, "nextLine"]];
139
140/// Where to place a node that could be on the same line or next line.
141#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
142#[serde(rename_all = "camelCase")]
143pub enum SameOrNextLinePosition {
144  /// Maintains the position of the expression.
145  Maintain,
146  /// Forces the whole statement to be on one line.
147  SameLine,
148  /// Forces the expression to be on the next line.
149  NextLine,
150}
151
152generate_str_to_from![SameOrNextLinePosition, [Maintain, "maintain"], [SameLine, "sameLine"], [NextLine, "nextLine"]];
153
154/// If braces should be used or not in certain scenarios.
155#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
156#[serde(rename_all = "camelCase")]
157pub enum UseBraces {
158  /// Uses braces if they're used. Doesn't use braces if they're not used.
159  Maintain,
160  /// Uses braces when the body is on a different line.
161  WhenNotSingleLine,
162  /// Forces the use of braces. Will add them if they aren't used.
163  Always,
164  /// Forces no braces when the header is one line and body is one line. Otherwise forces braces.
165  PreferNone,
166}
167
168generate_str_to_from![
169  UseBraces,
170  [Maintain, "maintain"],
171  [WhenNotSingleLine, "whenNotSingleLine"],
172  [Always, "always"],
173  [PreferNone, "preferNone"]
174];
175
176/// Whether to use parentheses around a single parameter in an arrow function.
177#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
178#[serde(rename_all = "camelCase")]
179pub enum UseParentheses {
180  /// Maintains the current state of the parentheses.
181  Maintain,
182  /// Forces parentheses.
183  Force,
184  /// Prefers not using parentheses when possible.
185  PreferNone,
186}
187
188generate_str_to_from![UseParentheses, [Maintain, "maintain"], [Force, "force"], [PreferNone, "preferNone"]];
189
190/// How to decide to use single or double quotes.
191#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
192#[serde(rename_all = "camelCase")]
193pub enum QuoteStyle {
194  /// Always use double quotes.
195  AlwaysDouble,
196  /// Always use single quotes.
197  AlwaysSingle,
198  /// Prefer using double quotes except in scenarios where the string
199  /// contains more double quotes than single quotes.
200  PreferDouble,
201  /// Prefer using single quotes except in scenarios where the string
202  /// contains more single quotes than double quotes.
203  PreferSingle,
204}
205
206impl QuoteStyle {
207  /// Gets the associated JSX quote style.
208  pub fn to_jsx_quote_style(&self) -> JsxQuoteStyle {
209    match self {
210      QuoteStyle::AlwaysDouble | QuoteStyle::PreferDouble => JsxQuoteStyle::PreferDouble,
211      QuoteStyle::AlwaysSingle | QuoteStyle::PreferSingle => JsxQuoteStyle::PreferSingle,
212    }
213  }
214}
215
216generate_str_to_from![
217  QuoteStyle,
218  [AlwaysDouble, "alwaysDouble"],
219  [AlwaysSingle, "alwaysSingle"],
220  [PreferDouble, "preferDouble"],
221  [PreferSingle, "preferSingle"]
222];
223
224/// Whether to use single or double quotes for JSX attributes.
225#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
226#[serde(rename_all = "camelCase")]
227pub enum JsxQuoteStyle {
228  /// Prefer using double quotes except in scenarios where the string
229  /// contains more double quotes than single quotes.
230  PreferDouble,
231  /// Prefer using single quotes except in scenarios where the string
232  /// contains more single quotes than double quotes.
233  PreferSingle,
234}
235
236generate_str_to_from![JsxQuoteStyle, [PreferDouble, "preferDouble"], [PreferSingle, "preferSingle"]];
237
238/// Behaviour to use for quotes on property names.
239#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
240#[serde(rename_all = "camelCase")]
241pub enum QuoteProps {
242  /// Remove unnecessary quotes around property names.
243  AsNeeded,
244  /// Same as `AsNeeded`, but if one property requires quotes then quote them all.
245  Consistent,
246  /// Preserve quotes around property names.
247  Preserve,
248}
249
250generate_str_to_from![QuoteProps, [AsNeeded, "asNeeded"], [Consistent, "consistent"], [Preserve, "preserve"]];
251
252/// Whether to surround a JSX element or fragment with parentheses
253/// when it's the top JSX node and it spans multiple lines.
254#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
255#[serde(rename_all = "camelCase")]
256pub enum JsxMultiLineParens {
257  /// Never wrap JSX with parentheses.
258  Never,
259  /// Prefer wrapping with parentheses in most scenarios, except in function
260  /// arguments and JSX attributes.
261  Prefer,
262  /// Always wrap JSX with parentheses if it spans multiple lines.
263  Always,
264}
265
266generate_str_to_from![JsxMultiLineParens, [Never, "never"], [Prefer, "prefer"], [Always, "always"]];
267
268/// Whether to use semi-colons or commas.
269#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
270#[serde(rename_all = "camelCase")]
271pub enum SemiColonOrComma {
272  /// Use semi colons (default).
273  SemiColon,
274  /// Use commas.
275  Comma,
276}
277
278generate_str_to_from![SemiColonOrComma, [SemiColon, "semiColon"], [Comma, "comma"]];
279
280/// The kind of sort ordering to use.
281#[derive(Clone, PartialEq, Copy, Serialize, Deserialize)]
282#[serde(rename_all = "camelCase")]
283pub enum SortOrder {
284  /// Maintains the current ordering.
285  Maintain,
286  /// Alphabetically and case sensitive.
287  CaseSensitive,
288  /// Alphabetically and case insensitive.
289  CaseInsensitive,
290}
291
292generate_str_to_from![
293  SortOrder,
294  [Maintain, "maintain"],
295  [CaseSensitive, "caseSensitive"],
296  [CaseInsensitive, "caseInsensitive"]
297];
298
299#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, Default)]
300#[serde(rename_all = "camelCase")]
301pub enum NamedTypeImportsExportsOrder {
302  First,
303  Last,
304  #[default]
305  None,
306}
307
308generate_str_to_from![NamedTypeImportsExportsOrder, [First, "first"], [Last, "last"], [None, "none"]];
309
310#[derive(Clone, Serialize, Deserialize)]
311#[serde(rename_all = "camelCase")]
312pub struct Configuration {
313  pub indent_width: u8,
314  pub line_width: u32,
315  pub use_tabs: bool,
316  pub new_line_kind: NewLineKind,
317  pub quote_style: QuoteStyle,
318  pub quote_props: QuoteProps,
319  pub semi_colons: SemiColons,
320  pub file_indent_level: u32,
321  /* situational */
322  #[serde(rename = "arrowFunction.useParentheses")]
323  pub arrow_function_use_parentheses: UseParentheses,
324  #[serde(rename = "binaryExpression.linePerExpression")]
325  pub binary_expression_line_per_expression: bool,
326  #[serde(rename = "conditionalExpression.linePerExpression")]
327  pub conditional_expression_line_per_expression: bool,
328  #[serde(rename = "jsx.quoteStyle")]
329  pub jsx_quote_style: JsxQuoteStyle,
330  #[serde(rename = "jsx.multiLineParens")]
331  pub jsx_multi_line_parens: JsxMultiLineParens,
332  #[serde(rename = "jsx.forceNewLinesSurroundingContent")]
333  pub jsx_force_new_lines_surrounding_content: bool,
334  #[serde(rename = "jsxOpeningElement.bracketPosition")]
335  pub jsx_opening_element_bracket_position: SameOrNextLinePosition,
336  #[serde(rename = "jsxSelfClosingElement.bracketPosition")]
337  pub jsx_self_closing_element_bracket_position: SameOrNextLinePosition,
338  #[serde(rename = "memberExpression.linePerExpression")]
339  pub member_expression_line_per_expression: bool,
340  #[serde(rename = "typeLiteral.separatorKind.singleLine")]
341  pub type_literal_separator_kind_single_line: SemiColonOrComma,
342  #[serde(rename = "typeLiteral.separatorKind.multiLine")]
343  pub type_literal_separator_kind_multi_line: SemiColonOrComma,
344  /* sorting */
345  #[serde(rename = "module.sortImportDeclarations")]
346  pub module_sort_import_declarations: SortOrder,
347  #[serde(rename = "module.sortExportDeclarations")]
348  pub module_sort_export_declarations: SortOrder,
349  #[serde(rename = "importDeclaration.sortNamedImports")]
350  pub import_declaration_sort_named_imports: SortOrder,
351  #[serde(rename = "importDeclaration.sortTypeOnlyImports")]
352  pub import_declaration_sort_type_only_imports: NamedTypeImportsExportsOrder,
353  #[serde(rename = "exportDeclaration.sortNamedExports")]
354  pub export_declaration_sort_named_exports: SortOrder,
355  #[serde(rename = "exportDeclaration.sortTypeOnlyExports")]
356  pub export_declaration_sort_type_only_exports: NamedTypeImportsExportsOrder,
357  /* ignore comments */
358  pub ignore_node_comment_text: String,
359  pub ignore_file_comment_text: String,
360  /* brace position */
361  #[serde(rename = "arrowFunction.bracePosition")]
362  pub arrow_function_brace_position: BracePosition,
363  #[serde(rename = "classDeclaration.bracePosition")]
364  pub class_declaration_brace_position: BracePosition,
365  #[serde(rename = "classExpression.bracePosition")]
366  pub class_expression_brace_position: BracePosition,
367  #[serde(rename = "constructor.bracePosition")]
368  pub constructor_brace_position: BracePosition,
369  #[serde(rename = "doWhileStatement.bracePosition")]
370  pub do_while_statement_brace_position: BracePosition,
371  #[serde(rename = "enumDeclaration.bracePosition")]
372  pub enum_declaration_brace_position: BracePosition,
373  #[serde(rename = "getAccessor.bracePosition")]
374  pub get_accessor_brace_position: BracePosition,
375  #[serde(rename = "ifStatement.bracePosition")]
376  pub if_statement_brace_position: BracePosition,
377  #[serde(rename = "interfaceDeclaration.bracePosition")]
378  pub interface_declaration_brace_position: BracePosition,
379  #[serde(rename = "forStatement.bracePosition")]
380  pub for_statement_brace_position: BracePosition,
381  #[serde(rename = "forInStatement.bracePosition")]
382  pub for_in_statement_brace_position: BracePosition,
383  #[serde(rename = "forOfStatement.bracePosition")]
384  pub for_of_statement_brace_position: BracePosition,
385  #[serde(rename = "functionDeclaration.bracePosition")]
386  pub function_declaration_brace_position: BracePosition,
387  #[serde(rename = "functionExpression.bracePosition")]
388  pub function_expression_brace_position: BracePosition,
389  #[serde(rename = "method.bracePosition")]
390  pub method_brace_position: BracePosition,
391  #[serde(rename = "moduleDeclaration.bracePosition")]
392  pub module_declaration_brace_position: BracePosition,
393  #[serde(rename = "setAccessor.bracePosition")]
394  pub set_accessor_brace_position: BracePosition,
395  #[serde(rename = "staticBlock.bracePosition")]
396  pub static_block_brace_position: BracePosition,
397  #[serde(rename = "switchCase.bracePosition")]
398  pub switch_case_brace_position: BracePosition,
399  #[serde(rename = "switchStatement.bracePosition")]
400  pub switch_statement_brace_position: BracePosition,
401  #[serde(rename = "tryStatement.bracePosition")]
402  pub try_statement_brace_position: BracePosition,
403  #[serde(rename = "whileStatement.bracePosition")]
404  pub while_statement_brace_position: BracePosition,
405  /* prefer hanging */
406  #[serde(rename = "arguments.preferHanging")]
407  pub arguments_prefer_hanging: PreferHanging,
408  #[serde(rename = "arrayExpression.preferHanging")]
409  pub array_expression_prefer_hanging: PreferHanging,
410  #[serde(rename = "arrayPattern.preferHanging")]
411  pub array_pattern_prefer_hanging: bool,
412  #[serde(rename = "doWhileStatement.preferHanging")]
413  pub do_while_statement_prefer_hanging: bool,
414  #[serde(rename = "exportDeclaration.preferHanging")]
415  pub export_declaration_prefer_hanging: bool,
416  #[serde(rename = "extendsClause.preferHanging")]
417  pub extends_clause_prefer_hanging: bool,
418  #[serde(rename = "forStatement.preferHanging")]
419  pub for_statement_prefer_hanging: bool,
420  #[serde(rename = "forInStatement.preferHanging")]
421  pub for_in_statement_prefer_hanging: bool,
422  #[serde(rename = "forOfStatement.preferHanging")]
423  pub for_of_statement_prefer_hanging: bool,
424  #[serde(rename = "ifStatement.preferHanging")]
425  pub if_statement_prefer_hanging: bool,
426  #[serde(rename = "implementsClause.preferHanging")]
427  pub implements_clause_prefer_hanging: bool,
428  #[serde(rename = "importDeclaration.preferHanging")]
429  pub import_declaration_prefer_hanging: bool,
430  #[serde(rename = "jsxAttributes.preferHanging")]
431  pub jsx_attributes_prefer_hanging: bool,
432  #[serde(rename = "objectExpression.preferHanging")]
433  pub object_expression_prefer_hanging: bool,
434  #[serde(rename = "objectPattern.preferHanging")]
435  pub object_pattern_prefer_hanging: bool,
436  #[serde(rename = "parameters.preferHanging")]
437  pub parameters_prefer_hanging: PreferHanging,
438  #[serde(rename = "sequenceExpression.preferHanging")]
439  pub sequence_expression_prefer_hanging: bool,
440  #[serde(rename = "switchStatement.preferHanging")]
441  pub switch_statement_prefer_hanging: bool,
442  #[serde(rename = "tupleType.preferHanging")]
443  pub tuple_type_prefer_hanging: PreferHanging,
444  #[serde(rename = "typeLiteral.preferHanging")]
445  pub type_literal_prefer_hanging: bool,
446  #[serde(rename = "typeParameters.preferHanging")]
447  pub type_parameters_prefer_hanging: PreferHanging,
448  #[serde(rename = "unionAndIntersectionType.preferHanging")]
449  pub union_and_intersection_type_prefer_hanging: bool,
450  #[serde(rename = "variableStatement.preferHanging")]
451  pub variable_statement_prefer_hanging: bool,
452  #[serde(rename = "whileStatement.preferHanging")]
453  pub while_statement_prefer_hanging: bool,
454  /* member spacing */
455  #[serde(rename = "enumDeclaration.memberSpacing")]
456  pub enum_declaration_member_spacing: MemberSpacing,
457  /* next control flow position */
458  #[serde(rename = "ifStatement.nextControlFlowPosition")]
459  pub if_statement_next_control_flow_position: NextControlFlowPosition,
460  #[serde(rename = "tryStatement.nextControlFlowPosition")]
461  pub try_statement_next_control_flow_position: NextControlFlowPosition,
462  #[serde(rename = "doWhileStatement.nextControlFlowPosition")]
463  pub do_while_statement_next_control_flow_position: NextControlFlowPosition,
464  /* operator position */
465  #[serde(rename = "binaryExpression.operatorPosition")]
466  pub binary_expression_operator_position: OperatorPosition,
467  #[serde(rename = "conditionalExpression.operatorPosition")]
468  pub conditional_expression_operator_position: OperatorPosition,
469  #[serde(rename = "conditionalType.operatorPosition")]
470  pub conditional_type_operator_position: OperatorPosition,
471  /* single body position */
472  #[serde(rename = "ifStatement.singleBodyPosition")]
473  pub if_statement_single_body_position: SameOrNextLinePosition,
474  #[serde(rename = "forStatement.singleBodyPosition")]
475  pub for_statement_single_body_position: SameOrNextLinePosition,
476  #[serde(rename = "forInStatement.singleBodyPosition")]
477  pub for_in_statement_single_body_position: SameOrNextLinePosition,
478  #[serde(rename = "forOfStatement.singleBodyPosition")]
479  pub for_of_statement_single_body_position: SameOrNextLinePosition,
480  #[serde(rename = "whileStatement.singleBodyPosition")]
481  pub while_statement_single_body_position: SameOrNextLinePosition,
482  /* trailing commas */
483  #[serde(rename = "arguments.trailingCommas")]
484  pub arguments_trailing_commas: TrailingCommas,
485  #[serde(rename = "parameters.trailingCommas")]
486  pub parameters_trailing_commas: TrailingCommas,
487  #[serde(rename = "arrayExpression.trailingCommas")]
488  pub array_expression_trailing_commas: TrailingCommas,
489  #[serde(rename = "arrayPattern.trailingCommas")]
490  pub array_pattern_trailing_commas: TrailingCommas,
491  #[serde(rename = "enumDeclaration.trailingCommas")]
492  pub enum_declaration_trailing_commas: TrailingCommas,
493  #[serde(rename = "exportDeclaration.trailingCommas")]
494  pub export_declaration_trailing_commas: TrailingCommas,
495  #[serde(rename = "importDeclaration.trailingCommas")]
496  pub import_declaration_trailing_commas: TrailingCommas,
497  #[serde(rename = "objectPattern.trailingCommas")]
498  pub object_pattern_trailing_commas: TrailingCommas,
499  #[serde(rename = "objectExpression.trailingCommas")]
500  pub object_expression_trailing_commas: TrailingCommas,
501  #[serde(rename = "tupleType.trailingCommas")]
502  pub tuple_type_trailing_commas: TrailingCommas,
503  #[serde(rename = "typeLiteral.trailingCommas")]
504  pub type_literal_trailing_commas: TrailingCommas,
505  #[serde(rename = "typeParameters.trailingCommas")]
506  pub type_parameters_trailing_commas: TrailingCommas,
507  /* use braces */
508  #[serde(rename = "ifStatement.useBraces")]
509  pub if_statement_use_braces: UseBraces,
510  #[serde(rename = "forStatement.useBraces")]
511  pub for_statement_use_braces: UseBraces,
512  #[serde(rename = "forOfStatement.useBraces")]
513  pub for_of_statement_use_braces: UseBraces,
514  #[serde(rename = "forInStatement.useBraces")]
515  pub for_in_statement_use_braces: UseBraces,
516  #[serde(rename = "whileStatement.useBraces")]
517  pub while_statement_use_braces: UseBraces,
518  /* prefer single line */
519  #[serde(rename = "arrayExpression.preferSingleLine")]
520  pub array_expression_prefer_single_line: bool,
521  #[serde(rename = "arrayPattern.preferSingleLine")]
522  pub array_pattern_prefer_single_line: bool,
523  #[serde(rename = "arguments.preferSingleLine")]
524  pub arguments_prefer_single_line: bool,
525  #[serde(rename = "binaryExpression.preferSingleLine")]
526  pub binary_expression_prefer_single_line: bool,
527  #[serde(rename = "computed.preferSingleLine")]
528  pub computed_prefer_single_line: bool,
529  #[serde(rename = "conditionalExpression.preferSingleLine")]
530  pub conditional_expression_prefer_single_line: bool,
531  #[serde(rename = "conditionalType.preferSingleLine")]
532  pub conditional_type_prefer_single_line: bool,
533  #[serde(rename = "decorators.preferSingleLine")]
534  pub decorators_prefer_single_line: bool,
535  #[serde(rename = "exportDeclaration.preferSingleLine")]
536  pub export_declaration_prefer_single_line: bool,
537  #[serde(rename = "forStatement.preferSingleLine")]
538  pub for_statement_prefer_single_line: bool,
539  #[serde(rename = "importDeclaration.preferSingleLine")]
540  pub import_declaration_prefer_single_line: bool,
541  #[serde(rename = "jsxAttributes.preferSingleLine")]
542  pub jsx_attributes_prefer_single_line: bool,
543  #[serde(rename = "jsxElement.preferSingleLine")]
544  pub jsx_element_prefer_single_line: bool,
545  #[serde(rename = "mappedType.preferSingleLine")]
546  pub mapped_type_prefer_single_line: bool,
547  #[serde(rename = "memberExpression.preferSingleLine")]
548  pub member_expression_prefer_single_line: bool,
549  #[serde(rename = "objectExpression.preferSingleLine")]
550  pub object_expression_prefer_single_line: bool,
551  #[serde(rename = "objectPattern.preferSingleLine")]
552  pub object_pattern_prefer_single_line: bool,
553  #[serde(rename = "parameters.preferSingleLine")]
554  pub parameters_prefer_single_line: bool,
555  #[serde(rename = "parentheses.preferSingleLine")]
556  pub parentheses_prefer_single_line: bool,
557  #[serde(rename = "tupleType.preferSingleLine")]
558  pub tuple_type_prefer_single_line: bool,
559  #[serde(rename = "typeLiteral.preferSingleLine")]
560  pub type_literal_prefer_single_line: bool,
561  #[serde(rename = "typeParameters.preferSingleLine")]
562  pub type_parameters_prefer_single_line: bool,
563  #[serde(rename = "unionAndIntersectionType.preferSingleLine")]
564  pub union_and_intersection_type_prefer_single_line: bool,
565  #[serde(rename = "variableStatement.preferSingleLine")]
566  pub variable_statement_prefer_single_line: bool,
567  /* force single line */
568  #[serde(rename = "importDeclaration.forceSingleLine")]
569  pub import_declaration_force_single_line: bool,
570  #[serde(rename = "exportDeclaration.forceSingleLine")]
571  pub export_declaration_force_single_line: bool,
572  /* force multi line specifiers */
573  #[serde(rename = "exportDeclaration.forceMultiLine")]
574  pub export_declaration_force_multi_line: ForceMultiLine,
575  #[serde(rename = "importDeclaration.forceMultiLine")]
576  pub import_declaration_force_multi_line: ForceMultiLine,
577
578  /* use space separator */
579  #[serde(rename = "binaryExpression.spaceSurroundingBitwiseAndArithmeticOperator")]
580  pub binary_expression_space_surrounding_bitwise_and_arithmetic_operator: bool,
581  #[serde(rename = "commentLine.forceSpaceAfterSlashes")]
582  pub comment_line_force_space_after_slashes: bool,
583  #[serde(rename = "constructSignature.spaceAfterNewKeyword")]
584  pub construct_signature_space_after_new_keyword: bool,
585  #[serde(rename = "constructor.spaceBeforeParentheses")]
586  pub constructor_space_before_parentheses: bool,
587  #[serde(rename = "constructorType.spaceAfterNewKeyword")]
588  pub constructor_type_space_after_new_keyword: bool,
589  #[serde(rename = "doWhileStatement.spaceAfterWhileKeyword")]
590  pub do_while_statement_space_after_while_keyword: bool,
591  #[serde(rename = "exportDeclaration.spaceSurroundingNamedExports")]
592  pub export_declaration_space_surrounding_named_exports: bool,
593  #[serde(rename = "forStatement.spaceAfterForKeyword")]
594  pub for_statement_space_after_for_keyword: bool,
595  #[serde(rename = "forStatement.spaceAfterSemiColons")]
596  pub for_statement_space_after_semi_colons: bool,
597  #[serde(rename = "forInStatement.spaceAfterForKeyword")]
598  pub for_in_statement_space_after_for_keyword: bool,
599  #[serde(rename = "forOfStatement.spaceAfterForKeyword")]
600  pub for_of_statement_space_after_for_keyword: bool,
601  #[serde(rename = "functionDeclaration.spaceBeforeParentheses")]
602  pub function_declaration_space_before_parentheses: bool,
603  #[serde(rename = "functionExpression.spaceBeforeParentheses")]
604  pub function_expression_space_before_parentheses: bool,
605  #[serde(rename = "functionExpression.spaceAfterFunctionKeyword")]
606  pub function_expression_space_after_function_keyword: bool,
607  #[serde(rename = "getAccessor.spaceBeforeParentheses")]
608  pub get_accessor_space_before_parentheses: bool,
609  #[serde(rename = "ifStatement.spaceAfterIfKeyword")]
610  pub if_statement_space_after_if_keyword: bool,
611  #[serde(rename = "importDeclaration.spaceSurroundingNamedImports")]
612  pub import_declaration_space_surrounding_named_imports: bool,
613  #[serde(rename = "jsxExpressionContainer.spaceSurroundingExpression")]
614  pub jsx_expression_container_space_surrounding_expression: bool,
615  #[serde(rename = "jsxSelfClosingElement.spaceBeforeSlash")]
616  pub jsx_self_closing_element_space_before_slash: bool,
617  #[serde(rename = "method.spaceBeforeParentheses")]
618  pub method_space_before_parentheses: bool,
619  #[serde(rename = "objectExpression.spaceSurroundingProperties")]
620  pub object_expression_space_surrounding_properties: bool,
621  #[serde(rename = "objectPattern.spaceSurroundingProperties")]
622  pub object_pattern_space_surrounding_properties: bool,
623  #[serde(rename = "setAccessor.spaceBeforeParentheses")]
624  pub set_accessor_space_before_parentheses: bool,
625  #[serde(rename = "spaceSurroundingProperties")]
626  pub space_surrounding_properties: bool,
627  #[serde(rename = "taggedTemplate.spaceBeforeLiteral")]
628  pub tagged_template_space_before_literal: bool,
629  #[serde(rename = "typeAnnotation.spaceBeforeColon")]
630  pub type_annotation_space_before_colon: bool,
631  #[serde(rename = "typeAssertion.spaceBeforeExpression")]
632  pub type_assertion_space_before_expression: bool,
633  #[serde(rename = "typeLiteral.spaceSurroundingProperties")]
634  pub type_literal_space_surrounding_properties: bool,
635  #[serde(rename = "whileStatement.spaceAfterWhileKeyword")]
636  pub while_statement_space_after_while_keyword: bool,
637  #[serde(rename = "arguments.spaceAround")]
638  pub arguments_space_around: bool,
639  #[serde(rename = "arrayExpression.spaceAround")]
640  pub array_expression_space_around: bool,
641  #[serde(rename = "arrayPattern.spaceAround")]
642  pub array_pattern_space_around: bool,
643  #[serde(rename = "catchClause.spaceAround")]
644  pub catch_clause_space_around: bool,
645  #[serde(rename = "doWhileStatement.spaceAround")]
646  pub do_while_statement_space_around: bool,
647  #[serde(rename = "forInStatement.spaceAround")]
648  pub for_in_statement_space_around: bool,
649  #[serde(rename = "forOfStatement.spaceAround")]
650  pub for_of_statement_space_around: bool,
651  #[serde(rename = "forStatement.spaceAround")]
652  pub for_statement_space_around: bool,
653  #[serde(rename = "ifStatement.spaceAround")]
654  pub if_statement_space_around: bool,
655  #[serde(rename = "parameters.spaceAround")]
656  pub parameters_space_around: bool,
657  #[serde(rename = "parenExpression.spaceAround")]
658  pub paren_expression_space_around: bool,
659  #[serde(rename = "switchStatement.spaceAround")]
660  pub switch_statement_space_around: bool,
661  #[serde(rename = "tupleType.spaceAround")]
662  pub tuple_type_space_around: bool,
663  #[serde(rename = "whileStatement.spaceAround")]
664  pub while_statement_space_around: bool,
665}