diff --git a/.jshintrc b/.jshintrc index a0f3b329d5..a8e226dd4b 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,7 +1,15 @@ { - "camelcase" : true, - "indent" : 2, - "strict" : true, - "globalstrict" : true, - "node" : true + "camelcase" : true, + "curly": true, + "eqeqeq": true, + "globalstrict": true, + "indent": 2, + "newcap": true, + "maxlen": 80, + "node": true, + "quotmark": "single", + "strict": true, + "trailing": true, + "undef": true, + "unused": true } diff --git a/.travis.yml b/.travis.yml index e0e240713d..bb21749e75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,4 +40,4 @@ install: #Use '-q' to disable interactive prompts script: -#Test and/or deploy your app with gcloud commands here! + - jshint --exclude-path=.gitignore . diff --git a/cloud-storage/authSample.js b/cloud-storage/authSample.js index 74df3060e1..46de8743fd 100644 --- a/cloud-storage/authSample.js +++ b/cloud-storage/authSample.js @@ -2,6 +2,7 @@ * @fileoverview Sample code that grabs default credentials from the * environment, then uses it to make an api call. */ +'use strict'; var google = require('googleapis'); diff --git a/package.json b/package.json index f1814da17a..dfdac6c92c 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ }, "devDependencies": { "mocha": "~2.2.5", + "jshint": "~2.8.0", "lodash": "~3.10.1" }, "repository": { diff --git a/test/.jshintrc b/test/.jshintrc new file mode 100644 index 0000000000..e26f0d4bc7 --- /dev/null +++ b/test/.jshintrc @@ -0,0 +1,4 @@ +{ + "extends": "../.jshintrc", + "mocha": true +} diff --git a/test/cloud-storage/testAuthSample.js b/test/cloud-storage/testAuthSample.js index 22049f8914..1608b1b535 100644 --- a/test/cloud-storage/testAuthSample.js +++ b/test/cloud-storage/testAuthSample.js @@ -1,14 +1,15 @@ /** * @fileoverview Tests for the list-buckets module. */ +'use strict'; -var assert = require("assert"); +var assert = require('assert'); var _ = require('lodash'); -var authSample = require("../../cloud-storage/authSample"); +var authSample = require('../../cloud-storage/authSample'); describe('listBuckets', function() { - it('returns a list of buckets', function (done) { + it('returns a list of buckets', function(done) { authSample.listBuckets( process.env.TEST_PROJECT_ID, function(error, success) { @@ -17,7 +18,7 @@ describe('listBuckets', function() { } else { assert(success.items.length > 0); assert(_.find(success.items, function(item) { - return item.name == process.env.TEST_BUCKET_NAME; + return item.name === process.env.TEST_BUCKET_NAME; })); done(); }