Skip to content

Commit 120dda5

Browse files
JustinBeckwithalexander-fenster
authored andcommitted
Enable prefer-const in the eslint config (#102)
1 parent f83fa71 commit 120dda5

8 files changed

+24
-23
lines changed

packages/google-cloud-videointelligence/.eslintrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ rules:
1212
eqeqeq: error
1313
no-warning-comments: warn
1414
no-var: error
15+
prefer-const: error

packages/google-cloud-videointelligence/smoke-test/video_intelligence_service_smoke_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
'use strict';
1616

1717
describe('VideoIntelligenceServiceSmokeTest', () => {
18-
$unhandledCase: LongRunningOptionalArrayMethod$
18+
LongRunningOptionalArrayMethod$;
1919
});

packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient {
154154
// Iterate over each of the methods that the service provides
155155
// and create an API call method for each.
156156
const videoIntelligenceServiceStubMethods = ['annotateVideo'];
157-
for (let methodName of videoIntelligenceServiceStubMethods) {
157+
for (const methodName of videoIntelligenceServiceStubMethods) {
158158
this._innerApiCalls[methodName] = gax.createApiCall(
159159
videoIntelligenceServiceStub.then(
160160
stub =>

packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient {
154154
// Iterate over each of the methods that the service provides
155155
// and create an API call method for each.
156156
const videoIntelligenceServiceStubMethods = ['annotateVideo'];
157-
for (let methodName of videoIntelligenceServiceStubMethods) {
157+
for (const methodName of videoIntelligenceServiceStubMethods) {
158158
this._innerApiCalls[methodName] = gax.createApiCall(
159159
videoIntelligenceServiceStub.then(
160160
stub =>

packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient {
154154
// Iterate over each of the methods that the service provides
155155
// and create an API call method for each.
156156
const videoIntelligenceServiceStubMethods = ['annotateVideo'];
157-
for (let methodName of videoIntelligenceServiceStubMethods) {
157+
for (const methodName of videoIntelligenceServiceStubMethods) {
158158
this._innerApiCalls[methodName] = gax.createApiCall(
159159
videoIntelligenceServiceStub.then(
160160
stub =>

packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient {
154154
// Iterate over each of the methods that the service provides
155155
// and create an API call method for each.
156156
const videoIntelligenceServiceStubMethods = ['annotateVideo'];
157-
for (let methodName of videoIntelligenceServiceStubMethods) {
157+
for (const methodName of videoIntelligenceServiceStubMethods) {
158158
this._innerApiCalls[methodName] = gax.createApiCall(
159159
videoIntelligenceServiceStub.then(
160160
stub =>

packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class VideoIntelligenceServiceClient {
154154
// Iterate over each of the methods that the service provides
155155
// and create an API call method for each.
156156
const videoIntelligenceServiceStubMethods = ['annotateVideo'];
157-
for (let methodName of videoIntelligenceServiceStubMethods) {
157+
for (const methodName of videoIntelligenceServiceStubMethods) {
158158
this._innerApiCalls[methodName] = gax.createApiCall(
159159
videoIntelligenceServiceStub.then(
160160
stub =>

packages/google-cloud-videointelligence/system-test/video_intelligence_service_smoke_test.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ describe('VideoIntelligenceServiceSmokeTest', () => {
1818
it('successfully makes a call to the service', done => {
1919
const videoIntelligence = require('../src');
2020

21-
let client = new videoIntelligence.v1p1beta1.VideoIntelligenceServiceClient(
21+
const client = new videoIntelligence.v1p1beta1.VideoIntelligenceServiceClient(
2222
{
2323
// optional auth parameters.
2424
}
2525
);
2626

27-
let inputUri = 'gs://demomaker/cat.mp4';
28-
let featuresElement = 'LABEL_DETECTION';
29-
let features = [featuresElement];
30-
let request = {
27+
const inputUri = 'gs://demomaker/cat.mp4';
28+
const featuresElement = 'LABEL_DETECTION';
29+
const features = [featuresElement];
30+
const request = {
3131
inputUri: inputUri,
3232
features: features,
3333
};
@@ -36,8 +36,8 @@ describe('VideoIntelligenceServiceSmokeTest', () => {
3636
client
3737
.annotateVideo(request)
3838
.then(responses => {
39-
let operation = responses[0];
40-
let initialApiResponse = responses[1];
39+
const operation = responses[0];
40+
const initialApiResponse = responses[1];
4141
console.log(operation);
4242
console.log(initialApiResponse);
4343

@@ -46,13 +46,13 @@ describe('VideoIntelligenceServiceSmokeTest', () => {
4646
})
4747
.then(responses => {
4848
// The final result of the operation.
49-
let result = responses[0];
49+
const result = responses[0];
5050

5151
// The metadata value of the completed operation.
52-
let metadata = responses[1];
52+
const metadata = responses[1];
5353

5454
// The response of the api call returning the complete operation.
55-
let finalApiResponse = responses[2];
55+
const finalApiResponse = responses[2];
5656

5757
console.log(result);
5858
console.log(metadata);
@@ -65,16 +65,16 @@ describe('VideoIntelligenceServiceSmokeTest', () => {
6565
it('successfully makes a call to the service', done => {
6666
const videoIntelligence = require('../src');
6767

68-
let client = new videoIntelligence.v1p1beta1.VideoIntelligenceServiceClient(
68+
const client = new videoIntelligence.v1p1beta1.VideoIntelligenceServiceClient(
6969
{
7070
// optional auth parameters.
7171
}
7272
);
7373

74-
let inputUri = 'gs://demomaker/cat.mp4';
75-
let featuresElement = 'LABEL_DETECTION';
76-
let features = [featuresElement];
77-
let request = {
74+
const inputUri = 'gs://demomaker/cat.mp4';
75+
const featuresElement = 'LABEL_DETECTION';
76+
const features = [featuresElement];
77+
const request = {
7878
inputUri: inputUri,
7979
features: features,
8080
};
@@ -83,8 +83,8 @@ describe('VideoIntelligenceServiceSmokeTest', () => {
8383
client
8484
.annotateVideo(request)
8585
.then(responses => {
86-
let operation = responses[0];
87-
let initialApiResponse = responses[1];
86+
const operation = responses[0];
87+
const initialApiResponse = responses[1];
8888

8989
// Adding a listener for the "complete" event starts polling for the
9090
// completion of the operation.

0 commit comments

Comments
 (0)