From bfb2ab16b02fc5564b40d17645fd152e030616ba Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 18 Sep 2018 15:57:58 -0700 Subject: [PATCH] Fix the linter (#154) --- packages/google-cloud-compute/package.json | 3 ++- packages/google-cloud-compute/test/address.js | 2 +- packages/google-cloud-compute/test/autoscaler.js | 2 +- packages/google-cloud-compute/test/disk.js | 2 +- packages/google-cloud-compute/test/firewall.js | 2 +- packages/google-cloud-compute/test/image.js | 2 +- packages/google-cloud-compute/test/instance-group.js | 2 +- packages/google-cloud-compute/test/network.js | 2 +- packages/google-cloud-compute/test/service.js | 2 +- packages/google-cloud-compute/test/snapshot.js | 2 +- packages/google-cloud-compute/test/subnetwork.js | 2 +- packages/google-cloud-compute/test/vm.js | 11 +++++------ 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-compute/package.json b/packages/google-cloud-compute/package.json index 3b9875ca7e3..71360c73870 100644 --- a/packages/google-cloud-compute/package.json +++ b/packages/google-cloud-compute/package.json @@ -59,7 +59,8 @@ "samples-test": "cd samples/ && npm link ../ && cd startup-script && npm link ../../ && cd ../ && npm test && cd ../", "system-test": "mocha system-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", - "test": "npm run cover" + "test": "npm run cover", + "fix": "eslint --fix **/*.js && npm run prettier" }, "dependencies": { "@google-cloud/common": "^0.17.0", diff --git a/packages/google-cloud-compute/test/address.js b/packages/google-cloud-compute/test/address.js index f0c6f8b737e..5aaaffa982c 100644 --- a/packages/google-cloud-compute/test/address.js +++ b/packages/google-cloud-compute/test/address.js @@ -75,7 +75,7 @@ describe('Address', function() { }); it('should inherit from ServiceObject', function(done) { - var regionInstance = extend({}, REGION, { + const regionInstance = extend({}, REGION, { createAddress: { bind: function(context) { assert.strictEqual(context, regionInstance); diff --git a/packages/google-cloud-compute/test/autoscaler.js b/packages/google-cloud-compute/test/autoscaler.js index 3c7aee589e2..5fa3a088d7b 100644 --- a/packages/google-cloud-compute/test/autoscaler.js +++ b/packages/google-cloud-compute/test/autoscaler.js @@ -81,7 +81,7 @@ describe('Autoscaler', function() { it('should inherit from ServiceObject', function() { let createMethod = util.noop; - var zoneInstance = extend({}, ZONE, { + const zoneInstance = extend({}, ZONE, { createAutoscaler: { bind: function(context) { assert.strictEqual(context, zoneInstance); diff --git a/packages/google-cloud-compute/test/disk.js b/packages/google-cloud-compute/test/disk.js index aa33a346240..1fc7bbaa198 100644 --- a/packages/google-cloud-compute/test/disk.js +++ b/packages/google-cloud-compute/test/disk.js @@ -113,7 +113,7 @@ describe('Disk', function() { }); it('should inherit from ServiceObject', function(done) { - var zoneInstance = extend({}, ZONE, { + const zoneInstance = extend({}, ZONE, { createDisk: { bind: function(context) { assert.strictEqual(context, zoneInstance); diff --git a/packages/google-cloud-compute/test/firewall.js b/packages/google-cloud-compute/test/firewall.js index 49c989ed237..9803afa7fc5 100644 --- a/packages/google-cloud-compute/test/firewall.js +++ b/packages/google-cloud-compute/test/firewall.js @@ -81,7 +81,7 @@ describe('Firewall', function() { }); it('should inherit from ServiceObject', function() { - var computeInstance = extend({}, COMPUTE, { + const computeInstance = extend({}, COMPUTE, { createFirewall: { bind: function(context) { assert.strictEqual(context, computeInstance); diff --git a/packages/google-cloud-compute/test/image.js b/packages/google-cloud-compute/test/image.js index 3e22aa75d19..7206f80973a 100644 --- a/packages/google-cloud-compute/test/image.js +++ b/packages/google-cloud-compute/test/image.js @@ -70,7 +70,7 @@ describe('Image', function() { }); it('should inherit from ServiceObject', function() { - var computeInstance = extend({}, COMPUTE, { + const computeInstance = extend({}, COMPUTE, { createImage: { bind: function(context) { assert.strictEqual(context, computeInstance); diff --git a/packages/google-cloud-compute/test/instance-group.js b/packages/google-cloud-compute/test/instance-group.js index 28957db27bd..900a2079af0 100644 --- a/packages/google-cloud-compute/test/instance-group.js +++ b/packages/google-cloud-compute/test/instance-group.js @@ -110,7 +110,7 @@ describe('InstanceGroup', function() { it('should inherit from ServiceObject', function(done) { let instanceGroup; - var zoneInstance = extend({}, ZONE, { + const zoneInstance = extend({}, ZONE, { createInstanceGroup: { bind: function(context) { assert.strictEqual(context, zoneInstance); diff --git a/packages/google-cloud-compute/test/network.js b/packages/google-cloud-compute/test/network.js index b2e98750403..82292b410fc 100644 --- a/packages/google-cloud-compute/test/network.js +++ b/packages/google-cloud-compute/test/network.js @@ -109,7 +109,7 @@ describe('Network', function() { }); it('should inherit from ServiceObject', function(done) { - var computeInstance = extend({}, COMPUTE, { + const computeInstance = extend({}, COMPUTE, { createNetwork: { bind: function(context) { assert.strictEqual(context, computeInstance); diff --git a/packages/google-cloud-compute/test/service.js b/packages/google-cloud-compute/test/service.js index 822cea225e6..fdb11835779 100644 --- a/packages/google-cloud-compute/test/service.js +++ b/packages/google-cloud-compute/test/service.js @@ -79,7 +79,7 @@ describe('Service', function() { it('should inherit from ServiceObject', function() { let createMethod = util.noop; - var computeInstance = extend({}, COMPUTE, { + const computeInstance = extend({}, COMPUTE, { createService: { bind: function(context) { assert.strictEqual(context, computeInstance); diff --git a/packages/google-cloud-compute/test/snapshot.js b/packages/google-cloud-compute/test/snapshot.js index 783b0c5e174..8ffdffda32f 100644 --- a/packages/google-cloud-compute/test/snapshot.js +++ b/packages/google-cloud-compute/test/snapshot.js @@ -89,7 +89,7 @@ describe('Snapshot', function() { }); it('should allow creating for a Disk object snapshot', function(done) { - var scope = { + const scope = { constructor: { name: 'Disk', }, diff --git a/packages/google-cloud-compute/test/subnetwork.js b/packages/google-cloud-compute/test/subnetwork.js index e3826389e93..d9c39cb9024 100644 --- a/packages/google-cloud-compute/test/subnetwork.js +++ b/packages/google-cloud-compute/test/subnetwork.js @@ -75,7 +75,7 @@ describe('Subnetwork', function() { it('should inherit from ServiceObject', function() { let createSubnetworkBound = {}; - var regionInstance = extend({}, REGION, { + const regionInstance = extend({}, REGION, { createSubnetwork: { bind: function(context) { assert.strictEqual(context, regionInstance); diff --git a/packages/google-cloud-compute/test/vm.js b/packages/google-cloud-compute/test/vm.js index a904dc78b6f..38b091f2163 100644 --- a/packages/google-cloud-compute/test/vm.js +++ b/packages/google-cloud-compute/test/vm.js @@ -123,7 +123,7 @@ describe('VM', function() { }); it('should inherit from ServiceObject', function(done) { - var zoneInstance = extend({}, ZONE, { + const zoneInstance = extend({}, ZONE, { createVM: { bind: function(context) { assert.strictEqual(context, zoneInstance); @@ -150,7 +150,6 @@ describe('VM', function() { }); describe('attachDisk', function() { - let CONFIG = {}; let EXPECTED_BODY; beforeEach(function() { @@ -162,12 +161,12 @@ describe('VM', function() { it('should throw if a Disk object is not provided', function() { assert.throws(function() { - vm.attachDisk('disk-3', CONFIG, assert.ifError); + vm.attachDisk('disk-3', {}, assert.ifError); }, /A Disk object must be provided/); assert.doesNotThrow(function() { vm.request = util.noop; - vm.attachDisk(DISK, CONFIG, assert.ifError); + vm.attachDisk(DISK, {}, assert.ifError); }); }); @@ -181,7 +180,7 @@ describe('VM', function() { }); describe('options.readOnly', function() { - var CONFIG = extend({}, CONFIG, {readOnly: true}); + const CONFIG = {readOnly: true}; it('should set the correct mode', function(done) { let expectedBody = extend({}, EXPECTED_BODY, {mode: 'READ_ONLY'}); @@ -213,7 +212,7 @@ describe('VM', function() { callback(); }; - vm.attachDisk(DISK, CONFIG, done); + vm.attachDisk(DISK, {}, done); }); });