If you have an interpolated string where the value depends on an inline ternary operator, parentheses are needed so the full string itself is not terminated with ", as described in this answer, e.g.
var example = $"My example is {(someBoolean ? "true string" : "false string")}";
Unfortunately, with my team's current ReSharper formatting options, using 'Reformat Code', shortcut CTRL+ALT+ENTER, these parentheses are removed, leaving you with:
var example = $"My example is {someBoolean ? "true string" : "false string"}";
and the error A conditional expression cannot be used directly in a string interpolation because the ':' ends the interpolation. Parenthesize the conditional expression.
.
Q: does anyone know which setting in ReSharper I can change to prevent this?
I tried 'Removed remove redundant parentheses' under Code Cleanup this did not work.