Skip to content
Permalink
Browse files
fix linting
  • Loading branch information
sokra committed Feb 25, 2018
1 parent 5238159 commit f32bd41c52b00f6251deda00afa6853324f74ada
@@ -162,8 +162,8 @@ class Chunk {
if (this._modules.size < otherChunk._modules.size) return 1;
const a = this._modules[Symbol.iterator]();
const b = otherChunk._modules[Symbol.iterator]();
// eslint-disable-next-line
while (true) {
// eslint-disable-line
const aItem = a.next();
const bItem = b.next();
if (aItem.done) return 0;
@@ -12,8 +12,8 @@ module.exports = function() {
var hotCurrentParents = []; // eslint-disable-line no-unused-vars
var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars

// eslint-disable-next-line no-unused-vars
function hotCreateRequire(moduleId) {
// eslint-disable-line no-unused-vars
var me = installedModules[moduleId];
if (!me) return $require$;
var fn = function(request) {
@@ -80,8 +80,8 @@ module.exports = function() {
return fn;
}

// eslint-disable-next-line no-unused-vars
function hotCreateModule(moduleId) {
// eslint-disable-line no-unused-vars
var hot = {
// private stuff
_acceptedDependencies: {},
@@ -206,8 +206,8 @@ module.exports = function() {
});
}

// eslint-disable-next-line no-unused-vars
function hotAddUpdateChunk(chunkId, moreModules) {
// eslint-disable-line no-unused-vars
if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])
return;
hotRequestedFilesMap[chunkId] = false;
@@ -163,8 +163,8 @@ class Module extends DependenciesBlock {
otherModule._chunks.sortWith(sortByDebugId);
const a = this._chunks[Symbol.iterator]();
const b = otherModule._chunks[Symbol.iterator]();
// eslint-disable-next-line no-constant-condition
while (true) {
// eslint-disable-line
const aItem = a.next();
const bItem = b.next();
if (aItem.done) return true;
@@ -34,8 +34,8 @@ module.exports = class MultiCompiler extends Tapable {
for (const compiler of this.compilers) {
let compilerDone = false;
const compilerIndex = index++;
// eslint-disable-next-line no-loop-func
compiler.hooks.done.tap("MultiCompiler", stats => {
// eslint-disable-line no-loop-func
if (!compilerDone) {
compilerDone = true;
doneCompilers++;
@@ -45,8 +45,8 @@ module.exports = class MultiCompiler extends Tapable {
this.hooks.done.call(new MultiStats(compilerStats));
}
});
// eslint-disable-next-line no-loop-func
compiler.hooks.invalid.tap("MultiCompiler", () => {
// eslint-disable-line no-loop-func
if (compilerDone) {
compilerDone = false;
doneCompilers--;
@@ -2055,7 +2055,9 @@ class Parser extends Tapable {
try {
ast = acorn.parse(code, parserOptions);
threw = false;
} catch (e) {}
} catch (e) {
threw = true;
}
}

if (threw) {
@@ -97,7 +97,7 @@ class Stats {
if (typeof item === "string") {
const regExp = new RegExp(
`[\\\\/]${item.replace(
/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
/[-[\]{}()*+?.\\^$|]/g,
"\\$&"
)}([\\\\/]|$|!|\\?)`
); // eslint-disable-line no-useless-escape
@@ -4,14 +4,14 @@
*/
/*global installedChunks $hotChunkFilename$ hotAddUpdateChunk $hotMainFilename$ */
module.exports = function() {
// eslint-disable-next-line no-unused-vars
function hotDownloadUpdateChunk(chunkId) {
// eslint-disable-line no-unused-vars
var chunk = require("./" + $hotChunkFilename$);
hotAddUpdateChunk(chunk.id, chunk.modules);
}

// eslint-disable-next-line no-unused-vars
function hotDownloadManifest() {
// eslint-disable-line no-unused-vars
try {
var update = require("./" + $hotMainFilename$);
} catch (e) {
@@ -20,8 +20,8 @@ module.exports = function() {
return Promise.resolve(update);
}

//eslint-disable-next-line no-unused-vars
function hotDisposeChunk(chunkId) {
//eslint-disable-line no-unused-vars
delete installedChunks[chunkId];
}
};
@@ -4,8 +4,8 @@
*/
/*global installedChunks $hotChunkFilename$ $require$ hotAddUpdateChunk $hotMainFilename$ */
module.exports = function() {
// eslint-disable-next-line no-unused-vars
function hotDownloadUpdateChunk(chunkId) {
// eslint-disable-line no-unused-vars
var filename = require("path").join(__dirname, $hotChunkFilename$);
require("fs").readFile(filename, "utf-8", function(err, content) {
if (err) {
@@ -21,8 +21,8 @@ module.exports = function() {
});
}

// eslint-disable-next-line no-unused-vars
function hotDownloadManifest() {
// eslint-disable-line no-unused-vars
var filename = require("path").join(__dirname, $hotMainFilename$);
return new Promise(function(resolve, reject) {
require("fs").readFile(filename, "utf-8", function(err, content) {
@@ -37,8 +37,8 @@ module.exports = function() {
});
}

//eslint-disable-next-line no-unused-vars
function hotDisposeChunk(chunkId) {
//eslint-disable-line no-unused-vars
delete installedChunks[chunkId];
}
};
@@ -158,8 +158,8 @@ class AggressiveSplittingPlugin {
modulesB.sort();
const aI = modulesA[Symbol.iterator]();
const bI = modulesB[Symbol.iterator]();
// eslint-disable-next-line no-constant-condition
while (true) {
// eslint-disable-line
const aItem = aI.next();
const bItem = bI.next();
if (aItem.done) return 0;
@@ -66,8 +66,8 @@ const compareEntries = (a, b) => {
modulesB.sort();
const aI = modulesA[Symbol.iterator]();
const bI = modulesB[Symbol.iterator]();
// eslint-disable-next-line no-constant-condition
while (true) {
// eslint-disable-line
const aItem = aI.next();
const bItem = bI.next();
if (aItem.done) return 0;
@@ -4,14 +4,14 @@
*/
/*globals hotAddUpdateChunk parentHotUpdateCallback document XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ $crossOriginLoading$ */
module.exports = function() {
// eslint-disable-next-line no-unused-vars
function webpackHotUpdateCallback(chunkId, moreModules) {
// eslint-disable-line no-unused-vars
hotAddUpdateChunk(chunkId, moreModules);
if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
} //$semicolon

// eslint-disable-next-line no-unused-vars
function hotDownloadUpdateChunk(chunkId) {
// eslint-disable-line no-unused-vars
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.charset = "utf-8";
@@ -20,8 +20,8 @@ module.exports = function() {
head.appendChild(script);
}

// eslint-disable-next-line no-unused-vars
function hotDownloadManifest(requestTimeout) {
// eslint-disable-line no-unused-vars
requestTimeout = requestTimeout || 10000;
return new Promise(function(resolve, reject) {
if (typeof XMLHttpRequest === "undefined")
@@ -4,19 +4,19 @@
*/
/*globals installedChunks hotAddUpdateChunk parentHotUpdateCallback importScripts XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ */
module.exports = function() {
// eslint-disable-next-line no-unused-vars
function webpackHotUpdateCallback(chunkId, moreModules) {
// eslint-disable-line no-unused-vars
hotAddUpdateChunk(chunkId, moreModules);
if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
} //$semicolon

// eslint-disable-next-line no-unused-vars
function hotDownloadUpdateChunk(chunkId) {
// eslint-disable-line no-unused-vars
importScripts($require$.p + $hotChunkFilename$);
}

// eslint-disable-next-line no-unused-vars
function hotDownloadManifest(requestTimeout) {
// eslint-disable-line no-unused-vars
requestTimeout = requestTimeout || 10000;
return new Promise(function(resolve, reject) {
if (typeof XMLHttpRequest === "undefined")
@@ -57,8 +57,8 @@ module.exports = function() {
});
}

//eslint-disable-next-line no-unused-vars
function hotDisposeChunk(chunkId) {
//eslint-disable-line no-unused-vars
delete installedChunks[chunkId];
}
};
@@ -22,10 +22,10 @@ describe("BenchmarkTestCases", function() {

try {
fs.mkdirSync(path.join(__dirname, "js"));
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty
try {
fs.mkdirSync(baselinesPath);
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty

before(function(done) {
this.timeout(270000);
@@ -43,7 +43,7 @@ describe("BenchmarkTestCases", function() {
} else {
try {
fs.mkdirSync(baselinePath);
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty
const gitIndex = path.resolve(rootPath, ".git/index");
const index = fs.readFileSync(gitIndex);
git(rootPath).raw(
@@ -87,7 +87,7 @@ describe("ConfigTestCases", () => {
testConfig,
require(path.join(testDirectory, "test.config.js"))
);
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty

this.timeout(testConfig.timeout);

@@ -23,10 +23,10 @@ describe("HotModuleReplacementPlugin", function() {
const recordsFile = path.join(__dirname, "js", "records.json");
try {
fs.mkdirSync(path.join(__dirname, "js"));
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty
try {
fs.unlinkSync(recordsFile);
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty
const compiler = webpack({
cache: false,
entry: entryFile,
@@ -475,8 +475,10 @@ describe("Parser", () => {
"wrapped=['str' string=str]+['four' string=four]",
"'str'.concat(obj, 'one', 'two').concat('three', obj, 'four', 'five')":
"wrapped=['str' string=str]+['four', 'five' string=fourfive]",
// eslint-disable-next-line no-template-curly-in-string
"`start${obj}mid${obj2}end`":
"template=[start string=start],[mid string=mid],[end string=end]", // eslint-disable-line no-template-curly-in-string
"template=[start string=start],[mid string=mid],[end string=end]",
// eslint-disable-next-line no-template-curly-in-string
"`start${'str'}mid${obj2}end`":
"template=[start${'str'}mid string=startstrmid],[end string=end]", // eslint-disable-line no-template-curly-in-string
"'abc'.substr(1)": "string=bc",
@@ -35,21 +35,21 @@ describe("WatchDetection", () => {
before(() => {
try {
fs.mkdirSync(fixturePath);
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty
fs.writeFileSync(filePath, "require('./file2')", "utf-8");
fs.writeFileSync(file2Path, "original", "utf-8");
});
after(done => {
setTimeout(() => {
try {
fs.unlinkSync(filePath);
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty
try {
fs.unlinkSync(file2Path);
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty
try {
fs.rmdirSync(fixturePath);
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty
done();
}, 100); // cool down a bit
});
@@ -285,7 +285,7 @@ describe("WatchTestCases", () => {
testDirectory,
"test.config.js"
));
} catch (e) {}
} catch (e) {} // eslint-disable-line no-empty

if (testConfig.noTests) return process.nextTick(done);
_require(

0 comments on commit f32bd41

Please sign in to comment.