case-style-ternaries
: format nested ternaries in case style
#272
Labels
enhancement
New feature or request
case-style-ternaries
: format nested ternaries in case style
#272
Clear and concise description of the problem
I find that nested ternaries are very difficult to read, even with the
multiline-ternary
rule enabled.Example:
Suggested solution
In their article, Prettier suggests to format the code above would be formatted as follows:
I find it more clear and readable.
This feature could be implemented with a new rule.
I think this is a stylistic issue in some point of view, but I am not sure this is a stylistic issue in the point of view of eslint-stylistic, so this issue is maybe out of concern...
Alternative
flatTernaryExpressions: true,
option onindent
can result to something similar, but does not refacto the logic. In fact,flatTernaryExpressions: true
should be used with this rule to get the wanted result.Validations
Contributes
The text was updated successfully, but these errors were encountered: