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

Small semantic issue in no-unneeded-ternary documentation example #4937

Closed
marcelozarate opened this Issue Jan 13, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@marcelozarate
Copy link
Contributor

commented Jan 13, 2016

Inside the documentation file:
no-unneeded-ternary

The first example shows:

// Bad
var isYes = answer === 1 ? true : false;

// Good
var isYes = answer === 1;


// Bad
var isNo = answer === 1 ? false : true;

// Good
var isYes = answer !== 1;

Shouldn't the last line be

var isNo = answer !== 1; 

instead?

@eslintbot

This comment has been minimized.

Copy link

commented Jan 13, 2016

@marcelozarate Thanks for the issue! If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

@eslintbot eslintbot added the triage label Jan 13, 2016

@btmills

This comment has been minimized.

Copy link
Member

commented Jan 13, 2016

Yep, looks like it. @marcelozarate want to submit a PR? (Contributing guide, for your reference.)

@marcelozarate

This comment has been minimized.

Copy link
Contributor Author

commented Jan 13, 2016

Ok.

@btmills btmills removed the bug label Jan 13, 2016

@btmills btmills closed this in 82fbe09 Jan 13, 2016

btmills added a commit that referenced this issue Jan 13, 2016

Merge pull request #4938 from marcelozarate/issue4937
Fix: Small semantic issue in documentation example (fixes #4937)

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.