no-nested-ternaries
can cause difficult to understand code
#1811
Labels
no-nested-ternaries
can cause difficult to understand code
#1811
The rule states that "Nesting ternary expressions can make code more difficult to understand." However, by enabling the rule engineers often have to create and nae intermediate variables which can also make the code more difficult to understand.
A real world example:
I'd argue that in this case both the variable names and also having to move conditional logic further away from where it is executed make the code more inscrutable.
My recommendation would be disabling the
no-nested-ternary
rule in the short term and enabling the rule to be a bit more lenient in the long term. Happy to put in a PR if that's the consensus of the maintainers too.The text was updated successfully, but these errors were encountered: