Skip to content

Commit

Permalink
Enable prefer-const in the eslint config (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored and sofisl committed Oct 13, 2022
1 parent 82170e2 commit f36183a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/google-cloud-language/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ rules:
eqeqeq: error
no-warning-comments: warn
no-var: error
prefer-const: error
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f36183a

Please sign in to comment.