Skip to content

Commit

Permalink
test: Set typescript to strict mode (noImplicityAny:false)
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Jun 3, 2018
1 parent b6dec4b commit 1063b04
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions index.js
Expand Up @@ -38,7 +38,7 @@ class HtmlWebpackPlugin {
*/
this.options = Object.assign({
template: path.join(__dirname, 'default_index.ejs'),
templateContent: undefined,
templateContent: false,
templateParameters: templateParametersGenerator,
filename: 'index.html',
hash: false,
Expand Down Expand Up @@ -155,7 +155,7 @@ class HtmlWebpackPlugin {
.then(() => compilationPromise)
.then(compiledTemplate => {
// Allow to use a custom function / string instead
if (self.options.templateContent !== undefined) {
if (self.options.templateContent !== false) {
return self.options.templateContent;
}
// Once everything is compiled evaluate the html factory
Expand Down Expand Up @@ -402,7 +402,7 @@ class HtmlWebpackPlugin {
publicPath: string,
js: Array<{entryName: string, path: string}>,
css: Array<{entryName: string, path: string}>,
manifest: string,
manifest?: string,
favicon?: string
}}
*/
Expand Down Expand Up @@ -430,7 +430,7 @@ class HtmlWebpackPlugin {
publicPath: string,
js: Array<{entryName: string, path: string}>,
css: Array<{entryName: string, path: string}>,
manifest: string,
manifest?: string,
favicon?: string
}}
*/
Expand All @@ -448,7 +448,7 @@ class HtmlWebpackPlugin {
};

// Append a hash for cache busting
if (this.options.hash) {
if (this.options.hash && assets.manifest) {
assets.manifest = this.appendHash(assets.manifest, compilationHash);
}

Expand Down
3 changes: 0 additions & 3 deletions lib/hooks.js
Expand Up @@ -33,7 +33,6 @@ const AsyncSeriesWaterfallHook = require('tapable').AsyncSeriesWaterfallHook;
publicPath: string,
js: Array<{entryName: string, path: string}>,
css: Array<{entryName: string, path: string}>,
manifest: string,
},
outputName: string,
plugin: HtmlWebpackPlugin
Expand All @@ -45,7 +44,6 @@ const AsyncSeriesWaterfallHook = require('tapable').AsyncSeriesWaterfallHook;
publicPath: string,
js: Array<{entryName: string, path: string}>,
css: Array<{entryName: string, path: string}>,
manifest: string,
},
outputName: string,
plugin: HtmlWebpackPlugin,
Expand All @@ -57,7 +55,6 @@ const AsyncSeriesWaterfallHook = require('tapable').AsyncSeriesWaterfallHook;
publicPath: string,
js: Array<{entryName: string, path: string}>,
css: Array<{entryName: string, path: string}>,
manifest: string,
},
outputName: string,
plugin: HtmlWebpackPlugin,
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Expand Up @@ -7,8 +7,8 @@
"lib": ["es2017"],

/* Strict Type-Checking Options */
"strict": false, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
Expand Down
9 changes: 6 additions & 3 deletions typings.d.ts
Expand Up @@ -8,14 +8,17 @@ interface HtmlWebpackPluginOptions {
*/
title: string,
/**
* `webpack` require path to the template.
* The `webpack` require path to the template.
* @see https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md
*/
template: string,
/**
*
* Allow to use a html string instead of reading from a file
*/
templateContent: string | (() => string),
templateContent:
false // Use the template option instead to load a file
| string
| Promise<string>,
/**
* Allows to overwrite the parameters used in the template
*/
Expand Down

0 comments on commit 1063b04

Please sign in to comment.