Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a23a3ef

Browse files
committed
[eslint config] [base] [deps] [breaking] update eslint
- enable `no-useless-return` - tighten up `indent` - loosen `max-len` with `ignoreRegExpLiterals` option
1 parent 05d0634 commit a23a3ef

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

packages/eslint-config-airbnb-base/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@
4747
"devDependencies": {
4848
"babel-preset-airbnb": "^2.1.1",
4949
"babel-tape-runner": "^2.0.1",
50-
"eslint": "^3.8.1",
50+
"eslint": "^3.9.0",
5151
"eslint-find-rules": "^1.14.0",
5252
"eslint-plugin-import": "^2.0.1",
5353
"in-publish": "^2.0.0",
5454
"safe-publish-latest": "^1.1.1",
5555
"tape": "^4.6.2"
5656
},
5757
"peerDependencies": {
58-
"eslint": "^3.8.1",
58+
"eslint": "^3.9.0",
5959
"eslint-plugin-import": "^2.0.1"
6060
},
6161
"engines": {

packages/eslint-config-airbnb-base/rules/best-practices.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ module.exports = {
232232
// http://eslint.org/docs/rules/no-useless-escape
233233
'no-useless-escape': 'error',
234234

235+
// disallow redundant return; keywords
236+
// http://eslint.org/docs/rules/no-useless-return
237+
'no-useless-return': 'error',
238+
235239
// disallow use of void operator
236240
// http://eslint.org/docs/rules/no-void
237241
'no-void': 'error',

packages/eslint-config-airbnb-base/rules/style.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ module.exports = {
3535
// requires function names to match the name of the variable or property to which they are
3636
// assigned
3737
// http://eslint.org/docs/rules/func-name-matching
38-
'func-name-matching': ['off', { includeCommonJSModuleExports: false }],
38+
'func-name-matching': ['off', {
39+
includeCommonJSModuleExports: false,
40+
nameMatches: 'always'
41+
}],
3942

4043
// require function expressions to have a name
4144
// http://eslint.org/docs/rules/func-names
@@ -59,7 +62,23 @@ module.exports = {
5962

6063
// this option sets a specific tab width for your code
6164
// http://eslint.org/docs/rules/indent
62-
indent: ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
65+
indent: ['error', 2, {
66+
SwitchCase: 1,
67+
VariableDeclarator: 1,
68+
outerIIFEBody: 1,
69+
// MemberExpression: null,
70+
// CallExpression: {
71+
// parameters: null,
72+
// },
73+
FunctionDeclaration: {
74+
parameters: 1,
75+
body: 1
76+
},
77+
FunctionExpression: {
78+
parameters: 1,
79+
body: 1
80+
}
81+
}],
6382

6483
// specify whether double or single quotes should be used in JSX attributes
6584
// http://eslint.org/docs/rules/jsx-quotes
@@ -110,6 +129,7 @@ module.exports = {
110129
'max-len': ['error', 100, 2, {
111130
ignoreUrls: true,
112131
ignoreComments: false,
132+
ignoreRegExpLiterals: true,
113133
ignoreStrings: true,
114134
ignoreTemplateLiterals: true,
115135
}],

0 commit comments

Comments
 (0)