@@ -59,7 +59,7 @@ module.exports = {
5959 ] ,
6060 rules : {
6161 // ESLint built-in rules
62- // http ://eslint.org/docs/rules
62+ // https ://eslint.org/docs/rules/
6363 'accessor-pairs' : 'error' ,
6464 'array-callback-return' : 'error' ,
6565 'arrow-parens' : [ 'error' , 'always' ] ,
@@ -129,6 +129,7 @@ module.exports = {
129129 'no-dupe-else-if' : 'error' ,
130130 'no-duplicate-case' : 'error' ,
131131 'no-duplicate-imports' : 'error' ,
132+ 'no-else-return' : [ 'error' , { allowElseIf : true } ] ,
132133 'no-empty-character-class' : 'error' ,
133134 'no-ex-assign' : 'error' ,
134135 'no-extra-boolean-cast' : 'error' ,
@@ -189,34 +190,6 @@ module.exports = {
189190 // as well to lib/.eslintrc.yaml.
190191 'no-restricted-syntax' : [
191192 'error' ,
192- {
193- selector : "CallExpression[callee.property.name='deepStrictEqual'][arguments.2.type='Literal']" ,
194- message : 'Do not use a literal for the third argument of assert.deepStrictEqual()' ,
195- } ,
196- {
197- selector : "CallExpression[callee.property.name='doesNotThrow']" ,
198- message : 'Do not use `assert.doesNotThrow()`. Write the code without the wrapper and add a comment instead.' ,
199- } ,
200- {
201- selector : "CallExpression[callee.property.name='doesNotReject']" ,
202- message : 'Do not use `assert.doesNotReject()`. Write the code without the wrapper and add a comment instead.' ,
203- } ,
204- {
205- selector : "CallExpression[callee.property.name='rejects'][arguments.length<2]" ,
206- message : '`assert.rejects()` must be invoked with at least two arguments.' ,
207- } ,
208- {
209- selector : "CallExpression[callee.property.name='strictEqual'][arguments.2.type='Literal']" ,
210- message : 'Do not use a literal for the third argument of assert.strictEqual()' ,
211- } ,
212- {
213- selector : "CallExpression[callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])" ,
214- message : 'Use an object as second argument of `assert.throws()`.' ,
215- } ,
216- {
217- selector : "CallExpression[callee.property.name='throws'][arguments.length<2]" ,
218- message : '`assert.throws()` must be invoked with at least two arguments.' ,
219- } ,
220193 {
221194 selector : "CallExpression[callee.name='setTimeout'][arguments.length<2]" ,
222195 message : '`setTimeout()` must be invoked with at least two arguments.' ,
@@ -229,22 +202,6 @@ module.exports = {
229202 selector : 'ThrowStatement > CallExpression[callee.name=/Error$/]' ,
230203 message : 'Use `new` keyword when throwing an `Error`.' ,
231204 } ,
232- {
233- selector : "CallExpression[callee.property.name='notDeepStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])" ,
234- message : 'The first argument should be the `actual`, not the `expected` value.' ,
235- } ,
236- {
237- selector : "CallExpression[callee.property.name='notStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])" ,
238- message : 'The first argument should be the `actual`, not the `expected` value.' ,
239- } ,
240- {
241- selector : "CallExpression[callee.property.name='deepStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])" ,
242- message : 'The first argument should be the `actual`, not the `expected` value.' ,
243- } ,
244- {
245- selector : "CallExpression[callee.property.name='strictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])" ,
246- message : 'The first argument should be the `actual`, not the `expected` value.' ,
247- } ,
248205 {
249206 selector : "CallExpression[callee.name='isNaN']" ,
250207 message : 'Use Number.isNaN() instead of the global isNaN() function.' ,
0 commit comments