From 6b23561d97438705f8c1d085dfffb495eaa3cda9 Mon Sep 17 00:00:00 2001 From: keik Date: Tue, 4 Oct 2016 16:43:45 +0900 Subject: [PATCH 1/2] Remove duplicated lint rules --- .eslintrc | 2 -- 1 file changed, 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 71199da..f169c3f 100755 --- a/.eslintrc +++ b/.eslintrc @@ -24,7 +24,6 @@ "no-negated-in-lhs": 2, "no-obj-calls": 2, "no-regex-spaces": 2, - "quote-props": [1, "consistent-as-needed"], "no-sparse-arrays": 2, "no-unreachable": 2, "use-isnan": 2, @@ -219,7 +218,6 @@ ] } ], - "array-bracket-spacing": [1, "never"], "wrap-regex": 0, "constructor-super": 2, "no-this-before-super": 2, From 67edb36fd85d1f9e24d56fdad8b0f0e37f6bc112 Mon Sep 17 00:00:00 2001 From: keik Date: Tue, 4 Oct 2016 16:43:58 +0900 Subject: [PATCH 2/2] Fix to pass lint --- .eslintrc | 2 +- index.js | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.eslintrc b/.eslintrc index f169c3f..ef37a41 100755 --- a/.eslintrc +++ b/.eslintrc @@ -91,7 +91,7 @@ 2, "all" ], - "no-use-before-define": 2, + "no-use-before-define": 0, "handle-callback-err": 2, "no-mixed-requires": 0, "no-new-require": 2, diff --git a/index.js b/index.js index c3ce681..93172bb 100644 --- a/index.js +++ b/index.js @@ -203,9 +203,8 @@ module.exports = function (browserify, options) { function addHooks () { browserify.pipeline.get('pack').push(through(function write (row, enc, next) { - next(null, row) + next(null, row); }, function end (cb) { - // on each bundle, create a new stream b/c the old one might have ended var compiledCssStream = new ReadableStream(); compiledCssStream._read = function () {}; @@ -221,7 +220,7 @@ module.exports = function (browserify, options) { compiledCssStream.push(css); compiledCssStream.push(null); - const writes = []; + var writes = []; // write the css file if (cssOutFilename) { @@ -234,7 +233,7 @@ module.exports = function (browserify, options) { } Promise.all(writes) .then(function () { cb(); }) - .catch(function (err) { self.emit('error', err); cb() }) + .catch(function (err) { self.emit('error', err); cb(); }); })); } @@ -244,13 +243,11 @@ module.exports = function (browserify, options) { return browserify; }; -function writeFile(filename, content) { +function writeFile (filename, content) { return new Promise(function (resolve, reject) { fs.writeFile(filename, content, function (err) { - if (err) - reject(err); - else - resolve(); + if (err) reject(err); + else resolve(); }); }); }