Skip to content
This repository has been archived by the owner. It is now read-only.

prohibit ternary operators? #4504

Closed
shane-tomlinson opened this issue Dec 14, 2016 · 4 comments
Closed

prohibit ternary operators? #4504

shane-tomlinson opened this issue Dec 14, 2016 · 4 comments

Comments

@shane-tomlinson
Copy link
Member

@shane-tomlinson shane-tomlinson commented Dec 14, 2016

@vladikoff mentioned in #4370 that we have a preference for not using ternary operators. If this is so, should we outright prohibit them and add the no-ternary eslint rule?

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Dec 14, 2016

📲 @pdehaan

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Dec 15, 2016

some of the current usage:

Running "eslint:app" (eslint) task

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/lib/cropper.js
  258:17  error  Ternary operator used  no-ternary
  263:20  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/lib/fxa-client.js
  554:38  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/lib/null-storage.js
  17:12  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/lib/router.js
  159:17  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/lib/strings.js
  58:14  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/lib/url.js
  103:20  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/models/reliers/relier.js
  91:36  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/confirm.js
   72:23  error  Ternary operator used  no-ternary
  119:13  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/marketing_snippet.js
  134:24  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/mixins/checkbox-mixin.js
  31:25  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/permissions.js
  270:18  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/settings/avatar_change.js
  98:21  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/settings/avatar_gravatar.js
  77:14  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/settings/communication_preferences.js
   96:20  error  Ternary operator used  no-ternary
  103:32  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/sign_in_unblock.js
  94:9  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/scripts/views/sign_in.js
  71:14  error  Ternary operator used  no-ternary

/Users/vladikoff/mozilla/fxa-local-dev/fxa-content-server/app/tests/mocks/window.js
  99:14  error  Ternary operator used  no-ternary

✖ 20 problems (20 errors, 0 warnings)

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Dec 15, 2016

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Dec 15, 2016

@vladikoff vladikoff closed this Dec 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants