File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*eslint-disable no-undef,no-unused-vars*/
2
+
3
+ // Incorrect
4
+ const value1 = + x == null ; // eslint-disable-line no-constant-binary-expression
5
+
6
+ const value2 = condition ? x : { } || DEFAULT ; // eslint-disable-line no-constant-binary-expression
7
+
8
+ const value3 = ! foo == null ; // eslint-disable-line no-constant-binary-expression
9
+
10
+ const value4 = new Boolean ( foo ) === true ; // eslint-disable-line no-constant-binary-expression
11
+
12
+ const objIsEmpty = someObj === { } ; // eslint-disable-line no-constant-binary-expression
13
+
14
+ const arrIsEmpty = someArr === [ ] ; // eslint-disable-line no-constant-binary-expression
15
+
16
+ const shortCircuit1 = condition1 && false && condition2 ; // eslint-disable-line no-constant-binary-expression
17
+
18
+ const shortCircuit2 = condition1 || true || condition2 ; // eslint-disable-line no-constant-binary-expression
19
+
20
+ // Correct
21
+ const value11 = x == null ;
22
+
23
+ const value21 = ( condition ? x : { } ) || DEFAULT ;
24
+
25
+ const value31 = ! ( foo == null ) ;
26
+
27
+ const value41 = Boolean ( foo ) === true ;
28
+
29
+ const objIsEmpty1 = Object . keys ( someObj ) . length === 0 ;
30
+
31
+ const arrIsEmpty1 = someArr . length === 0 ;
You can’t perform that action at this time.
0 commit comments