mirror of https://github.com/webpack/webpack.git
linter fixes
This commit is contained in:
parent
f1d56dcc74
commit
784af506a3
|
@ -174,7 +174,7 @@ function processOptions(options) {
|
||||||
var firstOptions = [].concat(options)[0];
|
var firstOptions = [].concat(options)[0];
|
||||||
var statsPresetToOptions = require("../lib/Stats.js").presetToOptions;
|
var statsPresetToOptions = require("../lib/Stats.js").presetToOptions;
|
||||||
|
|
||||||
let outputOptions = options.stats;
|
var outputOptions = options.stats;
|
||||||
if(typeof outputOptions === "boolean" || typeof outputOptions === "string")
|
if(typeof outputOptions === "boolean" || typeof outputOptions === "string")
|
||||||
outputOptions = statsPresetToOptions(outputOptions);
|
outputOptions = statsPresetToOptions(outputOptions);
|
||||||
else
|
else
|
||||||
|
|
|
@ -34,13 +34,13 @@ MultiStats.prototype.toJson = function(options, forToString) {
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
var jsons = this.stats.map((stat, idx) => {
|
var jsons = this.stats.map((stat, idx) => {
|
||||||
const childOptions = Stats.getChildOptions(options, idx)
|
var childOptions = Stats.getChildOptions(options, idx);
|
||||||
var obj = stat.toJson(childOptions, forToString);
|
var obj = stat.toJson(childOptions, forToString);
|
||||||
obj.name = stat.compilation && stat.compilation.name;
|
obj.name = stat.compilation && stat.compilation.name;
|
||||||
return obj;
|
return obj;
|
||||||
});
|
});
|
||||||
const showVersion = typeof options.version === "undefined" ? jsons.every(j => j.version) : options.version !== false;
|
var showVersion = typeof options.version === "undefined" ? jsons.every(j => j.version) : options.version !== false;
|
||||||
const showHash = typeof options.hash === "undefined" ? jsons.every(j => j.hash) : options.hash !== false;
|
var showHash = typeof options.hash === "undefined" ? jsons.every(j => j.hash) : options.hash !== false;
|
||||||
jsons.forEach(j => {
|
jsons.forEach(j => {
|
||||||
if(showVersion)
|
if(showVersion)
|
||||||
delete j.version;
|
delete j.version;
|
||||||
|
|
|
@ -175,7 +175,10 @@ describe("MultiStats", function() {
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
myMultiStats = new MultiStats(stats);
|
myMultiStats = new MultiStats(stats);
|
||||||
result = myMultiStats.toJson({ version: false, hash: false });
|
result = myMultiStats.toJson({
|
||||||
|
version: false,
|
||||||
|
hash: false
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns plain object representation", function() {
|
it("returns plain object representation", function() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
module.exports = function testAssertions(code, stdout, stderr) {
|
module.exports = function testAssertions(code, stdout, stderr) {
|
||||||
code.should.be.oneOf(0, 1);
|
code.should.be.eql(0);
|
||||||
stdout.should.be.ok();
|
stdout.should.be.ok();
|
||||||
stderr.should.be.empty();
|
stderr.should.be.empty();
|
||||||
}
|
};
|
||||||
|
|
Loading…
Reference in New Issue