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

Rule option request: multiline-ternary to disallow newlines #6751

Closed
ljharb opened this issue Jul 24, 2016 · 9 comments
Closed

Rule option request: multiline-ternary to disallow newlines #6751

ljharb opened this issue Jul 24, 2016 · 9 comments
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

@ljharb
Copy link
Sponsor Contributor

ljharb commented Jul 24, 2016

The multiline-ternary rule allows me to require ternaries to be multiline - I'd like an option that requires ternaries not be multiline.

What version of ESLint are you using?
v3.1.1

What rule do you want to change?
multiline-ternary, I'd like a "disallowMutliline" option added.

What code should be flagged as incorrect with this change?

var x = a ?
  b :
  c;

var y = a
  ? b
  : c;

var z = a ? b :
  c;

What happens when the rule is applied to this code now?
It passes.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jul 24, 2016
@vitorbal
Copy link
Member

Thanks, @ljharb, I know it can be a bit tedious, but would you mind filling in the template for proposing a rule change?

@ljharb
Copy link
Sponsor Contributor Author

ljharb commented Jul 26, 2016

@vitorbal ah, sorry, i didn't realize there was a template for that as well. Updated.

@mysticatea mysticatea added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jul 27, 2016
@mysticatea mysticatea added this to the JSCS Compatibility milestone Jul 27, 2016
@mysticatea
Copy link
Member

I set JSCS Compatibility milestone since JSCS has disallowMultiLineTernary rule.

@kaicataldo
Copy link
Member

kaicataldo commented Jul 27, 2016

Interestingly enough, this was discussed and we ended up deciding to only implement "always". I'm happy to add this in if/when it's accepted. Assigning myself now so I don't lose track of it.

@kaicataldo kaicataldo self-assigned this Jul 27, 2016
@kaicataldo
Copy link
Member

@eslint/eslint-team Thoughts? Looks like we need two more thumbs on this.

@kaicataldo
Copy link
Member

For context: #6066 (comment)

@ilyavolodin
Copy link
Member

I'll support this. Seems like a reasonable enhancement to multiline-ternary. 👍

@platinumazure
Copy link
Member

👍 from me.

@ilyavolodin
Copy link
Member

@kaicataldo If you are championing this, I think you can mark it as accepted at this point.

@kaicataldo kaicataldo 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 Aug 3, 2016
@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
No open projects
Development

No branches or pull requests

7 participants