From fd4b3c503a832b5d86bc347bdd41c5d460dbf929 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Sun, 9 Jun 2019 11:23:42 +0200 Subject: [PATCH] pretty files --- declarations.d.ts | 2 +- lib/ChunkGroup.js | 8 ++--- lib/Compilation.js | 8 ++--- lib/MainTemplate.js | 4 +-- lib/NormalModuleFactory.js | 4 +-- ...armonyExportImportedSpecifierDependency.js | 4 +-- .../HarmonyImportSpecifierDependency.js | 4 +-- lib/dependencies/ImportParserPlugin.js | 32 +++++-------------- lib/dependencies/LoaderPlugin.js | 4 +-- .../WebAssemblyImportDependency.js | 4 +-- lib/optimize/ChunkModuleIdRangePlugin.js | 4 +-- lib/optimize/ConcatenatedModule.js | 24 ++++---------- lib/wasm/WasmFinalizeExportsPlugin.js | 4 +-- lib/wasm/WasmMainTemplatePlugin.js | 4 +-- lib/web/JsonpMainTemplatePlugin.js | 4 +-- open-bot.yaml | 2 +- test/BenchmarkTestCases.benchmark.js | 12 ++----- 17 files changed, 33 insertions(+), 95 deletions(-) diff --git a/declarations.d.ts b/declarations.d.ts index 1a5344e75..83b612e4c 100644 --- a/declarations.d.ts +++ b/declarations.d.ts @@ -59,7 +59,7 @@ declare module "neo-async" { } export type AsyncAutoTasks, E> = { - [K in keyof R]: AsyncAutoTask + [K in keyof R]: AsyncAutoTask; }; export type AsyncAutoTask, E> = | AsyncAutoTaskFunctionWithoutDependencies diff --git a/lib/ChunkGroup.js b/lib/ChunkGroup.js index 031fc14e4..58e766039 100644 --- a/lib/ChunkGroup.js +++ b/lib/ChunkGroup.js @@ -496,18 +496,14 @@ class ChunkGroup { for (const child of chunk._children) { if (!child._parents.has(chunk)) { throw new Error( - `checkConstraints: child missing parent ${chunk.debugId} -> ${ - child.debugId - }` + `checkConstraints: child missing parent ${chunk.debugId} -> ${child.debugId}` ); } } for (const parentChunk of chunk._parents) { if (!parentChunk._children.has(chunk)) { throw new Error( - `checkConstraints: parent missing child ${parentChunk.debugId} <- ${ - chunk.debugId - }` + `checkConstraints: parent missing child ${parentChunk.debugId} <- ${chunk.debugId}` ); } } diff --git a/lib/Compilation.js b/lib/Compilation.js index 514a4db11..80ef083e3 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -694,9 +694,7 @@ class Compilation extends Tapable { const factory = this.dependencyFactories.get(dep.constructor); if (factory === undefined) { throw new Error( - `No module factory available for dependency type: ${ - dep.constructor.name - }` + `No module factory available for dependency type: ${dep.constructor.name}` ); } let innerMap = dependencies.get(factory); @@ -958,9 +956,7 @@ class Compilation extends Tapable { const moduleFactory = this.dependencyFactories.get(Dep); if (!moduleFactory) { throw new Error( - `No dependency factory available for this dependency type: ${ - dependency.constructor.name - }` + `No dependency factory available for this dependency type: ${dependency.constructor.name}` ); } diff --git a/lib/MainTemplate.js b/lib/MainTemplate.js index 1023dc63a..9028823ed 100644 --- a/lib/MainTemplate.js +++ b/lib/MainTemplate.js @@ -345,9 +345,7 @@ module.exports = class MainTemplate extends Tapable { buf.push(""); buf.push("// Object.prototype.hasOwnProperty.call"); buf.push( - `${ - this.requireFn - }.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };` + `${this.requireFn}.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };` ); const publicPath = this.getPublicPath({ diff --git a/lib/NormalModuleFactory.js b/lib/NormalModuleFactory.js index 23ef0ae1d..49c1dbd80 100644 --- a/lib/NormalModuleFactory.js +++ b/lib/NormalModuleFactory.js @@ -435,9 +435,7 @@ class NormalModuleFactory extends Tapable { err.message + "\n" + "BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.\n" + - ` You need to specify '${ - item.loader - }-loader' instead of '${item.loader}',\n` + + ` You need to specify '${item.loader}-loader' instead of '${item.loader}',\n` + " see https://webpack.js.org/migrate/3/#automatic-loader-module-name-extension-removed"; } callback(err); diff --git a/lib/dependencies/HarmonyExportImportedSpecifierDependency.js b/lib/dependencies/HarmonyExportImportedSpecifierDependency.js index af782589d..19642ddff 100644 --- a/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +++ b/lib/dependencies/HarmonyExportImportedSpecifierDependency.js @@ -382,9 +382,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { // We are sure that it's not provided const idIsNotNameMessage = this._id !== this.name ? ` (reexported as '${this.name}')` : ""; - const errorMessage = `"export '${ - this._id - }'${idIsNotNameMessage} was not found in '${this.userRequest}'`; + const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`; return [new HarmonyLinkingError(errorMessage)]; } diff --git a/lib/dependencies/HarmonyImportSpecifierDependency.js b/lib/dependencies/HarmonyImportSpecifierDependency.js index 769711932..9f681a6f3 100644 --- a/lib/dependencies/HarmonyImportSpecifierDependency.js +++ b/lib/dependencies/HarmonyImportSpecifierDependency.js @@ -107,9 +107,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { // We are sure that it's not provided const idIsNotNameMessage = this._id !== this.name ? ` (imported as '${this.name}')` : ""; - const errorMessage = `"export '${ - this._id - }'${idIsNotNameMessage} was not found in '${this.userRequest}'`; + const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`; return [new HarmonyLinkingError(errorMessage)]; } diff --git a/lib/dependencies/ImportParserPlugin.js b/lib/dependencies/ImportParserPlugin.js index db22574f6..cb751a814 100644 --- a/lib/dependencies/ImportParserPlugin.js +++ b/lib/dependencies/ImportParserPlugin.js @@ -43,9 +43,7 @@ class ImportParserPlugin { const { comment } = e; parser.state.module.warnings.push( new CommentCompilationWarning( - `Compilation error while processing magic comment(-s): /*${ - comment.value - }*/: ${e.message}`, + `Compilation error while processing magic comment(-s): /*${comment.value}*/: ${e.message}`, parser.state.module, comment.loc ) @@ -59,9 +57,7 @@ class ImportParserPlugin { parser.state.module.warnings.push( new UnsupportedFeatureWarning( parser.state.module, - `\`webpackIgnore\` expected a boolean, but received: ${ - importOptions.webpackIgnore - }.`, + `\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`, expr.loc ) ); @@ -77,9 +73,7 @@ class ImportParserPlugin { parser.state.module.warnings.push( new UnsupportedFeatureWarning( parser.state.module, - `\`webpackChunkName\` expected a string, but received: ${ - importOptions.webpackChunkName - }.`, + `\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`, expr.loc ) ); @@ -92,9 +86,7 @@ class ImportParserPlugin { parser.state.module.warnings.push( new UnsupportedFeatureWarning( parser.state.module, - `\`webpackMode\` expected a string, but received: ${ - importOptions.webpackMode - }.`, + `\`webpackMode\` expected a string, but received: ${importOptions.webpackMode}.`, expr.loc ) ); @@ -111,9 +103,7 @@ class ImportParserPlugin { parser.state.module.warnings.push( new UnsupportedFeatureWarning( parser.state.module, - `\`webpackPrefetch\` expected true or a number, but received: ${ - importOptions.webpackPrefetch - }.`, + `\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`, expr.loc ) ); @@ -128,9 +118,7 @@ class ImportParserPlugin { parser.state.module.warnings.push( new UnsupportedFeatureWarning( parser.state.module, - `\`webpackPreload\` expected true or a number, but received: ${ - importOptions.webpackPreload - }.`, + `\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`, expr.loc ) ); @@ -144,9 +132,7 @@ class ImportParserPlugin { parser.state.module.warnings.push( new UnsupportedFeatureWarning( parser.state.module, - `\`webpackInclude\` expected a regular expression, but received: ${ - importOptions.webpackInclude - }.`, + `\`webpackInclude\` expected a regular expression, but received: ${importOptions.webpackInclude}.`, expr.loc ) ); @@ -162,9 +148,7 @@ class ImportParserPlugin { parser.state.module.warnings.push( new UnsupportedFeatureWarning( parser.state.module, - `\`webpackExclude\` expected a regular expression, but received: ${ - importOptions.webpackExclude - }.`, + `\`webpackExclude\` expected a regular expression, but received: ${importOptions.webpackExclude}.`, expr.loc ) ); diff --git a/lib/dependencies/LoaderPlugin.js b/lib/dependencies/LoaderPlugin.js index c781d0636..e46f593b7 100644 --- a/lib/dependencies/LoaderPlugin.js +++ b/lib/dependencies/LoaderPlugin.js @@ -49,9 +49,7 @@ class LoaderPlugin { if (factory === undefined) { return callback( new Error( - `No module factory available for dependency type: ${ - dep.constructor.name - }` + `No module factory available for dependency type: ${dep.constructor.name}` ) ); } diff --git a/lib/dependencies/WebAssemblyImportDependency.js b/lib/dependencies/WebAssemblyImportDependency.js index d765b0db0..4b36faa9b 100644 --- a/lib/dependencies/WebAssemblyImportDependency.js +++ b/lib/dependencies/WebAssemblyImportDependency.js @@ -40,9 +40,7 @@ class WebAssemblyImportDependency extends ModuleDependency { ) { return [ new UnsupportedWebAssemblyFeatureError( - `Import "${this.name}" from "${this.request}" with ${ - this.onlyDirectImport - } can only be used for direct wasm to wasm dependencies` + `Import "${this.name}" from "${this.request}" with ${this.onlyDirectImport} can only be used for direct wasm to wasm dependencies` ) ]; } diff --git a/lib/optimize/ChunkModuleIdRangePlugin.js b/lib/optimize/ChunkModuleIdRangePlugin.js index f507e426c..9e3abd3ba 100644 --- a/lib/optimize/ChunkModuleIdRangePlugin.js +++ b/lib/optimize/ChunkModuleIdRangePlugin.js @@ -26,9 +26,7 @@ class ChunkModuleIdRangePlugin { ); if (!chunk) { throw new Error( - `ChunkModuleIdRangePlugin: Chunk with name '${ - options.name - }"' was not found` + `ChunkModuleIdRangePlugin: Chunk with name '${options.name}"' was not found` ); } diff --git a/lib/optimize/ConcatenatedModule.js b/lib/optimize/ConcatenatedModule.js index 4a2973b91..dd5813254 100644 --- a/lib/optimize/ConcatenatedModule.js +++ b/lib/optimize/ConcatenatedModule.js @@ -1136,23 +1136,17 @@ class ConcatenatedModule extends Module { if (info.interopNamespaceObjectUsed) { if (info.module.buildMeta.exportsType === "named") { result.add( - `var ${ - info.interopNamespaceObjectName - } = /*#__PURE__*/__webpack_require__.t(${info.name}, 2);\n` + `var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name}, 2);\n` ); } else if (!info.module.buildMeta.exportsType) { result.add( - `var ${ - info.interopNamespaceObjectName - } = /*#__PURE__*/__webpack_require__.t(${info.name});\n` + `var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name});\n` ); } } if (info.interopDefaultAccessUsed) { result.add( - `var ${ - info.interopDefaultAccessName - } = /*#__PURE__*/__webpack_require__.n(${info.name});\n` + `var ${info.interopDefaultAccessName} = /*#__PURE__*/__webpack_require__.n(${info.name});\n` ); } break; @@ -1266,9 +1260,7 @@ class HarmonyImportSpecifierDependencyConcatenatedTemplate { }_ns${strictFlag}__[${JSON.stringify(dep._id)}]`; } else { const exportData = Buffer.from(dep._id, "utf-8").toString("hex"); - content = `__WEBPACK_MODULE_REFERENCE__${ - info.index - }_${exportData}${callFlag}${strictFlag}__`; + content = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${callFlag}${strictFlag}__`; } if (dep.shorthand) { content = dep.name + ": " + content; @@ -1464,14 +1456,10 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate { ? "_strict" : ""; if (def.id === true) { - finalName = `__WEBPACK_MODULE_REFERENCE__${ - info.index - }_ns${strictFlag}__`; + finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_ns${strictFlag}__`; } else { const exportData = Buffer.from(def.id, "utf-8").toString("hex"); - finalName = `__WEBPACK_MODULE_REFERENCE__${ - info.index - }_${exportData}${strictFlag}__`; + finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${strictFlag}__`; } const exportsName = this.rootModule.exportsArgument; const content = diff --git a/lib/wasm/WasmFinalizeExportsPlugin.js b/lib/wasm/WasmFinalizeExportsPlugin.js index 40491a9a6..52df869cb 100644 --- a/lib/wasm/WasmFinalizeExportsPlugin.js +++ b/lib/wasm/WasmFinalizeExportsPlugin.js @@ -46,9 +46,7 @@ class WasmFinalizeExportsPlugin { // 4. error /** @type {any} */ const error = new UnsupportedWebAssemblyFeatureError( - `Export "${name}" with ${ - jsIncompatibleExports[name] - } can only be used for direct wasm to wasm dependencies` + `Export "${name}" with ${jsIncompatibleExports[name]} can only be used for direct wasm to wasm dependencies` ); error.module = module; error.origin = reason.module; diff --git a/lib/wasm/WasmMainTemplatePlugin.js b/lib/wasm/WasmMainTemplatePlugin.js index fccfa819d..494c8ec93 100644 --- a/lib/wasm/WasmMainTemplatePlugin.js +++ b/lib/wasm/WasmMainTemplatePlugin.js @@ -307,9 +307,7 @@ class WasmMainTemplatePlugin { "}", "promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {", Template.indent([ - `return ${ - mainTemplate.requireFn - }.w[wasmModuleId] = (res.instance || res).exports;` + `return ${mainTemplate.requireFn}.w[wasmModuleId] = (res.instance || res).exports;` ]), "}));" ]), diff --git a/lib/web/JsonpMainTemplatePlugin.js b/lib/web/JsonpMainTemplatePlugin.js index 75a9da22a..b00d5b668 100644 --- a/lib/web/JsonpMainTemplatePlugin.js +++ b/lib/web/JsonpMainTemplatePlugin.js @@ -340,9 +340,7 @@ class JsonpMainTemplatePlugin { source, "", "// on error function for async loading", - `${ - mainTemplate.requireFn - }.oe = function(err) { console.error(err); throw err; };` + `${mainTemplate.requireFn}.oe = function(err) { console.error(err); throw err; };` ]); } ); diff --git a/open-bot.yaml b/open-bot.yaml index 8dce36481..d2e1bfffa 100644 --- a/open-bot.yaml +++ b/open-bot.yaml @@ -505,7 +505,7 @@ rules: context: "licence/cla" description: "Contributor License Agreement is not needed for this user." state: "success" - + # merge dependabot PRs automatically - filters: open: true diff --git a/test/BenchmarkTestCases.benchmark.js b/test/BenchmarkTestCases.benchmark.js index 9a78a2260..e5dc9064e 100644 --- a/test/BenchmarkTestCases.benchmark.js +++ b/test/BenchmarkTestCases.benchmark.js @@ -279,9 +279,7 @@ describe("BenchmarkTestCases", function() { describe(`${testName} create benchmarks`, function() { baselines.forEach(baseline => { let baselineStats = null; - it(`should benchmark ${baseline.name} (${ - baseline.rev - })`, function(done) { + it(`should benchmark ${baseline.name} (${baseline.rev})`, function(done) { const outputDirectory = path.join( __dirname, "js", @@ -332,14 +330,10 @@ describe("BenchmarkTestCases", function() { }, 180000); if (baseline.name !== "HEAD") { - it(`HEAD should not be slower than ${baseline.name} (${ - baseline.rev - })`, function() { + it(`HEAD should not be slower than ${baseline.name} (${baseline.rev})`, function() { if (baselineStats.maxConfidence < headStats.minConfidence) { throw new Error( - `HEAD (${headStats.text}) is slower than ${baseline.name} (${ - baselineStats.text - }) (90% confidence)` + `HEAD (${headStats.text}) is slower than ${baseline.name} (${baselineStats.text}) (90% confidence)` ); } else if ( baselineStats.minConfidence > headStats.maxConfidence