Skip to content
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

Closed
nwoltman opened this issue Jun 21, 2017 · 4 comments · Fixed by homezen/eslint-config-homezen#43
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules

Comments

@nwoltman
Copy link
Contributor

nwoltman commented Jun 21, 2017

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:

// 1
var foo = bar > baz ? value1 : value2;

// 2
var foo = bar > baz ?
    value1 : value2;

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 and value2 to each be moved onto their own line
2 - requires value2 to be moved onto the next line

What will the rule do after it's changed?

always-multiline

1 - nothing (already correct)
2 - requires value2 to be moved onto the next line

always-multiline is the same as always 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).

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jun 21, 2017
@kaicataldo kaicataldo added enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jun 21, 2017
@kaicataldo
Copy link
Member

Seems reasonable to me! 👍

@nwoltman
Copy link
Contributor Author

I'm going to start working on a PR for this.

@kaicataldo
Copy link
Member

@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?

@platinumazure platinumazure self-assigned this Jun 27, 2017
@platinumazure
Copy link
Member

I'll champion. Just need one more 👍 to accept.

@ilyavolodin ilyavolodin added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jun 27, 2017
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants