Skip to content

Commit dd53e3c

Browse files
committed
Update eslint
1 parent dfb1c23 commit dd53e3c

File tree

2 files changed

+62
-23
lines changed

2 files changed

+62
-23
lines changed

.eslintrc

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,70 @@
22
// ╔═╗╔═╗╦ ╦╔╗╔╔╦╗┬─┐┌─┐
33
// ║╣ ╚═╗║ ║║║║ ║ ├┬┘│
44
// o╚═╝╚═╝╩═╝╩╝╚╝ ╩ ┴└─└─┘
5-
// A set of basic conventions designed to complement the .jshintrc file.
5+
// A set of basic conventions (similar to .jshintrc) for use within any
6+
// arbitrary JavaScript / Node.js package -- inside or outside Sails.js.
67
// For the master copy of this file, see the `.eslintrc` template file in
78
// the `sails-generate` package (https://www.npmjs.com/package/sails-generate.)
9+
// Designed for ESLint v4.
10+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
11+
// For more information about any of the rules below, check out the relevant
12+
// reference page on eslint.org. For example, to get details on "no-sequences",
13+
// you would visit `http://eslint.org/docs/rules/no-sequences`. If you're unsure
14+
// or could use some advice, come by https://sailsjs.com/support.
15+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
16+
817
"env": {
9-
"node": true,
10-
"mocha": true
18+
"node": true
1119
},
20+
21+
"parserOptions": {
22+
"ecmaVersion": 5
23+
// ^^This can be changed to `8` if this package doesn't need to support <= Node v6.
24+
},
25+
26+
"globals": {
27+
"Promise": true
28+
// ^^Available since Node v4
29+
},
30+
1231
"rules": {
13-
"callback-return": [2, ["callback", "cb", "next", "done", "proceed"]],
14-
"camelcase": [2, {"properties": "always"}],
15-
"comma-style": [2, "last"],
16-
"curly": [2],
17-
"eqeqeq": [1, "smart"],
18-
"eol-last": [2],
19-
"handle-callback-err": [2],
20-
"indent": [2, 2, {"SwitchCase": 1}],
21-
"linebreak-style": [2, "unix"],
22-
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
23-
"no-return-assign": [2, "always"],
24-
"no-sequences": [2],
25-
"no-trailing-spaces": [2],
26-
"no-undef": [2],
27-
"no-unexpected-multiline": [1],
28-
"no-unused-vars": [2],
29-
"one-var": [2, "never"],
30-
"semi": [1, "always"]
32+
"callback-return": ["error", ["done", "proceed", "next", "onwards", "callback", "cb"]],
33+
"camelcase": ["warn", {"properties": "always"}],
34+
"comma-style": ["warn", "last"],
35+
"curly": ["error"],
36+
"eqeqeq": ["error", "always"],
37+
"eol-last": ["warn"],
38+
"handle-callback-err": ["error"],
39+
"indent": ["warn", 2, {
40+
"SwitchCase": 1,
41+
"MemberExpression": "off",
42+
"FunctionDeclaration": {"body":1, "parameters": "off"},
43+
"FunctionExpression": {"body":1, "parameters": "off"},
44+
"CallExpression": {"arguments":"off"},
45+
"ArrayExpression": 1,
46+
"ObjectExpression": 1,
47+
"ignoredNodes": ["ConditionalExpression"]
48+
}],
49+
"linebreak-style": ["error", "unix"],
50+
"no-dupe-keys": ["error"],
51+
"no-duplicate-case": ["error"],
52+
"no-extra-semi": ["warn"],
53+
"no-labels": ["error"],
54+
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
55+
"no-redeclare": ["warn"],
56+
"no-return-assign": ["error", "always"],
57+
"no-sequences": ["error"],
58+
"no-trailing-spaces": ["warn"],
59+
"no-undef": ["error"],
60+
"no-unexpected-multiline": ["warn"],
61+
"no-unreachable": ["warn"],
62+
"no-unused-vars": ["warn", {"caughtErrors":"all", "caughtErrorsIgnorePattern": "^unused($|[A-Z].*$)"}],
63+
"no-use-before-define": ["error", {"functions":false}],
64+
"one-var": ["warn", "never"],
65+
"quotes": ["warn", "single", {"avoidEscape":false, "allowTemplateLiterals":true}],
66+
"semi": ["error", "always"],
67+
"semi-spacing": ["warn", {"before":false, "after":true}],
68+
"semi-style": ["warn", "last"]
3169
}
70+
3271
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "node ./node_modules/mocha/bin/mocha --recursive",
77
"fasttest": "node ./node_modules/mocha/bin/mocha --recursive",
88
"pretest": "npm run lint",
9-
"lint": "node ./node_modules/eslint/bin/eslint *.js **/*.js",
9+
"lint": "node ./node_modules/eslint/bin/eslint . --max-warnings=0 --ignore-pattern 'test/'",
1010
"docker": "docker-compose run adapter bash"
1111
},
1212
"keywords": [
@@ -27,7 +27,7 @@
2727
"waterline-sql-builder": "^1.0.0-2"
2828
},
2929
"devDependencies": {
30-
"eslint": "3.5.0",
30+
"eslint": "4.11.0",
3131
"mocha": "3.0.2"
3232
},
3333
"machinepack": {

0 commit comments

Comments
 (0)