New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Add "always-multiline" option to "multiline-ternary" rule #8770
Comments
Seems reasonable to me! 👍 |
I'm going to start working on a PR for this. |
@nwoltman Feel free to make a PR (it's easier to discuss when we the work is done!), but just know that we need a champion from and the team and 3 other team members to 👍 before the issue is accepted. @eslint/eslint-team Anyone else interested in supporting this, since @nwoltman is willing to make a PR? |
I'll champion. Just need one more 👍 to accept. |
What rule do you want to change?
multiline-ternary
Does this change cause the rule to produce more or fewer warnings?
n/a
How will the change be implemented? (New option, new default behavior, etc.)?
new option (
always-multiline
)Please provide some example code that this change will affect:
What does the rule currently do for this code?
never
1 - nothing (already correct)
2 - requires the second line to be moved onto the end of the first line
always
1 - requires
value1
andvalue2
to each be moved onto their own line2 - requires
value2
to be moved onto the next lineWhat will the rule do after it's changed?
always-multiline
1 - nothing (already correct)
2 - requires
value2
to be moved onto the next linealways-multiline
is the same asalways
except it allows ternary expressions to be on a single line(so the
always
functionality is enforced only if there is a newline somewhere within the ternary expression).The text was updated successfully, but these errors were encountered: