Permalink
Browse files

New rule: No default assignment with ternary operator

This is no longer allowed:

var a = x ? x : 1

In favor of:

var a = x || 1
  • Loading branch information...
1 parent 6e5025e commit 0903c19ca6a8bc0c8625c41ca844ee69968bf948 @feross committed Sep 16, 2015
Showing with 1 addition and 1 deletion.
  1. +1 −1 eslintrc.json
View
@@ -99,7 +99,7 @@
"no-undef": 2,
"no-undef-init": 2,
"no-unexpected-multiline": 2,
- "no-unneeded-ternary": 2,
+ "no-unneeded-ternary": [2, { "defaultAssignment": false }],
"no-unreachable": 2,
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
"no-useless-call": 2,

0 comments on commit 0903c19

Please sign in to comment.