Skip to content

Commit

Permalink
Merge pull request #12420 from webpack/types/typescript-4.2
Browse files Browse the repository at this point in the history
use typescript 4.2
  • Loading branch information
sokra committed Jan 13, 2021
2 parents 3ff77ba + a945a9b commit 06ae0b3
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 213 deletions.
2 changes: 2 additions & 0 deletions lib/MultiCompiler.js
Expand Up @@ -226,6 +226,7 @@ module.exports = class MultiCompiler {
}
}
}
/** @type {string[]} */
const errors = missing.map(m => `Compiler dependency \`${m}\` not found.`);
const stack = this.compilers.filter(c => !targetFound(c));
while (stack.length > 0) {
Expand All @@ -241,6 +242,7 @@ module.exports = class MultiCompiler {
}
}
if (edges.size > 0) {
/** @type {string[]} */
const lines = Array.from(edges)
.sort(sortEdges)
.map(edge => `${edge.source.name} -> ${edge.target.name}`);
Expand Down
6 changes: 6 additions & 0 deletions lib/stats/DefaultStatsPrinterPlugin.js
Expand Up @@ -11,6 +11,12 @@

const plural = (n, singular, plural) => (n === 1 ? singular : plural);

/**
* @param {Record<string, number>} sizes sizes by source type
* @param {Object} options options
* @param {(number) => string=} options.formatSize size formatter
* @returns {string} text
*/
const printSizes = (sizes, { formatSize = n => `${n}` }) => {
const keys = Object.keys(sizes);
if (keys.length > 1) {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -13,7 +13,7 @@
"acorn": "^8.0.4",
"browserslist": "^4.14.5",
"chrome-trace-event": "^1.0.2",
"enhanced-resolve": "^5.6.0",
"enhanced-resolve": "^5.7.0",
"eslint-scope": "^5.1.1",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
Expand Down Expand Up @@ -91,9 +91,9 @@
"style-loader": "^2.0.0",
"terser": "^5.5.0",
"toml": "^3.0.0",
"tooling": "webpack/tooling#v1.13.1",
"tooling": "webpack/tooling#v1.14.0",
"ts-loader": "^8.0.2",
"typescript": "^4.2.0-dev.20201130",
"typescript": "^4.2.0-beta",
"url-loader": "^4.1.0",
"wast-loader": "^1.11.0",
"webassembly-feature": "1.3.0",
Expand Down Expand Up @@ -150,8 +150,8 @@
"type-lint": "tsc",
"typings-lint": "tsc -p tsconfig.test.json",
"spellcheck": "cspell \"{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}\" \"*.md\"",
"special-lint": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node tooling/generate-runtime-code.js && node node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/generate-types",
"special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/generate-types --write",
"special-lint": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node tooling/generate-runtime-code.js && node node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/generate-types --no-template-literals",
"special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/generate-types --no-template-literals --write",
"fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix",
"pretty-lint-base": "prettier \"*.{ts,json,yml,yaml,md}\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.json\" \"examples/*.md\"",
"pretty-lint-base-all": "yarn pretty-lint-base \"*.js\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.js\" \"test/*.js\" \"test/helpers/*.js\" \"test/{configCases,watchCases,statsCases,hotCases,benchmarkCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"",
Expand Down

0 comments on commit 06ae0b3

Please sign in to comment.