From 11a6f0b9fe59b6b281dda79378c3d35fc880a54a Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Mon, 4 Dec 2017 21:20:27 -0600 Subject: [PATCH] Update boilerplate --- .eslintrc | 66 ++++++++++++++++++++++++++++++++++---------------- .gitignore | 2 +- .travis.yml | 2 +- appveyor.yml | 2 +- package.json | 2 +- test/.eslintrc | 6 +++++ 6 files changed, 55 insertions(+), 25 deletions(-) diff --git a/.eslintrc b/.eslintrc index 693adff..09f051f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,10 +6,12 @@ // arbitrary JavaScript / Node.js package -- inside or outside Sails.js. // For the master copy of this file, see the `.eslintrc` template file in // the `sails-generate` package (https://www.npmjs.com/package/sails-generate.) + // Designed for ESLint v4. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // For more information about any of the rules below, check out the relevant // reference page on eslint.org. For example, to get details on "no-sequences", - // you would visit `http://eslint.org/docs/rules/no-sequences`. + // you would visit `http://eslint.org/docs/rules/no-sequences`. If you're unsure + // or could use some advice, come by https://sailsjs.com/support. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "env": { @@ -18,29 +20,51 @@ "parserOptions": { "ecmaVersion": 5 + // ^^This can be changed to `8` if this package doesn't need to support <= Node v6. + }, + + "globals": { + "Promise": true + // ^^Available since Node v4 }, "rules": { - "callback-return": [2, ["callback", "cb", "next", "done", "proceed"]], - "camelcase": [1, {"properties": "always"}], - "comma-style": [2, "last"], - "curly": [2], - "eqeqeq": [2, "always"], - "eol-last": [1], - "handle-callback-err": [2], - "indent": [1, 2, {"SwitchCase": 1}], - "linebreak-style": [2, "unix"], - "no-dupe-keys": [2], - "no-mixed-spaces-and-tabs": [2, "smart-tabs"], - "no-return-assign": [2, "always"], - "no-sequences": [2], - "no-trailing-spaces": [1], - "no-undef": [2], - "no-unexpected-multiline": [1], - "no-unused-vars": [1], - "one-var": [2, "never"], - "quotes": [1, "single", { "avoidEscape": false, "allowTemplateLiterals": true }], - "semi": [2, "always"] + "callback-return": ["error", ["done", "proceed", "next", "onwards", "callback", "cb"]], + "camelcase": ["warn", {"properties": "always"}], + "comma-style": ["warn", "last"], + "curly": ["error"], + "eqeqeq": ["error", "always"], + "eol-last": ["warn"], + "handle-callback-err": ["error"], + "indent": ["warn", 2, { + "SwitchCase": 1, + "MemberExpression": "off", + "FunctionDeclaration": {"body":1, "parameters": "off"}, + "FunctionExpression": {"body":1, "parameters": "off"}, + "CallExpression": {"arguments":"off"}, + "ArrayExpression": 1, + "ObjectExpression": 1, + "ignoredNodes": ["ConditionalExpression"] + }], + "linebreak-style": ["error", "unix"], + "no-dupe-keys": ["error"], + "no-duplicate-case": ["error"], + "no-extra-semi": ["warn"], + "no-labels": ["error"], + "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], + "no-redeclare": ["warn"], + "no-return-assign": ["error", "always"], + "no-sequences": ["error"], + "no-trailing-spaces": ["warn"], + "no-undef": ["error"], + "no-unexpected-multiline": ["warn"], + "no-unused-vars": ["warn", {"caughtErrors":"all", "caughtErrorsIgnorePattern": "^unused($|[A-Z].*$)"}], + "no-use-before-define": ["error", {"functions":false}], + "one-var": ["warn", "never"], + "quotes": ["warn", "single", {"avoidEscape":false, "allowTemplateLiterals":true}], + "semi": ["error", "always"], + "semi-spacing": ["warn", {"before":false, "after":true}], + "semi-style": ["warn", "last"] } } diff --git a/.gitignore b/.gitignore index 0d03085..806b1b0 100644 --- a/.gitignore +++ b/.gitignore @@ -17,8 +17,8 @@ node_modules .tmp npm-debug.log -.waterline package-lock.json +.waterline .node_history ############################ diff --git a/.travis.yml b/.travis.yml index 105f2fd..3d4b29b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ language: node_js node_js: - "4" - "6" - - "7" + - "8" - "node" branches: diff --git a/appveyor.yml b/appveyor.yml index da48b58..d5c0ecf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ environment: matrix: - nodejs_version: "4" - nodejs_version: "6" - - nodejs_version: "7" + - nodejs_version: "8" # Install scripts. (runs after repo cloning) install: diff --git a/package.json b/package.json index 68c70be..02a2bb1 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "benchmark": "2.1.2", - "eslint": "3.5.0", + "eslint": "4.11.0", "mocha": "3.0.2" } } diff --git a/test/.eslintrc b/test/.eslintrc index 694f984..900744c 100644 --- a/test/.eslintrc +++ b/test/.eslintrc @@ -15,6 +15,12 @@ "env": { "mocha": true + }, + + "globals": { + // "assert": true, + // "util": true + // …plus any other convenience globals exposed in test suites } }