Skip to content

Commit 0903c19

Browse files
committed
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
1 parent 6e5025e commit 0903c19

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"no-undef": 2,
100100
"no-undef-init": 2,
101101
"no-unexpected-multiline": 2,
102-
"no-unneeded-ternary": 2,
102+
"no-unneeded-ternary": [2, { "defaultAssignment": false }],
103103
"no-unreachable": 2,
104104
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
105105
"no-useless-call": 2,

0 commit comments

Comments
 (0)