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

Commit

Permalink
Add new rules from ESLint 3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrossmann committed Jan 21, 2017
1 parent b17c5bc commit 5491496
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions coding-styles/fixable.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ module.exports = {
// requiring the use of parentheses when invoking a constructor via the new keyword.
'new-parens': 1,

// Disallow return in else
// If an if block contains a return statement, the else block becomes unnecessary. Its contents
// can be placed outside of the block.
'no-else-return': 1,

// Disallow Extra Boolean Casts
// In contexts such as an if statement's test where the result of the expression will already be
// coerced to a Boolean, casting to a Boolean via double negation (!!) is unnecessary.
Expand Down
5 changes: 0 additions & 5 deletions coding-styles/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ module.exports = {
includeExports: true,
}],

// Disallow return in else
// If an if block contains a return statement, the else block becomes unnecessary. Its contents
// can be placed outside of the block.
'no-else-return': 1,

// Disallows comments after code
// This rule will disallow comments on the same line as code.
'no-inline-comments': 1,
Expand Down
7 changes: 7 additions & 0 deletions environments/shared/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,13 @@ module.exports = {
// to. Additionally, the with statement cannot be used in strict mode.
'no-with': 2,

// Require using Error objects as Promise rejection reasons
// It is considered good practice to only instances of the built-in Error object for
// user-defined errors in Promises. Error objects automatically store a stack trace, which can
// be used to debug an error by determining where it came from. If a Promise is rejected with a
// non-Error value, it can be difficult to determine where the rejection occurred.
'prefer-promise-reject-errors': 2,

// Suggest using the spread operator instead of .apply()
// This rule is aimed to flag usage of Function.prototype.apply() that can be replaced with the
// spread operator.
Expand Down
4 changes: 4 additions & 0 deletions unused.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ module.exports = {
// Unused, too restrictive.
'no-invalid-this': 0,

// Disallow Use of Chained Assignment Expressions
// Unused, seems handy.
'no-multi-assign': 0,

// Disallow Multiline Strings
// Unused, seems handy. This rule should be enabled when pre-ES5 compatibility is required.
'no-multi-str': 0,
Expand Down

0 comments on commit 5491496

Please sign in to comment.