From 24cb5c452b87fa544380bab7c77ddc60e15f52f7 Mon Sep 17 00:00:00 2001 From: Chris Barber Date: Mon, 17 Dec 2018 13:29:33 -0600 Subject: [PATCH] chore: Added promise elint plugin. chore: Updated Babel. --- .eslintrc | 67 +++++++++++++++++++++++++++++++--------------------- package.json | 3 ++- yarn.lock | 5 ++++ 3 files changed, 47 insertions(+), 28 deletions(-) diff --git a/.eslintrc b/.eslintrc index b664274..7603a3b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,40 +16,53 @@ "plugins": [ "chai-expect", "mocha", + "promise", "security" ], "root": true, "rules": { - "array-bracket-spacing": [ "error", "always", { "objectsInArrays": true, "arraysInArrays": true } ], + "array-bracket-spacing": [ 'warn', 'always' ], "brace-style": [ 2, "1tbs", { "allowSingleLine": true } ], - "camelcase": 0, - "chai-expect/missing-assertion": 2, - "chai-expect/terminating-properties": 1, - "curly": [ 2, "all" ], - "eol-last": 2, - "indent": [ 2, "tab", { "SwitchCase": 1 } ], + "camelcase": "off", + "chai-expect/missing-assertion": "error", + "chai-expect/terminating-properties": "warn", + "curly": [ "error", "all" ], + "eol-last": "error", + "indent": [ "error", "tab", { "SwitchCase": 1 } ], "keyword-spacing": [ "error" ], - "linebreak-style": [ 2, "unix" ], - "max-len": [ 2, 200 ], - "no-case-declarations": 0, - "no-cond-assign": 0, - "no-console": 0, - "no-control-regex": 0, - "no-empty": 1, - "no-inner-declarations": 0, - "no-mixed-spaces-and-tabs": 2, - "no-multi-str": 2, - "no-multiple-empty-lines": 2, - "no-trailing-spaces": 2, - "no-unused-vars": 0, - "no-useless-escape": 1, - "quotes": [ 2, "single" ], - "semi": [ 2, "always" ], - "space-before-blocks": [ 2, "always" ], + "linebreak-style": [ "error", "unix" ], + "max-len": [ "error", 200 ], + "no-case-declarations": "off", + "no-cond-assign": "off", + "no-console": "off", + "no-control-regex": "off", + "no-empty": "warn", + "no-inner-declarations": "off", + "no-mixed-spaces-and-tabs": "error", + "no-multi-str": "error", + "no-multiple-empty-lines": "error", + "no-trailing-spaces": "error", + "no-unused-vars": "off", + "no-useless-escape": "warn", + "promise/always-return": "error", + "promise/no-return-wrap": "error", + "promise/param-names": "error", + "promise/catch-or-return": "error", + "promise/no-native": "off", + "promise/no-nesting": "warn", + "promise/no-promise-in-callback": "warn", + "promise/no-callback-in-promise": "warn", + "promise/avoid-new": "warn", + "promise/no-new-statics": "error", + "promise/no-return-in-finally": "warn", + "promise/valid-params": "warn", + "quotes": [ "error", "single" ], + "semi": [ "error", "always" ], + "space-before-blocks": [ "error", "always" ], "space-before-function-paren": [ "error", { "anonymous": "always", "named": "ignore", "asyncArrow": "always" }], "space-in-parens": [ "error", "never" ], - "space-infix-ops": 2, - "space-unary-ops": [ 2, { "nonwords": false, "overrides": {} } ], - "valid-jsdoc": [ 1, { "requireReturn": false, "requireReturnDescription": false } ] + "space-infix-ops": "error", + "space-unary-ops": [ "error", { "nonwords": false, "overrides": {} } ], + "valid-jsdoc": [ "warn", { "requireReturn": false, "requireReturnDescription": false } ] } } diff --git a/package.json b/package.json index ea4939f..3bda17f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "source-map-support": "^0.5.9" }, "devDependencies": { - "@babel/core": "^7.2.0", + "@babel/core": "^7.2.2", "@babel/plugin-transform-modules-commonjs": "^7.2.0", "@babel/register": "^7.0.0", "ansi-colors": "^3.2.3", @@ -42,6 +42,7 @@ "eslint": "^5.10.0", "eslint-plugin-chai-expect": "^2.0.1", "eslint-plugin-mocha": "^5.2.0", + "eslint-plugin-promise": "^4.0.1", "eslint-plugin-security": "^1.4.0", "fancy-log": "^1.3.3", "fs-extra": "^7.0.1", diff --git a/yarn.lock b/yarn.lock index eaae2c6..1b0401d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1720,6 +1720,11 @@ eslint-plugin-mocha@^5.2.0: dependencies: ramda "^0.25.0" +eslint-plugin-promise@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz#2d074b653f35a23d1ba89d8e976a985117d1c6a2" + integrity sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg== + eslint-plugin-security@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/eslint-plugin-security/-/eslint-plugin-security-1.4.0.tgz#d4f314484a80b1b613b8c8886e84f52efe1526c2"