Skip to content

Commit

Permalink
fixed some linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdf committed Mar 18, 2016
1 parent 147585d commit 37f700b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
"array-bracket-spacing": 2,
"block-spacing": 2,
"comma-spacing": 2,
"comma-dangle": [2, "always-multiline"],
"computed-property-spacing": 2,
"eol-last": 2,
"indent": [2, 2],
Expand Down
8 changes: 1 addition & 7 deletions lib/BrowserifyCache.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
var fs = require('fs');
var path = require('path');
var util = require('util');
var assert = require('assert');
var splicer = require('labeled-stream-splicer');
var through = require('through2');
var async = require('async');
var assign = require('xtend/mutable');

var assertExists = require('./assertExists');
Expand Down Expand Up @@ -69,13 +65,11 @@ BrowserifyCache.getPackageCache = function(b) {
};

function attachCacheHooksToPipeline(b) {
var cache = BrowserifyCache.getCache(b);

var prevBundle = b.bundle;
b.bundle = function(cb) {
var outputStream = through.obj();

invalidateCacheBeforeBundling(b, function(err, invalidated) {
invalidateCacheBeforeBundling(b, function(err) {
if (err) return outputStream.emit('error', err);

var bundleStream = prevBundle.call(b, cb);
Expand Down
2 changes: 1 addition & 1 deletion lib/invalidateDependentFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function invalidateDependentFiles(cache, invalidatedModules, done) {
Object.keys(dependentFiles[dependentFile]).forEach(function(module) {
delete cache.modules[module];
})
}, function(err, invalidated, deleted) { done(err); });
}, function(err) { done(err); });
}

module.exports = invalidateDependentFiles;
4 changes: 2 additions & 2 deletions lib/invalidateFilesPackagePaths.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var fs = require('fs');
var path = require('path');
var assert = require('assert');
var async = require('async');

var assertExists = require('./assertExists');
var packageFileForPackagePath = require('./packageFilePathUtils').packageFileForPackagePath;

// this is a big complex blob of code to deal with the small edge case where
// the package associated with a file changes (due to the addition or deletion
Expand Down Expand Up @@ -66,7 +66,7 @@ function invalidateFilesPackagePaths(filesPackagePaths, done) {
});
}, pkgdirDone);
});
}, function(err) { done(null); }); // don't really care about errors
}, function() { done(null); }); // don't really care about errors
}

// get all directories between a common base and a list of files
Expand Down
2 changes: 1 addition & 1 deletion lib/invalidateModifiedFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function invalidateModifiedFiles(mtimes, files, invalidate, done) {
mtimes[file] = mtimeNew;
fileDone();
});
}, function(err) {
}, function() {
done(null, invalidated, deleted);
});
}
Expand Down
11 changes: 2 additions & 9 deletions lib/invalidatePackageCache.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var assertExists = require('./assertExists');
var invalidateModifiedFiles = require('./invalidateModifiedFiles');
var packagePathForPackageFile = require('./packageFilePathUtils').packagePathForPackageFile;
var packageFileForPackagePath = require('./packageFilePathUtils').packageFileForPackagePath;

function invalidatePackageCache(mtimes, cache, done) {
assertExists(mtimes);
Expand All @@ -9,14 +11,5 @@ function invalidatePackageCache(mtimes, cache, done) {
}, done)
}

var packagePathTrimLength = '/package.json'.length;

function packagePathForPackageFile(packageFilepath) {
packageFilepath.slice(0, packageFilepath.length - packageFileTrimLength);
}

function packageFileForPackagePath(packagePath) {
return path.join(packagePath, 'package.json');
}

module.exports = invalidatePackageCache;
15 changes: 15 additions & 0 deletions lib/packageFilePathUtils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var path = require('path');
var packagePathTrimLength = '/package.json'.length;

function packagePathForPackageFile(packageFilepath) {
packageFilepath.slice(0, packageFilepath.length - packagePathTrimLength);
}

function packageFileForPackagePath(packagePath) {
return path.join(packagePath, 'package.json');
}

module.exports = {
packageFileForPackagePath,
packagePathForPackageFile,
};

0 comments on commit 37f700b

Please sign in to comment.