We already have special formatting for || patterns in a switch expression to make them look sort of like a series of fallthrough cases in a switch statement. Given that, I think it makes sense to also tweak the splitting costs so that it prefers to split on the || instead of in the case expression. That way, you get:
Currently, the formatter formats the following switch expression case like so:
We already have special formatting for
||
patterns in a switch expression to make them look sort of like a series of fallthrough cases in a switch statement. Given that, I think it makes sense to also tweak the splitting costs so that it prefers to split on the||
instead of in the case expression. That way, you get: