pub struct ConfigurationBuilder { /* private fields */ }
Expand description
TypeScript formatting configuration builder.
§Example
use dprint_plugin_typescript::configuration::*;
let config = ConfigurationBuilder::new()
.line_width(80)
.prefer_hanging(true)
.prefer_single_line(false)
.quote_style(QuoteStyle::PreferSingle)
.next_control_flow_position(NextControlFlowPosition::SameLine)
.build();
Implementations§
Source§impl ConfigurationBuilder
impl ConfigurationBuilder
Sourcepub fn new() -> ConfigurationBuilder
pub fn new() -> ConfigurationBuilder
Constructs a new configuration builder.
Sourcepub fn build(&self) -> Configuration
pub fn build(&self) -> Configuration
Gets the final configuration that can be used to format a file.
Sourcepub fn global_config(&mut self, global_config: GlobalConfiguration) -> &mut Self
pub fn global_config(&mut self, global_config: GlobalConfiguration) -> &mut Self
Set the global configuration.
Sourcepub fn deno(&mut self) -> &mut Self
pub fn deno(&mut self) -> &mut Self
Helper method to set the configuration to what’s used for Deno.
Sourcepub fn line_width(&mut self, value: u32) -> &mut Self
pub fn line_width(&mut self, value: u32) -> &mut Self
The width of a line the printer will try to stay under. Note that the printer may exceed this width in certain cases.
Default: 120
Sourcepub fn use_tabs(&mut self, value: bool) -> &mut Self
pub fn use_tabs(&mut self, value: bool) -> &mut Self
Whether to use tabs (true) or spaces (false).
Default: false
Sourcepub fn indent_width(&mut self, value: u8) -> &mut Self
pub fn indent_width(&mut self, value: u8) -> &mut Self
The number of columns for an indent.
Default: 4
Sourcepub fn new_line_kind(&mut self, value: NewLineKind) -> &mut Self
pub fn new_line_kind(&mut self, value: NewLineKind) -> &mut Self
The kind of newline to use.
Default: NewLineKind::LineFeed
Sourcepub fn quote_style(&mut self, value: QuoteStyle) -> &mut Self
pub fn quote_style(&mut self, value: QuoteStyle) -> &mut Self
The quote style to use.
Default: QuoteStyle::AlwaysDouble
Sourcepub fn jsx_quote_style(&mut self, value: JsxQuoteStyle) -> &mut Self
pub fn jsx_quote_style(&mut self, value: JsxQuoteStyle) -> &mut Self
The JSX quote style to use for string literals in JSX attributes.
Default: JsxQuoteStyle::PreferDouble
Sourcepub fn jsx_multi_line_parens(&mut self, value: JsxMultiLineParens) -> &mut Self
pub fn jsx_multi_line_parens(&mut self, value: JsxMultiLineParens) -> &mut Self
Whether to surround a JSX element or fragment with parentheses when it’s the top JSX node and it spans multiple lines.
Default: JsxMultiLineParens::Prefer
Sourcepub fn jsx_force_new_lines_surrounding_content(
&mut self,
value: bool,
) -> &mut Self
pub fn jsx_force_new_lines_surrounding_content( &mut self, value: bool, ) -> &mut Self
Forces newlines surrounding the content of JSX elements.
Default: false
Sourcepub fn jsx_bracket_position(
&mut self,
value: SameOrNextLinePosition,
) -> &mut Self
pub fn jsx_bracket_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
If the end angle bracket of a jsx opening element or self closing element should be on the same or next line when the attributes span multiple lines.
Default: nextLine
Sourcepub fn jsx_opening_element_bracket_position(
&mut self,
value: SameOrNextLinePosition,
) -> &mut Self
pub fn jsx_opening_element_bracket_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
If the end angle bracket of a jsx opening element should be on the same or next line when the attributes span multiple lines.
Default: nextLine
Sourcepub fn jsx_self_closing_element_bracket_position(
&mut self,
value: SameOrNextLinePosition,
) -> &mut Self
pub fn jsx_self_closing_element_bracket_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
If the end angle bracket of a jsx self closing element should be on the same or next line when the attributes span multiple lines.
Default: nextLine
Sourcepub fn semi_colons(&mut self, value: SemiColons) -> &mut Self
pub fn semi_colons(&mut self, value: SemiColons) -> &mut Self
Whether statements should end in a semi-colon.
Default: SemiColons::Prefer
Sourcepub fn prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn prefer_hanging(&mut self, value: bool) -> &mut Self
Set to prefer hanging indentation when exceeding the line width.
Default: false
Sourcepub fn quote_props(&mut self, value: QuoteProps) -> &mut Self
pub fn quote_props(&mut self, value: QuoteProps) -> &mut Self
Behaviour to use for quotes on property names.
Default: preserve
Sourcepub fn brace_position(&mut self, value: BracePosition) -> &mut Self
pub fn brace_position(&mut self, value: BracePosition) -> &mut Self
Where to place the opening brace.
Default: BracePosition::SameLineUnlessHanging
Sourcepub fn next_control_flow_position(
&mut self,
value: NextControlFlowPosition,
) -> &mut Self
pub fn next_control_flow_position( &mut self, value: NextControlFlowPosition, ) -> &mut Self
Where to place the next control flow within a control flow statement.
Default: NextControlFlowPosition::NextLine
Sourcepub fn operator_position(&mut self, value: OperatorPosition) -> &mut Self
pub fn operator_position(&mut self, value: OperatorPosition) -> &mut Self
Where to place the operator for expressions that span multiple lines.
Default: OperatorPosition::NextLine
Sourcepub fn single_body_position(
&mut self,
value: SameOrNextLinePosition,
) -> &mut Self
pub fn single_body_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
Where to place the expression of a statement that could possibly be on one line (ex. if (true) console.log(5);
).
Default: SingleBodyPosition::Maintain
Sourcepub fn trailing_commas(&mut self, value: TrailingCommas) -> &mut Self
pub fn trailing_commas(&mut self, value: TrailingCommas) -> &mut Self
If trailing commas should be used.
Default: TrailingCommas::OnlyMultiLine
Sourcepub fn use_braces(&mut self, value: UseBraces) -> &mut Self
pub fn use_braces(&mut self, value: UseBraces) -> &mut Self
If braces should be used or not.
Default: UseBraces::WhenNotSingleLine
Sourcepub fn prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn prefer_single_line(&mut self, value: bool) -> &mut Self
If code should revert back from being on multiple lines to being on a single line when able.
Default: false
Sourcepub fn binary_expression_space_surrounding_bitwise_and_arithmetic_operator(
&mut self,
value: bool,
) -> &mut Self
pub fn binary_expression_space_surrounding_bitwise_and_arithmetic_operator( &mut self, value: bool, ) -> &mut Self
Whether to surround bitwise and arithmetic operators in a binary expression with spaces.
true
(default) - Ex.1 + 2
false
- Ex.1+2
Sourcepub fn comment_line_force_space_after_slashes(
&mut self,
value: bool,
) -> &mut Self
pub fn comment_line_force_space_after_slashes( &mut self, value: bool, ) -> &mut Self
Forces a space after the double slash in a comment line.
true
(default) - Ex. //test
-> // test
false
- Ex. //test
-> //test
Sourcepub fn construct_signature_space_after_new_keyword(
&mut self,
value: bool,
) -> &mut Self
pub fn construct_signature_space_after_new_keyword( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the new
keyword in a construct signature.
true
- Ex. new (): MyClass;
false
(default) - Ex. new(): MyClass;
Sourcepub fn constructor_space_before_parentheses(&mut self, value: bool) -> &mut Self
pub fn constructor_space_before_parentheses(&mut self, value: bool) -> &mut Self
Whether to add a space before the parentheses of a constructor.
true
- Ex. constructor ()
false
(false) - Ex. constructor()
Sourcepub fn constructor_type_space_after_new_keyword(
&mut self,
value: bool,
) -> &mut Self
pub fn constructor_type_space_after_new_keyword( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the new
keyword in a constructor type.
true
- Ex. type MyClassCtor = new () => MyClass;
false
(default) - Ex. type MyClassCtor = new() => MyClass;
Sourcepub fn do_while_statement_space_after_while_keyword(
&mut self,
value: bool,
) -> &mut Self
pub fn do_while_statement_space_after_while_keyword( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the while
keyword in a do while statement.
true
(true) - Ex. do {\n} while (condition);
false
- Ex. do {\n} while(condition);
Sourcepub fn export_declaration_space_surrounding_named_exports(
&mut self,
value: bool,
) -> &mut Self
pub fn export_declaration_space_surrounding_named_exports( &mut self, value: bool, ) -> &mut Self
Whether to add spaces around named exports in an export declaration.
true
(default) - Ex.export { SomeExport, OtherExport };
false
- Ex.export {SomeExport, OtherExport};
Sourcepub fn for_statement_space_after_for_keyword(
&mut self,
value: bool,
) -> &mut Self
pub fn for_statement_space_after_for_keyword( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the for
keyword in a “for” statement.
true
(default) - Ex.for (let i = 0; i < 5; i++)
false
- Ex.for(let i = 0; i < 5; i++)
Sourcepub fn for_statement_space_after_semi_colons(
&mut self,
value: bool,
) -> &mut Self
pub fn for_statement_space_after_semi_colons( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the semi-colons in a “for” statement.
true
(default) - Ex.for (let i = 0; i < 5; i++)
false
- Ex.for (let i = 0;i < 5;i++)
Sourcepub fn for_in_statement_space_after_for_keyword(
&mut self,
value: bool,
) -> &mut Self
pub fn for_in_statement_space_after_for_keyword( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the for
keyword in a “for in” statement.
true
(default) - Ex.for (const prop in obj)
false
- Ex.for(const prop in obj)
Sourcepub fn for_of_statement_space_after_for_keyword(
&mut self,
value: bool,
) -> &mut Self
pub fn for_of_statement_space_after_for_keyword( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the for
keyword in a “for of” statement.
true
(default) - Ex.for (const value of myArray)
false
- Ex.for(const value of myArray)
Sourcepub fn function_declaration_space_before_parentheses(
&mut self,
value: bool,
) -> &mut Self
pub fn function_declaration_space_before_parentheses( &mut self, value: bool, ) -> &mut Self
Whether to add a space before the parentheses of a function declaration.
true
- Ex.function myFunction ()
false
(default) - Ex.function myFunction()
Sourcepub fn function_expression_space_before_parentheses(
&mut self,
value: bool,
) -> &mut Self
pub fn function_expression_space_before_parentheses( &mut self, value: bool, ) -> &mut Self
Whether to add a space before the parentheses of a function expression.
true
- Ex. function<T> ()
false
(default) - Ex. function<T> ()
Sourcepub fn function_expression_space_after_function_keyword(
&mut self,
value: bool,
) -> &mut Self
pub fn function_expression_space_after_function_keyword( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the function keyword of a function expression.
true
- Ex. function <T>()
.
false
(default) - Ex. function<T>()
Sourcepub fn get_accessor_space_before_parentheses(
&mut self,
value: bool,
) -> &mut Self
pub fn get_accessor_space_before_parentheses( &mut self, value: bool, ) -> &mut Self
Whether to add a space before the parentheses of a get accessor.
true
- Ex. get myProp ()
false
(false) - Ex. get myProp()
Sourcepub fn if_statement_space_after_if_keyword(&mut self, value: bool) -> &mut Self
pub fn if_statement_space_after_if_keyword(&mut self, value: bool) -> &mut Self
Whether to add a space after the if
keyword in an “if” statement.
true
(default) - Ex. if (true)
false
- Ex. if(true)
Sourcepub fn import_declaration_space_surrounding_named_imports(
&mut self,
value: bool,
) -> &mut Self
pub fn import_declaration_space_surrounding_named_imports( &mut self, value: bool, ) -> &mut Self
Whether to add spaces around named imports in an import declaration.
true
(default) - Ex.import { SomeExport, OtherExport } from "my-module";
false
- Ex.import {SomeExport, OtherExport} from "my-module";
Sourcepub fn jsx_expression_container_space_surrounding_expression(
&mut self,
value: bool,
) -> &mut Self
pub fn jsx_expression_container_space_surrounding_expression( &mut self, value: bool, ) -> &mut Self
Whether to add a space surrounding the expression of a JSX container.
true
- Ex.{ myValue }
false
(default) - Ex.{myValue}
Sourcepub fn jsx_self_closing_element_space_before_slash(
&mut self,
value: bool,
) -> &mut Self
pub fn jsx_self_closing_element_space_before_slash( &mut self, value: bool, ) -> &mut Self
Whether to add a space before the slash in a self closing tag for a JSX element.
true
(default) - Ex.<Test />
false
- Ex.<Test/>
Sourcepub fn object_expression_space_surrounding_properties(
&mut self,
value: bool,
) -> &mut Self
pub fn object_expression_space_surrounding_properties( &mut self, value: bool, ) -> &mut Self
Whether to add a space surrounding the properties of an object expression.
true
(default) - Ex.{ key: value }
false
- Ex.{key: value}
Sourcepub fn object_pattern_space_surrounding_properties(
&mut self,
value: bool,
) -> &mut Self
pub fn object_pattern_space_surrounding_properties( &mut self, value: bool, ) -> &mut Self
Whether to add a space surrounding the properties of an object pattern.
true
(default) - Ex.{ key: value } = obj
false
- Ex.{key: value} = obj
Sourcepub fn method_space_before_parentheses(&mut self, value: bool) -> &mut Self
pub fn method_space_before_parentheses(&mut self, value: bool) -> &mut Self
Whether to add a space before the parentheses of a method.
true
- Ex. myMethod ()
false
- Ex. myMethod()
Sourcepub fn set_accessor_space_before_parentheses(
&mut self,
value: bool,
) -> &mut Self
pub fn set_accessor_space_before_parentheses( &mut self, value: bool, ) -> &mut Self
Whether to add a space before the parentheses of a set accessor.
true
- Ex. set myProp (value: string)
false
(default) - Ex. set myProp(value: string)
Sourcepub fn space_surrounding_properties(&mut self, value: bool) -> &mut Self
pub fn space_surrounding_properties(&mut self, value: bool) -> &mut Self
Whether to add a space surrounding the properties of object-like nodes.
true
(default) - Ex.{ key: value }
false
- Ex.{key: value}
Sourcepub fn tagged_template_space_before_literal(&mut self, value: bool) -> &mut Self
pub fn tagged_template_space_before_literal(&mut self, value: bool) -> &mut Self
Whether to add a space before the literal in a tagged template.
true
(default) - Ex.html \
`` false
- Ex.html\
``
Sourcepub fn type_annotation_space_before_colon(&mut self, value: bool) -> &mut Self
pub fn type_annotation_space_before_colon(&mut self, value: bool) -> &mut Self
Whether to add a space before the colon of a type annotation.
true
- Ex.function myFunction() : string
false
(default) - Ex.function myFunction(): string
Sourcepub fn type_assertion_space_before_expression(
&mut self,
value: bool,
) -> &mut Self
pub fn type_assertion_space_before_expression( &mut self, value: bool, ) -> &mut Self
Whether to add a space before the expression in a type assertion.
true
(default) - Ex.<string> myValue
false
- Ex.<string>myValue
Sourcepub fn type_literal_space_surrounding_properties(
&mut self,
value: bool,
) -> &mut Self
pub fn type_literal_space_surrounding_properties( &mut self, value: bool, ) -> &mut Self
Whether to add a space surrounding the properties of a type literal.
true
(default) - Ex.value: { key: Type }
false
- Ex.value: {key: Type}
Sourcepub fn while_statement_space_after_while_keyword(
&mut self,
value: bool,
) -> &mut Self
pub fn while_statement_space_after_while_keyword( &mut self, value: bool, ) -> &mut Self
Whether to add a space after the while
keyword in a while statement.
true
(default) - Ex.while (true)
false
- Ex.while(true)
Sourcepub fn space_around(&mut self, value: bool) -> &mut Self
pub fn space_around(&mut self, value: bool) -> &mut Self
Whether to place spaces around enclosed expressions.
true
- Ex.myFunction( true )
false
(default) - Ex.myFunction(true)
Sourcepub fn arrow_function_use_parentheses(
&mut self,
value: UseParentheses,
) -> &mut Self
pub fn arrow_function_use_parentheses( &mut self, value: UseParentheses, ) -> &mut Self
Whether to use parentheses for arrow functions.
Default: UseParentheses::Maintain
Sourcepub fn binary_expression_line_per_expression(
&mut self,
value: bool,
) -> &mut Self
pub fn binary_expression_line_per_expression( &mut self, value: bool, ) -> &mut Self
Whether to force a line per expression when spanning multiple lines.
true
- Formats with each part on a new line.false
(default) - Maintains the line breaks as written by the programmer.
Sourcepub fn conditional_expression_line_per_expression(
&mut self,
value: bool,
) -> &mut Self
pub fn conditional_expression_line_per_expression( &mut self, value: bool, ) -> &mut Self
Whether to force a line per expression when spanning multiple lines.
true
- Formats with each part on a new line.false
(default) - Maintains the line breaks as written by the programmer.
Sourcepub fn member_expression_line_per_expression(
&mut self,
value: bool,
) -> &mut Self
pub fn member_expression_line_per_expression( &mut self, value: bool, ) -> &mut Self
Whether to force a line per expression when spanning multiple lines.
true
- Formats with each part on a new line.false
(default) - Maintains the line breaks as written by the programmer.
Sourcepub fn type_literal_separator_kind(
&mut self,
value: SemiColonOrComma,
) -> &mut Self
pub fn type_literal_separator_kind( &mut self, value: SemiColonOrComma, ) -> &mut Self
The kind of separator to use in type literals.
Sourcepub fn type_literal_separator_kind_single_line(
&mut self,
value: SemiColonOrComma,
) -> &mut Self
pub fn type_literal_separator_kind_single_line( &mut self, value: SemiColonOrComma, ) -> &mut Self
The kind of separator to use in type literals when single line.
Sourcepub fn type_literal_separator_kind_multi_line(
&mut self,
value: SemiColonOrComma,
) -> &mut Self
pub fn type_literal_separator_kind_multi_line( &mut self, value: SemiColonOrComma, ) -> &mut Self
The kind of separator to use in type literals when multi-line.
Sourcepub fn module_sort_import_declarations(&mut self, value: SortOrder) -> &mut Self
pub fn module_sort_import_declarations(&mut self, value: SortOrder) -> &mut Self
Alphabetically sorts the import declarations based on their module specifiers.
Default: Case insensitive
Sourcepub fn module_sort_export_declarations(&mut self, value: SortOrder) -> &mut Self
pub fn module_sort_export_declarations(&mut self, value: SortOrder) -> &mut Self
Alphabetically sorts the export declarations based on their module specifiers.
Default: Case insensitive
Sourcepub fn import_declaration_sort_named_imports(
&mut self,
value: SortOrder,
) -> &mut Self
pub fn import_declaration_sort_named_imports( &mut self, value: SortOrder, ) -> &mut Self
Alphabetically sorts the import declaration’s named imports.
Default: Case insensitive
Sourcepub fn import_declaration_sort_type_only_imports(
&mut self,
value: NamedTypeImportsExportsOrder,
) -> &mut Self
pub fn import_declaration_sort_type_only_imports( &mut self, value: NamedTypeImportsExportsOrder, ) -> &mut Self
Sorts type-only named imports first, last, or none (no sorting).
Default: Last
Sourcepub fn export_declaration_sort_named_exports(
&mut self,
value: SortOrder,
) -> &mut Self
pub fn export_declaration_sort_named_exports( &mut self, value: SortOrder, ) -> &mut Self
Alphabetically sorts the export declaration’s named exports.
Default: Case insensitive
Sourcepub fn export_declaration_sort_type_only_exports(
&mut self,
value: NamedTypeImportsExportsOrder,
) -> &mut Self
pub fn export_declaration_sort_type_only_exports( &mut self, value: NamedTypeImportsExportsOrder, ) -> &mut Self
Sorts type-only named exports first, last, or none (no sorting).
Default: Last
Sourcepub fn ignore_node_comment_text(&mut self, value: &str) -> &mut Self
pub fn ignore_node_comment_text(&mut self, value: &str) -> &mut Self
The text to use for an ignore comment (ex. // dprint-ignore
).
Default: "dprint-ignore"
Sourcepub fn ignore_file_comment_text(&mut self, value: &str) -> &mut Self
pub fn ignore_file_comment_text(&mut self, value: &str) -> &mut Self
The text to use for a file ignore comment (ex. // dprint-ignore-file
).
Default: "dprint-ignore-file"
pub fn arrow_function_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn class_declaration_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn class_expression_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn constructor_brace_position(&mut self, value: BracePosition) -> &mut Self
pub fn do_while_statement_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn enum_declaration_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn for_statement_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn for_in_statement_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn for_of_statement_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn get_accessor_brace_position(&mut self, value: BracePosition) -> &mut Self
pub fn if_statement_brace_position(&mut self, value: BracePosition) -> &mut Self
pub fn interface_declaration_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn function_declaration_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn function_expression_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn method_brace_position(&mut self, value: BracePosition) -> &mut Self
pub fn module_declaration_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn set_accessor_brace_position(&mut self, value: BracePosition) -> &mut Self
pub fn static_block_brace_position(&mut self, value: BracePosition) -> &mut Self
pub fn switch_case_brace_position(&mut self, value: BracePosition) -> &mut Self
pub fn switch_statement_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn try_statement_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn while_statement_brace_position( &mut self, value: BracePosition, ) -> &mut Self
pub fn arguments_prefer_hanging(&mut self, value: PreferHanging) -> &mut Self
pub fn array_expression_prefer_hanging( &mut self, value: PreferHanging, ) -> &mut Self
pub fn array_pattern_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn do_while_statement_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn export_declaration_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn extends_clause_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn for_in_statement_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn for_of_statement_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn for_statement_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn if_statement_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn implements_clause_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn import_declaration_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn jsx_attributes_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn object_expression_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn object_pattern_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn parameters_prefer_hanging(&mut self, value: PreferHanging) -> &mut Self
pub fn sequence_expression_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn switch_statement_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn tuple_type_prefer_hanging(&mut self, value: PreferHanging) -> &mut Self
pub fn type_literal_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn type_parameters_prefer_hanging( &mut self, value: PreferHanging, ) -> &mut Self
pub fn union_and_intersection_type_prefer_hanging( &mut self, value: bool, ) -> &mut Self
pub fn variable_statement_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn while_statement_prefer_hanging(&mut self, value: bool) -> &mut Self
pub fn export_declaration_force_single_line(&mut self, value: bool) -> &mut Self
pub fn import_declaration_force_single_line(&mut self, value: bool) -> &mut Self
pub fn export_declaration_force_multi_line( &mut self, value: ForceMultiLine, ) -> &mut Self
pub fn import_declaration_force_multi_line( &mut self, value: ForceMultiLine, ) -> &mut Self
pub fn enum_declaration_member_spacing( &mut self, value: MemberSpacing, ) -> &mut Self
pub fn if_statement_next_control_flow_position( &mut self, value: NextControlFlowPosition, ) -> &mut Self
pub fn try_statement_next_control_flow_position( &mut self, value: NextControlFlowPosition, ) -> &mut Self
pub fn do_while_statement_next_control_flow_position( &mut self, value: NextControlFlowPosition, ) -> &mut Self
pub fn binary_expression_operator_position( &mut self, value: OperatorPosition, ) -> &mut Self
pub fn conditional_expression_operator_position( &mut self, value: OperatorPosition, ) -> &mut Self
pub fn conditional_type_operator_position( &mut self, value: OperatorPosition, ) -> &mut Self
pub fn if_statement_single_body_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
pub fn for_statement_single_body_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
pub fn for_in_statement_single_body_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
pub fn for_of_statement_single_body_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
pub fn while_statement_single_body_position( &mut self, value: SameOrNextLinePosition, ) -> &mut Self
pub fn arguments_trailing_commas(&mut self, value: TrailingCommas) -> &mut Self
pub fn parameters_trailing_commas(&mut self, value: TrailingCommas) -> &mut Self
pub fn array_expression_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
pub fn array_pattern_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
pub fn enum_declaration_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
pub fn export_declaration_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
pub fn import_declaration_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
pub fn object_expression_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
pub fn object_pattern_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
pub fn tuple_type_trailing_commas(&mut self, value: TrailingCommas) -> &mut Self
Sourcepub fn type_literal_trailing_commas(
&mut self,
value: TrailingCommas,
) -> &mut Self
pub fn type_literal_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
Only applies when using commas on type literals.
pub fn type_parameters_trailing_commas( &mut self, value: TrailingCommas, ) -> &mut Self
pub fn if_statement_use_braces(&mut self, value: UseBraces) -> &mut Self
pub fn for_statement_use_braces(&mut self, value: UseBraces) -> &mut Self
pub fn for_in_statement_use_braces(&mut self, value: UseBraces) -> &mut Self
pub fn for_of_statement_use_braces(&mut self, value: UseBraces) -> &mut Self
pub fn while_statement_use_braces(&mut self, value: UseBraces) -> &mut Self
pub fn array_expression_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn array_pattern_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn arguments_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn binary_expression_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn computed_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn conditional_expression_prefer_single_line( &mut self, value: bool, ) -> &mut Self
pub fn conditional_type_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn decorators_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn export_declaration_prefer_single_line( &mut self, value: bool, ) -> &mut Self
pub fn for_statement_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn import_declaration_prefer_single_line( &mut self, value: bool, ) -> &mut Self
pub fn jsx_attributes_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn jsx_element_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn mapped_type_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn member_expression_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn object_expression_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn object_pattern_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn parameters_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn parentheses_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn tuple_type_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn type_literal_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn type_parameters_prefer_single_line(&mut self, value: bool) -> &mut Self
pub fn union_and_intersection_type_prefer_single_line( &mut self, value: bool, ) -> &mut Self
pub fn variable_statement_prefer_single_line( &mut self, value: bool, ) -> &mut Self
pub fn arguments_space_around(&mut self, value: bool) -> &mut Self
pub fn array_expression_space_around(&mut self, value: bool) -> &mut Self
pub fn array_pattern_space_around(&mut self, value: bool) -> &mut Self
pub fn catch_clause_space_around(&mut self, value: bool) -> &mut Self
pub fn do_while_statement_space_around(&mut self, value: bool) -> &mut Self
pub fn for_in_statement_space_around(&mut self, value: bool) -> &mut Self
pub fn for_of_statement_space_around(&mut self, value: bool) -> &mut Self
pub fn for_statement_space_around(&mut self, value: bool) -> &mut Self
pub fn if_statement_space_around(&mut self, value: bool) -> &mut Self
pub fn parameters_space_around(&mut self, value: bool) -> &mut Self
pub fn paren_expression_space_around(&mut self, value: bool) -> &mut Self
pub fn switch_statement_space_around(&mut self, value: bool) -> &mut Self
pub fn tuple_type_space_around(&mut self, value: bool) -> &mut Self
pub fn while_statement_space_around(&mut self, value: bool) -> &mut Self
Trait Implementations§
Source§impl Default for ConfigurationBuilder
impl Default for ConfigurationBuilder
Source§fn default() -> ConfigurationBuilder
fn default() -> ConfigurationBuilder
Auto Trait Implementations§
impl Freeze for ConfigurationBuilder
impl RefUnwindSafe for ConfigurationBuilder
impl Send for ConfigurationBuilder
impl Sync for ConfigurationBuilder
impl Unpin for ConfigurationBuilder
impl UnwindSafe for ConfigurationBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more