Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Enable prefer-const in the eslint config #38

Merged
merged 2 commits into from
Sep 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"lint": "eslint src/ samples/ system-test/ test/",
"prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js",
"docs": "jsdoc -c .jsdoc.js",
"system-test": "mocha system-test/ smoke-test/ --timeout 600000"
"system-test": "mocha system-test/ smoke-test/ --timeout 600000",
"fix": "eslint '**/*.js' --fix && npm run prettier"
},
"dependencies": {
"google-gax": "^0.20.0",
Expand Down
24 changes: 12 additions & 12 deletions src/v1/key_management_service_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ class KeyManagementServiceClient {
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
let gaxGrpc = new gax.GrpcClient(opts);
const gaxGrpc = new gax.GrpcClient(opts);

// Save the auth object to the client, for use by other methods.
this.auth = gaxGrpc.auth;

// Determine the client header string.
let clientHeader = [
const clientHeader = [
`gl-node/${process.version}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
Expand All @@ -98,7 +98,7 @@ class KeyManagementServiceClient {
}

// Load the applicable protos.
let protos = merge(
const protos = merge(
{},
gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
Expand Down Expand Up @@ -153,7 +153,7 @@ class KeyManagementServiceClient {
};

// Put together the default options sent with requests.
let defaults = gaxGrpc.constructSettings(
const defaults = gaxGrpc.constructSettings(
'google.cloud.kms.v1.KeyManagementService',
gapicConfig,
opts.clientConfig,
Expand All @@ -167,14 +167,14 @@ class KeyManagementServiceClient {

// Put together the "service stub" for
// google.cloud.kms.v1.KeyManagementService.
let keyManagementServiceStub = gaxGrpc.createStub(
const keyManagementServiceStub = gaxGrpc.createStub(
protos.google.cloud.kms.v1.KeyManagementService,
opts
);

// Iterate over each of the methods that the service provides
// and create an API call method for each.
let keyManagementServiceStubMethods = [
const keyManagementServiceStubMethods = [
'listKeyRings',
'listCryptoKeys',
'listCryptoKeyVersions',
Expand All @@ -192,12 +192,12 @@ class KeyManagementServiceClient {
'destroyCryptoKeyVersion',
'restoreCryptoKeyVersion',
];
for (let methodName of keyManagementServiceStubMethods) {
for (const methodName of keyManagementServiceStubMethods) {
this._innerApiCalls[methodName] = gax.createApiCall(
keyManagementServiceStub.then(
stub =>
function() {
let args = Array.prototype.slice.call(arguments, 0);
const args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
}
),
Expand All @@ -208,24 +208,24 @@ class KeyManagementServiceClient {

// Put together the "service stub" for
// google.iam.v1.IAMPolicy.
let iamPolicyStub = gaxGrpc.createStub(
const iamPolicyStub = gaxGrpc.createStub(
protos.google.iam.v1.IAMPolicy,
opts
);

// Iterate over each of the methods that the service provides
// and create an API call method for each.
let iamPolicyStubMethods = [
const iamPolicyStubMethods = [
'setIamPolicy',
'getIamPolicy',
'testIamPermissions',
];
for (let methodName of iamPolicyStubMethods) {
for (const methodName of iamPolicyStubMethods) {
this._innerApiCalls[methodName] = gax.createApiCall(
iamPolicyStub.then(
stub =>
function() {
let args = Array.prototype.slice.call(arguments, 0);
const args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
}
),
Expand Down
Loading