Editorconfig Guide.e

Parentheses in other binary operators

EditorConfig key: dotnet-style-parentheses-in-other-binary-operators

Parentheses in other binary operators

dotnet-style-parentheses-in-other-binary-operators

This option controls whether parentheses should be used to clarify precedence in expressions using binary operators other than arithmetic or relational.

Default value:

always_for_clarity

Possible values:

  • always_for_clarity
  • never_if_unnecessary

Examples

always_for_clarity
var value = a || (b && c);
never_if_unnecessary
var value = a || b && c;