Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit 5491496

Browse files
Add new rules from ESLint 3.14
1 parent b17c5bc commit 5491496

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

coding-styles/fixable.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ module.exports = {
144144
// requiring the use of parentheses when invoking a constructor via the new keyword.
145145
'new-parens': 1,
146146

147+
// Disallow return in else
148+
// If an if block contains a return statement, the else block becomes unnecessary. Its contents
149+
// can be placed outside of the block.
150+
'no-else-return': 1,
151+
147152
// Disallow Extra Boolean Casts
148153
// In contexts such as an if statement's test where the result of the expression will already be
149154
// coerced to a Boolean, casting to a Boolean via double negation (!!) is unnecessary.

coding-styles/recommended.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ module.exports = {
103103
includeExports: true,
104104
}],
105105

106-
// Disallow return in else
107-
// If an if block contains a return statement, the else block becomes unnecessary. Its contents
108-
// can be placed outside of the block.
109-
'no-else-return': 1,
110-
111106
// Disallows comments after code
112107
// This rule will disallow comments on the same line as code.
113108
'no-inline-comments': 1,

environments/shared/recommended.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,13 @@ module.exports = {
535535
// to. Additionally, the with statement cannot be used in strict mode.
536536
'no-with': 2,
537537

538+
// Require using Error objects as Promise rejection reasons
539+
// It is considered good practice to only instances of the built-in Error object for
540+
// user-defined errors in Promises. Error objects automatically store a stack trace, which can
541+
// be used to debug an error by determining where it came from. If a Promise is rejected with a
542+
// non-Error value, it can be difficult to determine where the rejection occurred.
543+
'prefer-promise-reject-errors': 2,
544+
538545
// Suggest using the spread operator instead of .apply()
539546
// This rule is aimed to flag usage of Function.prototype.apply() that can be replaced with the
540547
// spread operator.

unused.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ module.exports = {
6060
// Unused, too restrictive.
6161
'no-invalid-this': 0,
6262

63+
// Disallow Use of Chained Assignment Expressions
64+
// Unused, seems handy.
65+
'no-multi-assign': 0,
66+
6367
// Disallow Multiline Strings
6468
// Unused, seems handy. This rule should be enabled when pre-ES5 compatibility is required.
6569
'no-multi-str': 0,

0 commit comments

Comments
 (0)