Merge branch 'indent-fix' of https://github.com/SimenB/webpack into SimenB-indent-fix

This commit is contained in:
Tobias Koppers 2016-06-20 21:30:07 +02:00
commit e74b2f9390
10 changed files with 29 additions and 34 deletions

View File

@ -2,15 +2,11 @@
"env": { "env": {
"node": true "node": true
}, },
"plugins": [
"nodeca"
],
"rules": { "rules": {
"strict": 0, "strict": 0,
"camelcase": 0, "camelcase": 0,
"curly": 0, "curly": 0,
"indent": [0, "tab"], "indent": [2, "tab", { "SwitchCase": 1 }],
"nodeca/indent": [2, "tabs", 1 ],
"eol-last": 1, "eol-last": 1,
"no-shadow": 0, "no-shadow": 0,
"no-redeclare": 2, "no-redeclare": 2,

View File

@ -29,9 +29,9 @@ if(module.hot) {
}).catch(function(err) { }).catch(function(err) {
if(module.hot.status() in { if(module.hot.status() in {
abort: 1, abort: 1,
fail: 1 fail: 1
}) { }) {
console.warn("[HMR] Cannot apply update. Need to do a full reload!"); console.warn("[HMR] Cannot apply update. Need to do a full reload!");
console.warn("[HMR] " + err.stack || err.message); console.warn("[HMR] " + err.stack || err.message);
window.location.reload(); window.location.reload();

View File

@ -30,9 +30,9 @@ if(module.hot) {
} }
}).catch(function(err) { }).catch(function(err) {
if(module.hot.status() in { if(module.hot.status() in {
abort: 1, abort: 1,
fail: 1 fail: 1
}) { }) {
console.warn("[HMR] Cannot apply update. Need to do a full reload!"); console.warn("[HMR] Cannot apply update. Need to do a full reload!");
console.warn("[HMR] " + err.stack || err.message); console.warn("[HMR] " + err.stack || err.message);
} else { } else {
@ -41,9 +41,9 @@ if(module.hot) {
}); });
}).catch(function(err) { }).catch(function(err) {
if(module.hot.status() in { if(module.hot.status() in {
abort: 1, abort: 1,
fail: 1 fail: 1
}) { }) {
console.warn("[HMR] Cannot check for update. Need to do a full reload!"); console.warn("[HMR] Cannot check for update. Need to do a full reload!");
console.warn("[HMR] " + err.stack || err.message); console.warn("[HMR] " + err.stack || err.message);
} else { } else {

View File

@ -17,9 +17,9 @@ if(module.hot) {
checkForUpdate(true); checkForUpdate(true);
}).catch(function(err) { }).catch(function(err) {
if(module.hot.status() in { if(module.hot.status() in {
abort: 1, abort: 1,
fail: 1 fail: 1
}) { }) {
console.warn("[HMR] Cannot apply update."); console.warn("[HMR] Cannot apply update.");
console.warn("[HMR] " + err.stack || err.message); console.warn("[HMR] " + err.stack || err.message);
console.warn("[HMR] You need to restart the application!"); console.warn("[HMR] You need to restart the application!");

View File

@ -19,9 +19,9 @@ if(module.hot) {
}, function(err, renewedModules) { }, function(err, renewedModules) {
if(err) { if(err) {
if(module.hot.status() in { if(module.hot.status() in {
abort: 1, abort: 1,
fail: 1 fail: 1
}) { }) {
console.warn("[HMR] Cannot apply update (Need to do a full reload!)"); console.warn("[HMR] Cannot apply update (Need to do a full reload!)");
console.warn("[HMR] " + err.stack || err.message); console.warn("[HMR] " + err.stack || err.message);
console.warn("[HMR] You need to restart the application!"); console.warn("[HMR] You need to restart the application!");
@ -37,9 +37,9 @@ if(module.hot) {
}); });
}).catch(function(err) { }).catch(function(err) {
if(module.hot.status() in { if(module.hot.status() in {
abort: 1, abort: 1,
fail: 1 fail: 1
}) { }) {
console.warn("[HMR] Cannot apply update."); console.warn("[HMR] Cannot apply update.");
console.warn("[HMR] " + err.stack || err.message); console.warn("[HMR] " + err.stack || err.message);
console.warn("[HMR] You need to restart the application!"); console.warn("[HMR] You need to restart the application!");

View File

@ -179,10 +179,10 @@ NormalModule.prototype.build = function build(options, compilation, resolver, fs
if(options.module && options.module.noParse) { if(options.module && options.module.noParse) {
if(Array.isArray(options.module.noParse)) { if(Array.isArray(options.module.noParse)) {
if(options.module.noParse.some(function(regExp) { if(options.module.noParse.some(function(regExp) {
return typeof regExp === "string" ? return typeof regExp === "string" ?
this.request.indexOf(regExp) === 0 : this.request.indexOf(regExp) === 0 :
regExp.test(this.request); regExp.test(this.request);
}, this)) return callback(); }, this)) return callback();
} else if(typeof options.module.noParse === "string" ? } else if(typeof options.module.noParse === "string" ?
this.request.indexOf(options.module.noParse) === 0 : this.request.indexOf(options.module.noParse) === 0 :
options.module.noParse.test(this.request)) { options.module.noParse.test(this.request)) {
@ -231,8 +231,8 @@ NormalModule.prototype.source = function(dependencyTemplates, outputOptions, req
var name = variable.name; var name = variable.name;
var expr = variable.expressionSource(dependencyTemplates, outputOptions, requestShortener); var expr = variable.expressionSource(dependencyTemplates, outputOptions, requestShortener);
if(availableVars.some(function(v) { if(availableVars.some(function(v) {
return v.name === name && v.expression.source() === expr.source(); return v.name === name && v.expression.source() === expr.source();
})) return; })) return;
vars.push({ vars.push({
name: name, name: name,
expression: expr expression: expr

View File

@ -338,8 +338,8 @@ Parser.prototype.initializeEvaluating = function() {
return element !== null && this.evaluateExpression(element); return element !== null && this.evaluateExpression(element);
}, this); }, this);
if(items.filter(function(i) { if(items.filter(function(i) {
return !i; return !i;
}).length > 0) return; }).length > 0) return;
return new BasicEvaluatedExpression().setItems(items).setRange(expr.range); return new BasicEvaluatedExpression().setItems(items).setRange(expr.range);
}); });
}; };

View File

@ -65,8 +65,8 @@ Template.prototype.asString = function(str) {
Template.prototype.getModulesArrayBounds = function(modules) { Template.prototype.getModulesArrayBounds = function(modules) {
if(modules.some(function(module) { if(modules.some(function(module) {
return typeof module.id !== "number"; return typeof module.id !== "number";
})) }))
return false; return false;
var maxId = -Infinity; var maxId = -Infinity;
var minId = Infinity; var minId = Infinity;

View File

@ -44,8 +44,8 @@ function debugIds(chunks) {
return chunk.debugId; return chunk.debugId;
}); });
if(list.some(function(dId) { if(list.some(function(dId) {
return typeof dId !== "number"; return typeof dId !== "number";
})) return "no"; })) return "no";
list.sort(); list.sort();
return list.join(","); return list.join(",");
} }

View File

@ -36,7 +36,6 @@
"diff": "^2.0.2", "diff": "^2.0.2",
"es6-promise-polyfill": "^1.1.1", "es6-promise-polyfill": "^1.1.1",
"eslint": "^1.1.0", "eslint": "^1.1.0",
"eslint-plugin-nodeca": "^1.0.3",
"express": "~4.13.1", "express": "~4.13.1",
"extract-text-webpack-plugin": "^1.0.0", "extract-text-webpack-plugin": "^1.0.0",
"file-loader": "~0.8.0", "file-loader": "~0.8.0",