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

Commit d46a628

Browse files
Upgrade ESLint to 2.12, add new rules
1 parent b67e19d commit d46a628

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

coding-styles/base.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ module.exports = {
302302
// This rule is aimed at ensuring consistency of string quotes.
303303
quotes: [1, 'single', 'avoid-escape'],
304304

305+
// Enforce spacing between rest and spread operators and their expressions
306+
// This rule aims to enforce consistent spacing between rest and spread operators and their
307+
// expressions.
308+
'rest-spread-spacing': [1, 'never'],
309+
305310
// Enforce spacing before and after semicolons
306311
'semi-spacing': [1, {
307312
before: false,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"license": "BSD-3-Clause",
1818
"main": "default",
1919
"peerDependencies": {
20-
"eslint": "^2.9.0"
20+
"eslint": "^2.12.0"
2121
},
2222
"repository": {
2323
"type": "git",
@@ -27,6 +27,6 @@
2727
"lint": "eslint standard environments coding-styles unused.js default.js"
2828
},
2929
"devDependencies": {
30-
"eslint": "^2.9.0"
30+
"eslint": "^2.12.0"
3131
}
3232
}

standard/best-practices.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ module.exports = {
5353
//
5454
// @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/
5555
// Operator_Precedence
56-
'no-extra-parens': 1,
56+
'no-extra-parens': [1, 'all', {
57+
nestedBinaryExpressions: false
58+
}],
59+
60+
// Disallow mixes of different operators
61+
// Enclosing complex expressions by parentheses clarifies the developer’s intention, which makes
62+
// the code more readable. This rule warns when different operators are used consecutively
63+
// without parentheses in an expression.
64+
'no-mixed-operators': 1,
5765

5866
// Disallow Initializing to undefined
5967
// In JavaScript, a variable that is declared and not initialized to any value automatically

standard/optional.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ module.exports = {
4646
// code to a certain number of characters.
4747
'max-len': [1, 100, 2],
4848

49+
// Enforce a maximum file length
50+
// This rule enforces a maximum number of lines per file, in order to aid in maintainability and
51+
// reduce complexity.
52+
'max-lines': [1, {
53+
max: 600,
54+
skipBlankLines: true,
55+
skipComments: true
56+
}],
57+
4958
// Limit Maximum Number of Parameters
5059
// Functions that take numerous parameters can be difficult to read and write because it
5160
// requires the memorization of what each parameter is, its type, and the order they should

unused.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ module.exports = {
104104
// Unused, too restrictive.
105105
'object-property-newline': 0,
106106

107+
// Require or disallow line breaks inside braces
108+
// Unused, too restrictive.
109+
'object-curly-newline': 0,
110+
107111
// eslint-plugin-react
108112

109113
// Forbid certain propTypes

0 commit comments

Comments
 (0)