From f3651ae518b7ceaf18ae08192fc42b05eebd40b5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 20 Sep 2018 12:29:40 -0700 Subject: [PATCH] Enable prefer-const in the eslint config (#102) --- .../.eslintrc.yml | 1 + .../video_intelligence_service_smoke_test.js | 2 +- .../v1/video_intelligence_service_client.js | 2 +- .../video_intelligence_service_client.js | 2 +- .../video_intelligence_service_client.js | 2 +- .../video_intelligence_service_client.js | 2 +- .../video_intelligence_service_client.js | 2 +- .../video_intelligence_service_smoke_test.js | 34 +++++++++---------- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-videointelligence/.eslintrc.yml b/packages/google-cloud-videointelligence/.eslintrc.yml index 65f1dce6c0c..73eeec27612 100644 --- a/packages/google-cloud-videointelligence/.eslintrc.yml +++ b/packages/google-cloud-videointelligence/.eslintrc.yml @@ -12,3 +12,4 @@ rules: eqeqeq: error no-warning-comments: warn no-var: error + prefer-const: error 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/src/v1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.js index 6ed0c6467e6..1b94364716c 100644 --- a/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.js @@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; - for (let methodName of videoIntelligenceServiceStubMethods) { + for (const methodName of videoIntelligenceServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( videoIntelligenceServiceStub.then( stub => diff --git a/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js index 90327fc9706..c4d1955b3aa 100644 --- a/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js @@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; - for (let methodName of videoIntelligenceServiceStubMethods) { + for (const methodName of videoIntelligenceServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( videoIntelligenceServiceStub.then( stub => diff --git a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js index 6b73c09e508..06e598197f2 100644 --- a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js @@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; - for (let methodName of videoIntelligenceServiceStubMethods) { + for (const methodName of videoIntelligenceServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( videoIntelligenceServiceStub.then( stub => diff --git a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js index 81231d06fb6..e89e18fd2f1 100644 --- a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js @@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; - for (let methodName of videoIntelligenceServiceStubMethods) { + for (const methodName of videoIntelligenceServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( videoIntelligenceServiceStub.then( stub => diff --git a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js index a5a766cfda1..211e5255cee 100644 --- a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js @@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; - for (let methodName of videoIntelligenceServiceStubMethods) { + for (const methodName of videoIntelligenceServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( videoIntelligenceServiceStub.then( stub => 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 4803fddb46b..77af73a780f 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 @@ -18,16 +18,16 @@ describe('VideoIntelligenceServiceSmokeTest', () => { it('successfully makes a call to the service', done => { const videoIntelligence = require('../src'); - let client = new videoIntelligence.v1p1beta1.VideoIntelligenceServiceClient( + const client = new videoIntelligence.v1p1beta1.VideoIntelligenceServiceClient( { // optional auth parameters. } ); - let inputUri = 'gs://demomaker/cat.mp4'; - let featuresElement = 'LABEL_DETECTION'; - let features = [featuresElement]; - let request = { + const inputUri = 'gs://demomaker/cat.mp4'; + const featuresElement = 'LABEL_DETECTION'; + const features = [featuresElement]; + const request = { inputUri: inputUri, features: features, }; @@ -36,8 +36,8 @@ describe('VideoIntelligenceServiceSmokeTest', () => { client .annotateVideo(request) .then(responses => { - let operation = responses[0]; - let initialApiResponse = responses[1]; + const operation = responses[0]; + const initialApiResponse = responses[1]; console.log(operation); console.log(initialApiResponse); @@ -46,13 +46,13 @@ describe('VideoIntelligenceServiceSmokeTest', () => { }) .then(responses => { // The final result of the operation. - let result = responses[0]; + const result = responses[0]; // The metadata value of the completed operation. - let metadata = responses[1]; + const metadata = responses[1]; // The response of the api call returning the complete operation. - let finalApiResponse = responses[2]; + const finalApiResponse = responses[2]; console.log(result); console.log(metadata); @@ -65,16 +65,16 @@ describe('VideoIntelligenceServiceSmokeTest', () => { it('successfully makes a call to the service', done => { const videoIntelligence = require('../src'); - let client = new videoIntelligence.v1p1beta1.VideoIntelligenceServiceClient( + const client = new videoIntelligence.v1p1beta1.VideoIntelligenceServiceClient( { // optional auth parameters. } ); - let inputUri = 'gs://demomaker/cat.mp4'; - let featuresElement = 'LABEL_DETECTION'; - let features = [featuresElement]; - let request = { + const inputUri = 'gs://demomaker/cat.mp4'; + const featuresElement = 'LABEL_DETECTION'; + const features = [featuresElement]; + const request = { inputUri: inputUri, features: features, }; @@ -83,8 +83,8 @@ describe('VideoIntelligenceServiceSmokeTest', () => { client .annotateVideo(request) .then(responses => { - let operation = responses[0]; - let initialApiResponse = responses[1]; + const operation = responses[0]; + const initialApiResponse = responses[1]; // Adding a listener for the "complete" event starts polling for the // completion of the operation.