From ac70b2a0ccbcf425c75f40330a3dd3e109ee984a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 20 Sep 2018 17:44:14 -0700 Subject: [PATCH] Fix the linter --- package.json | 4 ++-- smoke-test/.eslintrc.yml | 6 ++++++ src/connection-pool.js | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 smoke-test/.eslintrc.yml diff --git a/package.json b/package.json index 567b70c4b..f99359c87 100644 --- a/package.json +++ b/package.json @@ -67,10 +67,10 @@ "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "test-no-cover": "mocha test/*.js", "test": "npm run cover", - "lint": "eslint src/ samples/ system-test/ test/", + "lint": "eslint '**/*.js'", "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", "docs": "jsdoc -c .jsdoc.js", - "publish-module": "node ../../scripts/publish.js pubsub", + "fix": "eslint --fix '**/*.js' && npm run prettier", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json" }, "dependencies": { diff --git a/smoke-test/.eslintrc.yml b/smoke-test/.eslintrc.yml new file mode 100644 index 000000000..2e6882e46 --- /dev/null +++ b/smoke-test/.eslintrc.yml @@ -0,0 +1,6 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off + no-console: off diff --git a/src/connection-pool.js b/src/connection-pool.js index a642f4a81..1ffb85a8f 100644 --- a/src/connection-pool.js +++ b/src/connection-pool.js @@ -299,11 +299,10 @@ class ConnectionPool extends EventEmitter { } let elapsedTimeWithoutConnection = 0; const now = Date.now(); - let deadline; if (this.noConnectionsTime) { elapsedTimeWithoutConnection = now - this.noConnectionsTime; } - deadline = now + (MAX_TIMEOUT - elapsedTimeWithoutConnection); + const deadline = now + (MAX_TIMEOUT - elapsedTimeWithoutConnection); client.waitForReady(deadline, err => { this.isGettingChannelState = false; if (err) {