Skip to content

Commit

Permalink
Enable prefer-const in the eslint config (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored and alexander-fenster committed Sep 20, 2018
1 parent 3d6f4f8 commit 78b62ac
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
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
6 changes: 3 additions & 3 deletions samples/document-snippets/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const snippets = {
instance
.create(options)
.then(result => {
let newInstance = result[0];
const newInstance = result[0];
// let operations = result[1];
// let apiResponse = result[2];

Expand Down Expand Up @@ -269,7 +269,7 @@ const snippets = {
.getTables(options)
.then(result => {
console.log(`Tables:`);
let tables = result[0];
const tables = result[0];
tables.forEach(t => {
console.log(t.id);
});
Expand All @@ -286,7 +286,7 @@ const snippets = {
const instance = bigtable.instance(instanceId);

// [START bigtable_set_meta_data]
let metadata = {
const metadata = {
displayName: 'updated-name',
};

Expand Down
2 changes: 1 addition & 1 deletion samples/document-snippets/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const instanceSnippets = require('./instance.js');

describe('Instance Snippets', function() {
after(function(done) {
let instance = bigtable.instance(INSTANCE_ID);
const instance = bigtable.instance(INSTANCE_ID);
instance.delete(done);
});

Expand Down
4 changes: 2 additions & 2 deletions 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!');
}

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

Expand Down Expand Up @@ -83,7 +83,7 @@ const getRowGreeting = row => {
];

console.log('Reading a single row by row key');
let [singeRow] = await table.row('greeting0').get({filter});
const [singeRow] = await table.row('greeting0').get({filter});
console.log(`\tRead: ${getRowGreeting(singeRow)}`);

console.log('Reading the entire table');
Expand Down
4 changes: 2 additions & 2 deletions 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!');
}

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

Expand Down Expand Up @@ -87,7 +87,7 @@ co(function*() {
];

console.log('Reading a single row by row key');
let [singeRow] = yield table.row('greeting0').get({filter});
const [singeRow] = yield table.row('greeting0').get({filter});
console.log(`\tRead: ${getRowGreeting(singeRow)}`);

console.log('Reading the entire table');
Expand Down
4 changes: 2 additions & 2 deletions 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!');
}

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

Expand Down Expand Up @@ -142,7 +142,7 @@ async function createDevInstance(instanceID, clusterID) {

// Create development instance with given options
try {
let [instance] = await bigtable.createInstance(instanceID, options);
const [instance] = await bigtable.createInstance(instanceID, options);
console.log(`Created development instance: ${instance.id}`);
} catch (err) {
console.error('Error creating dev-instance:', err);
Expand Down
4 changes: 2 additions & 2 deletions samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (!GCLOUD_PROJECT) {

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

Expand All @@ -46,7 +46,7 @@ if (!GCLOUD_PROJECT) {
const table = instance.table(TABLE_ID);

// Read a row from my-table using a row key
let [singleRow] = await table.row('r1').get();
const [singleRow] = await table.row('r1').get();

// Print the row key and data (column value, labels, timestamp)
console.log(
Expand Down
4 changes: 2 additions & 2 deletions 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!');
}

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

Expand Down Expand Up @@ -62,7 +62,7 @@ async function runTableOperations(instanceID, tableID) {
// [START bigtable_list_tables]
// List tables in current project
try {
let [tables] = await instance.getTables();
const [tables] = await instance.getTables();
tables.forEach(table => {
console.log(table.id);
});
Expand Down

0 comments on commit 78b62ac

Please sign in to comment.