From bc2136de280ded65e2d33c3424d7f3dee24b31f4 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 9 Nov 2018 12:40:05 -0800 Subject: [PATCH] chore: remove unused deps and fix lint (#141) --- packages/google-cloud-videointelligence/.gitignore | 1 + packages/google-cloud-videointelligence/package.json | 8 +++----- .../google-cloud-videointelligence/samples/package.json | 4 ++++ .../smoke-test/.eslintrc.yml | 5 +++++ .../smoke-test/video_intelligence_service_smoke_test.js | 2 +- packages/google-cloud-videointelligence/synth.py | 3 +-- .../system-test/.eslintrc.yml | 1 - .../system-test/video_intelligence_service_smoke_test.js | 7 +++---- .../google-cloud-videointelligence/test/.eslintrc.yml | 2 -- 9 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 packages/google-cloud-videointelligence/smoke-test/.eslintrc.yml diff --git a/packages/google-cloud-videointelligence/.gitignore b/packages/google-cloud-videointelligence/.gitignore index 6b002b948bd..8db114fab10 100644 --- a/packages/google-cloud-videointelligence/.gitignore +++ b/packages/google-cloud-videointelligence/.gitignore @@ -8,3 +8,4 @@ system-test/secrets.js system-test/*key.json *.lock package-lock.json +.vscode diff --git a/packages/google-cloud-videointelligence/package.json b/packages/google-cloud-videointelligence/package.json index 361adbc978b..bfec486031c 100644 --- a/packages/google-cloud-videointelligence/package.json +++ b/packages/google-cloud-videointelligence/package.json @@ -32,22 +32,20 @@ "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "eslint src/ samples/ test/", - "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js", + "lint": "eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", - "test": "npm run cover" + "test": "npm run cover", + "fix": "eslint --fix '**/*.js'" }, "dependencies": { - "extend": "^3.0", "google-gax": "^0.20.0", "lodash.merge": "^4.6.1", "protobufjs": "^6.8.6" }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^2.3.0", - "async": "^2.6.1", "codecov": "^3.0.2", "eslint": "^5.0.0", "eslint-config-prettier": "^3.0.0", diff --git a/packages/google-cloud-videointelligence/samples/package.json b/packages/google-cloud-videointelligence/samples/package.json index 5f0053d1046..ec0eb208910 100644 --- a/packages/google-cloud-videointelligence/samples/package.json +++ b/packages/google-cloud-videointelligence/samples/package.json @@ -3,6 +3,10 @@ "version": "0.0.1", "private": true, "license": "Apache-2.0", + "files": [ + "*.js", + "resources" + ], "author": "Google Inc.", "repository": "googleapis/nodejs-video-intelligence", "engines": { diff --git a/packages/google-cloud-videointelligence/smoke-test/.eslintrc.yml b/packages/google-cloud-videointelligence/smoke-test/.eslintrc.yml new file mode 100644 index 00000000000..69644b3bae0 --- /dev/null +++ b/packages/google-cloud-videointelligence/smoke-test/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +env: + mocha: true +rules: + no-undef: off diff --git a/packages/google-cloud-videointelligence/smoke-test/video_intelligence_service_smoke_test.js b/packages/google-cloud-videointelligence/smoke-test/video_intelligence_service_smoke_test.js index 443f0b35faf..82c2d8e034f 100644 --- a/packages/google-cloud-videointelligence/smoke-test/video_intelligence_service_smoke_test.js +++ b/packages/google-cloud-videointelligence/smoke-test/video_intelligence_service_smoke_test.js @@ -15,5 +15,5 @@ 'use strict'; describe('VideoIntelligenceServiceSmokeTest', () => { - $unhandledCase: LongRunningOptionalArrayMethod$ + LongRunningOptionalArrayMethod$; }); diff --git a/packages/google-cloud-videointelligence/synth.py b/packages/google-cloud-videointelligence/synth.py index baa93180fd5..479ad088f28 100644 --- a/packages/google-cloud-videointelligence/synth.py +++ b/packages/google-cloud-videointelligence/synth.py @@ -33,5 +33,4 @@ # Node.js specific cleanup subprocess.run(["npm", "install"]) -subprocess.run(["npm", "run", "prettier"]) -subprocess.run(["npm", "run", "lint"]) +subprocess.run(["npm", "run", "fix"]) diff --git a/packages/google-cloud-videointelligence/system-test/.eslintrc.yml b/packages/google-cloud-videointelligence/system-test/.eslintrc.yml index 2e6882e46d2..f9605165c0f 100644 --- a/packages/google-cloud-videointelligence/system-test/.eslintrc.yml +++ b/packages/google-cloud-videointelligence/system-test/.eslintrc.yml @@ -2,5 +2,4 @@ env: mocha: true rules: - node/no-unpublished-require: off no-console: off diff --git a/packages/google-cloud-videointelligence/system-test/video_intelligence_service_smoke_test.js b/packages/google-cloud-videointelligence/system-test/video_intelligence_service_smoke_test.js index 77af73a780f..b8fd646bd53 100644 --- a/packages/google-cloud-videointelligence/system-test/video_intelligence_service_smoke_test.js +++ b/packages/google-cloud-videointelligence/system-test/video_intelligence_service_smoke_test.js @@ -84,22 +84,21 @@ describe('VideoIntelligenceServiceSmokeTest', () => { .annotateVideo(request) .then(responses => { const operation = responses[0]; - const initialApiResponse = responses[1]; // Adding a listener for the "complete" event starts polling for the // completion of the operation. - operation.on('complete', (result, metadata, finalApiResponse) => { + operation.on('complete', result => { console.log(result); }); // Adding a listener for the "progress" event causes the callback to be // called on any change in metadata when the operation is polled. - operation.on('progress', (metadata, apiResponse) => { + operation.on('progress', metadata => { console.log(metadata); }); // Adding a listener for the "error" event handles any errors found during polling. - operation.on('error', err => { + operation.on('error', () => { // throw(err); }); }) diff --git a/packages/google-cloud-videointelligence/test/.eslintrc.yml b/packages/google-cloud-videointelligence/test/.eslintrc.yml index 73f7bbc946f..6db2a46c535 100644 --- a/packages/google-cloud-videointelligence/test/.eslintrc.yml +++ b/packages/google-cloud-videointelligence/test/.eslintrc.yml @@ -1,5 +1,3 @@ --- env: mocha: true -rules: - node/no-unpublished-require: off