JavaScript - Line Breaks
- Blank lines
- Line breaks
- Wrapping and chopping
- Right margin (columns)
- Prefer wrap before comma
- Wrap chained method calls
- Prefer wrap before "."
- Wrap chained binary expressions
- Prefer wrap before operator in binary expression
- Wrap invocation arguments
- Prefer wrap before "(" in invocation
- Prefer wrap after "(" in invocation
- Wrap formal parameters
- Prefer wrap before "(" in declaration
- Prefer wrap after "(" in declaration
- Wrap object literals
- Wrap array literals
- Wrap "for" statement header
- Wrap ternary expression
- Prefer wrap before "?" and ":" in ternary expressions
- Wrap multiple declaration
- Place on a new line
Blank 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:
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:
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:
Line breaks
Simple embedded statement
Property names:
[resharper_]js_simple_embedded_statement_style
, [resharper_]simple_embedded_statement_style
Possible values:
Examples:
Single-statement function
Property names:
[resharper_]js_single_statement_function_style
, [resharper_]single_statement_function_style
Possible values:
Examples:
Special "else if" treatment
Property names:
[resharper_]js_special_else_if_treatment
, [resharper_]special_else_if_treatment
Possible values:
true | false
Examples:
true |
if·(condition)·{
··foo();
}·else·if·(condition)·{
} |
false |
if·(condition)·{
··foo();
}·else
··if·(condition)·{
··} |
Wrapping and chopping
Right margin (columns)
Property names:
js_max_line_length
, 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:
Wrap chained method calls
Property names:
[resharper_]js_wrap_chained_method_calls
, [resharper_]wrap_chained_method_calls
Possible values:
Examples:
Prefer wrap before "."
Property names:
[resharper_]js_wrap_before_dot
, [resharper_]wrap_before_dot
Possible values:
true | false
Examples:
Wrap chained binary expressions
Property names:
[resharper_]js_wrap_chained_binary_expressions
, [resharper_]wrap_chained_binary_expressions
Possible values:
Examples:
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:
Wrap invocation arguments
Property names:
[resharper_]js_wrap_arguments_style
, [resharper_]wrap_arguments_style
Possible values:
Examples:
Prefer wrap before "(" in invocation
Property names:
[resharper_]js_wrap_before_invocation_lpar
, [resharper_]wrap_before_invocation_lpar
Possible values:
true | false
Examples:
Prefer wrap after "(" in invocation
Property names:
[resharper_]js_wrap_after_invocation_lpar
, [resharper_]wrap_after_invocation_lpar
Possible values:
true | false
Examples:
Wrap formal parameters
Property names:
[resharper_]js_wrap_parameters_style
, [resharper_]wrap_parameters_style
Possible values:
Examples:
Prefer wrap before "(" in declaration
Property names:
[resharper_]js_wrap_before_declaration_lpar
, [resharper_]wrap_before_declaration_lpar
Possible values:
true | false
Examples:
Prefer wrap after "(" in declaration
Property names:
[resharper_]js_wrap_after_declaration_lpar
, [resharper_]wrap_after_declaration_lpar
Possible values:
true | false
Examples:
Wrap object literals
Property names:
[resharper_]js_wrap_object_literals
, [resharper_]wrap_object_literals
Possible values:
Examples:
Wrap array literals
Property names:
[resharper_]js_wrap_array_literals
, [resharper_]wrap_array_literals
Possible values:
Examples:
Wrap "for" statement header
Property names:
[resharper_]js_wrap_for_stmt_header_style
, [resharper_]wrap_for_stmt_header_style
Possible values:
Examples:
Wrap ternary expression
Property names:
[resharper_]js_wrap_ternary_expr_style
, [resharper_]wrap_ternary_expr_style
Possible values:
Examples:
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:
Wrap multiple declaration
Property names:
[resharper_]js_wrap_multiple_declaration_style
, [resharper_]wrap_multiple_declaration_style
Possible values:
Examples:
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 |
if·(condition)·{
··foo();
}
else·{
··foo();
} |
false |
if·(condition)·{
··foo();
}·else·{
··foo();
} |
Place "while" on a new line
Property names:
[resharper_]js_new_line_before_while
, [resharper_]new_line_before_while
Possible values:
true | false
Examples:
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 |
try·{
··foo();
}
catch·(e)·{
··foo();
}·finally·{
} |
false |
try·{
··foo();
}·catch·(e)·{
··foo();
}·finally·{
} |
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 |
try·{
··foo();
}·catch·(e)·{
··foo();
}
finally·{
} |
false |
try·{
··foo();
}·catch·(e)·{
··foo();
}·finally·{
} |
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