@@ -17,24 +17,12 @@ module.exports = {
1717 // make sure for-in loops have an if statement
1818 "guard-for-in" : "error" ,
1919
20- // require a capital letter for constructors
21- "new-cap" : "error" ,
22-
23- // disallow the omission of parentheses when invoking a constructor with no arguments
24- "new-parens" : "error" ,
25-
2620 // disallow use of the Array constructor
2721 "no-array-constructor" : "error" ,
2822
2923 // disallow use of bitwise operators
3024 "no-bitwise" : "error" ,
3125
32- // disallow use of arguments.caller or arguments.callee
33- "no-caller" : "error" ,
34-
35- // disallow the catch clause parameter name being the same as a variable in the outer scope
36- "no-catch-shadow" : "warn" ,
37-
3826 // disallow assignment in conditional expressions
3927 "no-cond-assign" : "error" ,
4028
@@ -68,9 +56,6 @@ module.exports = {
6856 // disallow comparisons to null without a type-checking operator
6957 "no-eq-null" : "error" ,
7058
71- // disallow use of eval()
72- "no-eval" : "error" ,
73-
7459 // disallow adding to native types
7560 "no-extend-native" : "error" ,
7661
@@ -92,9 +77,6 @@ module.exports = {
9277 // disallow overwriting functions written as function declarations
9378 "no-func-assign" : "error" ,
9479
95- // disallow use of eval()-like methods
96- "no-implied-eval" : "error" ,
97-
9880 // disallow function or variable declarations in nested blocks
9981 "no-inner-declarations" : "error" ,
10082
@@ -107,18 +89,12 @@ module.exports = {
10789 // disallow labels that share a name with a variable
10890 "no-label-var" : "error" ,
10991
110- // disallow use of labeled statements
111- "no-labels" : "error" ,
112-
11392 // disallow unnecessary nested blocks
11493 "no-lone-blocks" : "warn" ,
11594
11695 // disallow creation of functions within loops
11796 "no-loop-func" : "warn" ,
11897
119- // disallow use of multiline strings
120- "no-multi-str" : "error" ,
121-
12298 // disallow reassignments of native objects
12399 "no-native-reassign" : "error" ,
124100
@@ -146,36 +122,33 @@ module.exports = {
146122 // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \050";
147123 "no-octal-escape" : "error" ,
148124
149- // disallow usage of __proto__ property
150- "no-proto" : "error" ,
151-
152125 // disallow declaring the same variable more then once
153126 "no-redeclare" : "error" ,
154127
155- // disallow use of javascript: urls.
156- "no-script-url" : "error" ,
157-
158128 // disallow comparisons where both sides are exactly the same
159129 "no-self-compare" : "error" ,
160130
161- // disallow use of comma operator
162- "no-sequences" : "error" ,
163-
164131 // disallow declaration of variables already declared in the outer scope
165132 "no-shadow" : "warn" ,
166133
167- // disallow shadowing of names such as arguments
168- "no-shadow-restricted-names" : "error" ,
169-
170134 // disallow sparse arrays
171135 "no-sparse-arrays" : "error" ,
172136
173- // disallow throwing non-Error objects
174- "no-throw-literal" : "error" ,
175-
176137 // disallow use of undeclared variables unless mentioned in a /*global */ block
177138 "no-undef" : "error" ,
178139
140+ // disallow unreachable statements after a return, throw, continue, or break statement
141+ "no-unreachable" : "warn" ,
142+
143+ // disallow usage of expressions in statement position
144+ "no-unused-expressions" : [
145+ "error" ,
146+ {
147+ allowShortCircuit : true , // allow short-circuited expressions (e.g. foo && bar())
148+ allowTernary : true , // allow ternary expressions (e.g. foo ? bar() : baz())
149+ } ,
150+ ] ,
151+
179152 // disallow declaration of variables that are not used in the code
180153 "no-unused-vars" : [
181154 "error" ,
@@ -185,22 +158,6 @@ module.exports = {
185158 } ,
186159 ] ,
187160
188- // disallow use of void operator
189- "no-void" : "error" ,
190-
191- // disallow use of the with statement
192- "no-with" : "error" ,
193-
194- // require assignment operator shorthand where possible
195- "operator-assignment" : "error" ,
196-
197- // Require the "use strict" pragma, either at the global level or function level,
198- // depending on whether CommonJS is being used or not
199- strict : [
200- "error" ,
201- "safe" ,
202- ] ,
203-
204161 // disallow comparisons with the value NaN
205162 "use-isnan" : "error" ,
206163
@@ -210,8 +167,5 @@ module.exports = {
210167 // require immediate function invocation to be wrapped in parentheses
211168 "wrap-iife" : "error" ,
212169
213- // disallow Yoda conditions
214- yoda : "error" ,
215-
216170 }
217171} ;
0 commit comments