Skip to content

Commit

Permalink
Enable no-var in eslint (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Sep 18, 2018
1 parent 9d39f00 commit 3d6f4f8
Show file tree
Hide file tree
Showing 25 changed files with 556 additions and 555 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ rules:
block-scoped-var: error
eqeqeq: error
no-warning-comments: warn
no-var: error
2 changes: 1 addition & 1 deletion samples/hello-world/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (!GCLOUD_PROJECT) {
throw new Error('Environment variables GCLOUD_PROJECT must be set!');
}

var bigtableOptions = {
let bigtableOptions = {
projectId: GCLOUD_PROJECT,
};

Expand Down
2 changes: 1 addition & 1 deletion samples/hello-world/index.v6.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (!GCLOUD_PROJECT) {
throw new Error('Environment variables GCLOUD_PROJECT must be set!');
}

var bigtableOptions = {
let bigtableOptions = {
projectId: GCLOUD_PROJECT,
};

Expand Down
2 changes: 1 addition & 1 deletion samples/instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (!GCLOUD_PROJECT) {
throw new Error('Environment variables GCLOUD_PROJECT must be set!');
}

var bigtableOptions = {
let bigtableOptions = {
projectId: GCLOUD_PROJECT,
};

Expand Down
2 changes: 1 addition & 1 deletion samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (!GCLOUD_PROJECT) {

(async () => {
try {
var bigtableOptions = {
let bigtableOptions = {
projectId: GCLOUD_PROJECT,
};

Expand Down
2 changes: 1 addition & 1 deletion samples/tableadmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (!GCLOUD_PROJECT) {
throw new Error('Environment variables GCLOUD_PROJECT must be set!');
}

var bigtableOptions = {
let bigtableOptions = {
projectId: GCLOUD_PROJECT,
};

Expand Down
2 changes: 1 addition & 1 deletion src/app-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AppProfile {
this.bigtable = instance.bigtable;
this.instance = instance;

var name;
let name;

if (id.includes('/')) {
if (id.startsWith(`${instance.name}/appProfiles/`)) {
Expand Down
2 changes: 1 addition & 1 deletion src/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Cluster {
this.bigtable = instance.bigtable;
this.instance = instance;

var name;
let name;

if (id.includes('/')) {
if (id.startsWith(`${instance.name}/clusters/`)) {
Expand Down
2 changes: 1 addition & 1 deletion src/family.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Family {
this.bigtable = table.bigtable;
this.table = table;

var name;
let name;
if (id.includes('/')) {
if (id.startsWith(`${table.name}/columnFamilies/`)) {
name = id;
Expand Down
2 changes: 1 addition & 1 deletion src/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Instance {
constructor(bigtable, id) {
this.bigtable = bigtable;

var name;
let name;
if (id.includes('/')) {
if (id.startsWith(`${bigtable.projectName}/instances/`)) {
name = id;
Expand Down
2 changes: 1 addition & 1 deletion src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Table {
this.bigtable = instance.bigtable;
this.instance = instance;

var name;
let name;

if (id.includes('/')) {
if (id.startsWith(`${instance.name}/tables/`)) {
Expand Down
36 changes: 18 additions & 18 deletions src/v2/bigtable_instance_admin_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ class BigtableInstanceAdminClient {
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
var gaxGrpc = new gax.GrpcClient(opts);
let 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.
var clientHeader = [
let clientHeader = [
`gl-node/${process.version.node}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
Expand All @@ -91,7 +91,7 @@ class BigtableInstanceAdminClient {
}

// Load the applicable protos.
var protos = merge(
let protos = merge(
{},
gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
Expand Down Expand Up @@ -128,7 +128,7 @@ class BigtableInstanceAdminClient {
'appProfiles'
),
};
var protoFilesRoot = new gax.GoogleProtoFilesRoot();
let protoFilesRoot = new gax.GoogleProtoFilesRoot();
protoFilesRoot = protobuf.loadSync(
path.join(
__dirname,
Expand All @@ -148,34 +148,34 @@ class BigtableInstanceAdminClient {
grpc: gaxGrpc.grpc,
}).operationsClient(opts);

var createInstanceResponse = protoFilesRoot.lookup(
let createInstanceResponse = protoFilesRoot.lookup(
'google.bigtable.admin.v2.Instance'
);
var createInstanceMetadata = protoFilesRoot.lookup(
let createInstanceMetadata = protoFilesRoot.lookup(
'google.bigtable.admin.v2.CreateInstanceMetadata'
);
var partialUpdateInstanceResponse = protoFilesRoot.lookup(
let partialUpdateInstanceResponse = protoFilesRoot.lookup(
'google.bigtable.admin.v2.Instance'
);
var partialUpdateInstanceMetadata = protoFilesRoot.lookup(
let partialUpdateInstanceMetadata = protoFilesRoot.lookup(
'google.bigtable.admin.v2.UpdateInstanceMetadata'
);
var createClusterResponse = protoFilesRoot.lookup(
let createClusterResponse = protoFilesRoot.lookup(
'google.bigtable.admin.v2.Cluster'
);
var createClusterMetadata = protoFilesRoot.lookup(
let createClusterMetadata = protoFilesRoot.lookup(
'google.bigtable.admin.v2.CreateClusterMetadata'
);
var updateClusterResponse = protoFilesRoot.lookup(
let updateClusterResponse = protoFilesRoot.lookup(
'google.bigtable.admin.v2.Cluster'
);
var updateClusterMetadata = protoFilesRoot.lookup(
let updateClusterMetadata = protoFilesRoot.lookup(
'google.bigtable.admin.v2.UpdateClusterMetadata'
);
var updateAppProfileResponse = protoFilesRoot.lookup(
let updateAppProfileResponse = protoFilesRoot.lookup(
'google.bigtable.admin.v2.AppProfile'
);
var updateAppProfileMetadata = protoFilesRoot.lookup(
let updateAppProfileMetadata = protoFilesRoot.lookup(
'google.bigtable.admin.v2.UpdateAppProfileMetadata'
);

Expand Down Expand Up @@ -210,7 +210,7 @@ class BigtableInstanceAdminClient {
};

// Put together the default options sent with requests.
var defaults = gaxGrpc.constructSettings(
let defaults = gaxGrpc.constructSettings(
'google.bigtable.admin.v2.BigtableInstanceAdmin',
gapicConfig,
opts.clientConfig,
Expand All @@ -224,14 +224,14 @@ class BigtableInstanceAdminClient {

// Put together the "service stub" for
// google.bigtable.admin.v2.BigtableInstanceAdmin.
var bigtableInstanceAdminStub = gaxGrpc.createStub(
let bigtableInstanceAdminStub = gaxGrpc.createStub(
protos.google.bigtable.admin.v2.BigtableInstanceAdmin,
opts
);

// Iterate over each of the methods that the service provides
// and create an API call method for each.
var bigtableInstanceAdminStubMethods = [
let bigtableInstanceAdminStubMethods = [
'createInstance',
'getInstance',
'listInstances',
Expand All @@ -257,7 +257,7 @@ class BigtableInstanceAdminClient {
bigtableInstanceAdminStub.then(
stub =>
function() {
var args = Array.prototype.slice.call(arguments, 0);
let args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
}
),
Expand Down
24 changes: 12 additions & 12 deletions src/v2/bigtable_table_admin_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ class BigtableTableAdminClient {
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
var gaxGrpc = new gax.GrpcClient(opts);
let 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.
var clientHeader = [
let clientHeader = [
`gl-node/${process.version.node}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
Expand All @@ -93,7 +93,7 @@ class BigtableTableAdminClient {
}

// Load the applicable protos.
var protos = merge(
let protos = merge(
{},
gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
Expand Down Expand Up @@ -134,7 +134,7 @@ class BigtableTableAdminClient {
'snapshots'
),
};
var protoFilesRoot = new gax.GoogleProtoFilesRoot();
let protoFilesRoot = new gax.GoogleProtoFilesRoot();
protoFilesRoot = protobuf.loadSync(
path.join(
__dirname,
Expand All @@ -154,16 +154,16 @@ class BigtableTableAdminClient {
grpc: gaxGrpc.grpc,
}).operationsClient(opts);

var createTableFromSnapshotResponse = protoFilesRoot.lookup(
let createTableFromSnapshotResponse = protoFilesRoot.lookup(
'google.bigtable.admin.v2.Table'
);
var createTableFromSnapshotMetadata = protoFilesRoot.lookup(
let createTableFromSnapshotMetadata = protoFilesRoot.lookup(
'google.bigtable.admin.v2.CreateTableFromSnapshotMetadata'
);
var snapshotTableResponse = protoFilesRoot.lookup(
let snapshotTableResponse = protoFilesRoot.lookup(
'google.bigtable.admin.v2.Snapshot'
);
var snapshotTableMetadata = protoFilesRoot.lookup(
let snapshotTableMetadata = protoFilesRoot.lookup(
'google.bigtable.admin.v2.SnapshotTableMetadata'
);

Expand All @@ -185,7 +185,7 @@ class BigtableTableAdminClient {
};

// Put together the default options sent with requests.
var defaults = gaxGrpc.constructSettings(
let defaults = gaxGrpc.constructSettings(
'google.bigtable.admin.v2.BigtableTableAdmin',
gapicConfig,
opts.clientConfig,
Expand All @@ -199,14 +199,14 @@ class BigtableTableAdminClient {

// Put together the "service stub" for
// google.bigtable.admin.v2.BigtableTableAdmin.
var bigtableTableAdminStub = gaxGrpc.createStub(
let bigtableTableAdminStub = gaxGrpc.createStub(
protos.google.bigtable.admin.v2.BigtableTableAdmin,
opts
);

// Iterate over each of the methods that the service provides
// and create an API call method for each.
var bigtableTableAdminStubMethods = [
let bigtableTableAdminStubMethods = [
'createTable',
'createTableFromSnapshot',
'listTables',
Expand All @@ -226,7 +226,7 @@ class BigtableTableAdminClient {
bigtableTableAdminStub.then(
stub =>
function() {
var args = Array.prototype.slice.call(arguments, 0);
let args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
}
),
Expand Down
Loading

0 comments on commit 3d6f4f8

Please sign in to comment.