diff --git a/packages/google-cloud-language/.eslintrc.yml b/packages/google-cloud-language/.eslintrc.yml index 65f1dce6c0c..73eeec27612 100644 --- a/packages/google-cloud-language/.eslintrc.yml +++ b/packages/google-cloud-language/.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-language/smoke-test/language_service_smoke_test.js b/packages/google-cloud-language/smoke-test/language_service_smoke_test.js index 8acc7ed10ff..2a3d5f7e2dd 100644 --- a/packages/google-cloud-language/smoke-test/language_service_smoke_test.js +++ b/packages/google-cloud-language/smoke-test/language_service_smoke_test.js @@ -28,7 +28,8 @@ describe('LanguageServiceSmokeTest', () => { content: content, type: type, }; - client.analyzeSentiment({document: document}) + client + .analyzeSentiment({document: document}) .then(responses => { const response = responses[0]; console.log(response); diff --git a/packages/google-cloud-language/src/v1/language_service_client.js b/packages/google-cloud-language/src/v1/language_service_client.js index 74309f84520..bb988b69079 100644 --- a/packages/google-cloud-language/src/v1/language_service_client.js +++ b/packages/google-cloud-language/src/v1/language_service_client.js @@ -127,7 +127,7 @@ class LanguageServiceClient { 'classifyText', 'annotateText', ]; - for (let methodName of languageServiceStubMethods) { + for (const methodName of languageServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( languageServiceStub.then( stub => diff --git a/packages/google-cloud-language/src/v1beta2/language_service_client.js b/packages/google-cloud-language/src/v1beta2/language_service_client.js index 75007fe8782..8f15b038512 100644 --- a/packages/google-cloud-language/src/v1beta2/language_service_client.js +++ b/packages/google-cloud-language/src/v1beta2/language_service_client.js @@ -127,7 +127,7 @@ class LanguageServiceClient { 'classifyText', 'annotateText', ]; - for (let methodName of languageServiceStubMethods) { + for (const methodName of languageServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( languageServiceStub.then( stub => diff --git a/packages/google-cloud-language/system-test/language_service_smoke_test.js b/packages/google-cloud-language/system-test/language_service_smoke_test.js index ab60d5b6ab1..7d34a4b3606 100644 --- a/packages/google-cloud-language/system-test/language_service_smoke_test.js +++ b/packages/google-cloud-language/system-test/language_service_smoke_test.js @@ -18,20 +18,20 @@ describe('LanguageServiceSmokeTest', () => { it('successfully makes a call to the service', done => { const language = require('../src'); - let client = new language.v1.LanguageServiceClient({ + const client = new language.v1.LanguageServiceClient({ // optional auth parameters. }); - let content = 'Hello, world!'; - let type = 'PLAIN_TEXT'; - let document = { + const content = 'Hello, world!'; + const type = 'PLAIN_TEXT'; + const document = { content: content, type: type, }; client .analyzeSentiment({document: document}) .then(responses => { - let response = responses[0]; + const response = responses[0]; console.log(response); }) .then(done)