JavaScript - Line Breaks
Last modified: 21 July 2022Blank lines
Max blank lines in code
Property names:
[resharper_]js_keep_blank_lines_in_code
, [resharper_]keep_blank_lines_in_code
Possible values:
an integer
Examples:
Before formatting | After formatting, value: 0 |
---|---|
|
|
Before formatting | After formatting, value: 1 |
---|---|
|
|
Before formatting | After formatting, value: 2 |
---|---|
|
|
Max blank lines between declarations
Property names:
[resharper_]js_keep_blank_lines_between_declarations
, [resharper_]keep_blank_lines_between_declarations
Possible values:
an integer
Examples:
Before formatting | After formatting, value: 0 |
---|---|
|
|
Before formatting | After formatting, value: 1 |
---|---|
|
|
Before formatting | After formatting, value: 2 |
---|---|
|
|
Min blank lines after imports
Property names:
[resharper_]js_min_blank_lines_after_imports
, [resharper_]min_blank_lines_after_imports
Possible values:
an integer
Examples:
Before formatting | After formatting, value: 0 |
---|---|
|
|
Before formatting | After formatting, value: 1 |
---|---|
|
|
Before formatting | After formatting, value: 2 |
---|---|
|
|
Min blank lines around functions
Property names:
[resharper_]js_min_blank_lines_around_functions
, [resharper_]min_blank_lines_around_functions
Possible values:
an integer
Examples:
Before formatting | After formatting, value: 0 |
---|---|
|
|
Before formatting | After formatting, value: 1 |
---|---|
|
|
Before formatting | After formatting, value: 2 |
---|---|
|
|
Line breaks
Simple embedded statement
Property names:
[resharper_]js_simple_embedded_statement_style
, [resharper_]simple_embedded_statement_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
Before formatting | After formatting, do_not_change |
---|---|
|
|
Before formatting | After formatting, on_single_line |
---|---|
|
|
Before formatting | After formatting, line_break |
---|---|
|
|
Single-statement function
Property names:
[resharper_]js_single_statement_function_style
, [resharper_]single_statement_function_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
Before formatting | After formatting, do_not_change |
---|---|
|
|
Before formatting | After formatting, on_single_line |
---|---|
|
|
Before formatting | After formatting, line_break |
---|---|
|
|
Special "else if" treatment
Property names:
[resharper_]js_special_else_if_treatment
, [resharper_]special_else_if_treatment
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Wrapping and chopping
Hard wrap at
Property names:
max_line_length
, [resharper_]js_max_line_length
Possible values:
an integer
Prefer wrap before comma
Property names:
[resharper_]js_wrap_before_comma
, [resharper_]wrap_before_comma
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Wrap chained method calls
Property names:
[resharper_]js_wrap_chained_method_calls
, [resharper_]wrap_chained_method_calls
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Prefer wrap before "."
Property names:
[resharper_]js_wrap_before_dot
, [resharper_]wrap_before_dot
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Wrap chained binary expressions
Property names:
[resharper_]js_wrap_chained_binary_expressions
, [resharper_]wrap_chained_binary_expressions
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multiline
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Prefer wrap before operator in binary expression
Property names:
[resharper_]js_wrap_before_binary_opsign
, [resharper_]wrap_before_binary_opsign
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Wrap invocation arguments
Property names:
[resharper_]js_wrap_arguments_style
, [resharper_]wrap_arguments_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Prefer wrap before "(" in invocation
Property names:
[resharper_]js_wrap_before_invocation_lpar
, [resharper_]wrap_before_invocation_lpar
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Prefer wrap after "(" in invocation
Property names:
[resharper_]js_wrap_after_invocation_lpar
, [resharper_]wrap_after_invocation_lpar
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Wrap formal parameters
Property names:
[resharper_]js_wrap_parameters_style
, [resharper_]wrap_parameters_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Prefer wrap before "(" in declaration
Property names:
[resharper_]js_wrap_before_declaration_lpar
, [resharper_]wrap_before_declaration_lpar
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Prefer wrap after "(" in declaration
Property names:
[resharper_]js_wrap_after_declaration_lpar
, [resharper_]wrap_after_declaration_lpar
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Wrap object literals
Property names:
[resharper_]js_wrap_object_literals
, [resharper_]wrap_object_literals
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Wrap array literals
Property names:
[resharper_]js_wrap_array_literals
, [resharper_]wrap_array_literals
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Wrap import declaration
Property names:
[resharper_]js_wrap_imports
, [resharper_]wrap_imports
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Wrap "for" statement header
Property names:
[resharper_]js_wrap_for_stmt_header_style
, [resharper_]wrap_for_stmt_header_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Wrap ternary expression
Property names:
[resharper_]js_wrap_ternary_expr_style
, [resharper_]wrap_ternary_expr_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Prefer wrap before "?" and ":" in ternary expressions
Property names:
[resharper_]js_wrap_before_ternary_opsigns
, [resharper_]wrap_before_ternary_opsigns
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Wrap multiple declaration
Property names:
[resharper_]js_wrap_multiple_declaration_style
, [resharper_]wrap_multiple_declaration_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
Before formatting | After formatting, wrap_if_long |
---|---|
|
|
Before formatting | After formatting, chop_if_long |
---|---|
|
|
Before formatting | After formatting, chop_always |
---|---|
|
|
Place on a new line
Place "else" on a new line
Property names:
[resharper_]js_new_line_before_else
, [resharper_]new_line_before_else
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place "while" on a new line
Property names:
[resharper_]js_new_line_before_while
, [resharper_]new_line_before_while
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place "catch" on a new line
Property names:
[resharper_]js_new_line_before_catch
, [resharper_]new_line_before_catch
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place "finally" on a new line
Property names:
[resharper_]js_new_line_before_finally
, [resharper_]new_line_before_finally
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place template literal arguments on a new line
Property names:
[resharper_]js_place_template_args_on_new_line
, [resharper_]place_template_args_on_new_line
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|