From 5c1e976b2fe31126f715f7235b943f004dd01fcb Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 31 Aug 2015 16:02:31 +0700 Subject: [PATCH] add XO --- .jshintrc | 12 ------------ index.js | 2 +- package.json | 5 +++-- test/test-gzip.js | 2 +- 4 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 .jshintrc diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 9fe1be2..0000000 --- a/.jshintrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "node": true, - "esnext": true, - "bitwise": true, - "curly": true, - "immed": true, - "newcap": true, - "noarg": true, - "undef": true, - "unused": "vars", - "strict": true -} diff --git a/index.js b/index.js index 749568b..c3aa329 100644 --- a/index.js +++ b/index.js @@ -235,7 +235,7 @@ function got(url, opts, cb) { if (cb) { asCallback(opts, cb); - return; + return null; } return asPromise(opts); diff --git a/package.json b/package.json index 1a25d12..df462a9 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "node": ">=0.10.0" }, "scripts": { - "test": "tap test/test-*.js" + "test": "xo && tap test/test-*.js" }, "files": [ "index.js" @@ -60,6 +60,7 @@ "into-stream": "^2.0.0", "istanbul": "^0.3.13", "pem": "^1.4.4", - "tap": "^1.0.0" + "tap": "^1.0.0", + "xo": "*" } } diff --git a/test/test-gzip.js b/test/test-gzip.js index 86c6a7c..e877bff 100644 --- a/test/test-gzip.js +++ b/test/test-gzip.js @@ -10,7 +10,7 @@ s.on('/', function (req, res) { res.statusCode = 200; res.setHeader('Content-Type', 'text/plain'); res.setHeader('Content-Encoding', 'gzip'); - zlib.gzip(testContent, function (err, data) { + zlib.gzip(testContent, function (_, data) { res.end(data); }); });