Skip to content

Commit

Permalink
Merge pull request #9238 from webpack/dependabot/npm_and_yarn/prettie…
Browse files Browse the repository at this point in the history
…r-1.18.0

chore(deps-dev): bump prettier from 1.17.1 to 1.18.0
  • Loading branch information
sokra committed Jun 9, 2019
2 parents b2bc5b9 + fd4b3c5 commit c36966a
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 98 deletions.
2 changes: 1 addition & 1 deletion declarations.d.ts
Expand Up @@ -59,7 +59,7 @@ declare module "neo-async" {
}

export type AsyncAutoTasks<R extends Dictionary<any>, E> = {
[K in keyof R]: AsyncAutoTask<R[K], R, E>
[K in keyof R]: AsyncAutoTask<R[K], R, E>;
};
export type AsyncAutoTask<R1, R extends Dictionary<any>, E> =
| AsyncAutoTaskFunctionWithoutDependencies<R1, E>
Expand Down
8 changes: 2 additions & 6 deletions lib/ChunkGroup.js
Expand Up @@ -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}`
);
}
}
Expand Down
8 changes: 2 additions & 6 deletions lib/Compilation.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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}`
);
}

Expand Down
4 changes: 1 addition & 3 deletions lib/MainTemplate.js
Expand Up @@ -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({
Expand Down
4 changes: 1 addition & 3 deletions lib/NormalModuleFactory.js
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions lib/dependencies/HarmonyExportImportedSpecifierDependency.js
Expand Up @@ -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)];
}

Expand Down
4 changes: 1 addition & 3 deletions lib/dependencies/HarmonyImportSpecifierDependency.js
Expand Up @@ -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)];
}

Expand Down
32 changes: 8 additions & 24 deletions lib/dependencies/ImportParserPlugin.js
Expand Up @@ -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
)
Expand All @@ -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
)
);
Expand All @@ -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
)
);
Expand All @@ -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
)
);
Expand All @@ -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
)
);
Expand All @@ -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
)
);
Expand All @@ -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
)
);
Expand All @@ -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
)
);
Expand Down
4 changes: 1 addition & 3 deletions lib/dependencies/LoaderPlugin.js
Expand Up @@ -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}`
)
);
}
Expand Down
4 changes: 1 addition & 3 deletions lib/dependencies/WebAssemblyImportDependency.js
Expand Up @@ -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`
)
];
}
Expand Down
4 changes: 1 addition & 3 deletions lib/optimize/ChunkModuleIdRangePlugin.js
Expand Up @@ -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`
);
}

Expand Down
24 changes: 6 additions & 18 deletions lib/optimize/ConcatenatedModule.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 =
Expand Down
4 changes: 1 addition & 3 deletions lib/wasm/WasmFinalizeExportsPlugin.js
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions lib/wasm/WasmMainTemplatePlugin.js
Expand Up @@ -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;`
]),
"}));"
]),
Expand Down
4 changes: 1 addition & 3 deletions lib/web/JsonpMainTemplatePlugin.js
Expand Up @@ -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; };`
]);
}
);
Expand Down
2 changes: 1 addition & 1 deletion open-bot.yaml
Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions test/BenchmarkTestCases.benchmark.js
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Expand Up @@ -5317,9 +5317,9 @@ prettier-linter-helpers@^1.0.0:
fast-diff "^1.1.2"

prettier@^1.14.3, prettier@^1.16.4:
version "1.17.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db"
integrity sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==
version "1.18.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.0.tgz#d1701ca9b2941864b52f3262b35946d2c9cd88f0"
integrity sha512-YsdAD29M0+WY2xXZk3i0PA16olY9qZss+AuODxglXcJ+2ZBwFv+6k5tE8GS8/HKAthaajlS/WqhdgcjumOrPlg==

pretty-format@^24.5.0:
version "24.5.0"
Expand Down

0 comments on commit c36966a

Please sign in to comment.