From c6f0f5ab6daab0469fd5eefae839c3bd12ec732e Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Sun, 3 Jun 2018 21:14:26 +0200 Subject: [PATCH] chore: Upgrade typescript to 2.9 --- index.js | 19 +++++++++---------- lib/chunksorter.js | 6 ------ package.json | 4 ++-- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/index.js b/index.js index 7ab5258f..3a98ca4e 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,14 @@ // @ts-check -'use strict'; - -// use Polyfill for util.promisify in node versions < v8 -const promisify = require('util.promisify'); - // Import types /* eslint-disable */ /// /* eslint-enable */ /** @typedef {import("webpack/lib/Compiler.js")} WebpackCompiler */ /** @typedef {import("webpack/lib/Compilation.js")} WebpackCompilation */ +'use strict'; + +// use Polyfill for util.promisify in node versions < v8 +const promisify = require('util.promisify'); const vm = require('vm'); const fs = require('fs'); @@ -33,10 +32,8 @@ class HtmlWebpackPlugin { */ constructor (options) { // Default options - /** - * @type {HtmlWebpackPluginOptions} - */ - this.options = Object.assign({ + /** @type {HtmlWebpackPluginOptions} */ + const defaultOptions = { template: path.join(__dirname, 'default_index.ejs'), templateContent: false, templateParameters: templateParametersGenerator, @@ -54,7 +51,9 @@ class HtmlWebpackPlugin { meta: {}, title: 'Webpack App', xhtml: false - }, options); + }; + /** @type {HtmlWebpackPluginOptions} */ + this.options = Object.assign(defaultOptions, options); // Instance variables to keep caching information // for multiple builds this.childCompilerHash = undefined; diff --git a/lib/chunksorter.js b/lib/chunksorter.js index 53f935ab..d555fbac 100644 --- a/lib/chunksorter.js +++ b/lib/chunksorter.js @@ -2,12 +2,6 @@ /** @typedef {import("webpack/lib/Compilation.js")} WebpackCompilation */ 'use strict'; -// Import webpack types using commonjs -// As we use only the type we have to prevent warnings about unused varaibles -/* eslint-disable */ -const WebpackCompilation = require('webpack/lib/Compilation'); -/* eslint-enable */ - /** * @type {{[sortmode: string] : (entryPointNames: Array, compilation, htmlWebpackPluginOptions) => Array }} * This file contains different sort methods for the entry chunks names diff --git a/package.json b/package.json index d00f82a6..911b124f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ], "scripts": { "pretest": "semistandard", - "posttest": "tsc --pretty", + "posttest": "tsc", "commit": "git-cz", "build-examples": "node examples/build-examples.js", "test": "jasmine", @@ -41,7 +41,7 @@ "semistandard": "8.0.0", "standard-version": "^4.3.0", "style-loader": "^0.13.1", - "typescript": "2.9.0-dev.20180518", + "typescript": "2.9.1", "underscore-template-loader": "^0.7.3", "url-loader": "^0.5.7", "webpack": "4.8.3",