diff --git a/declarations.d.ts b/declarations.d.ts index 83b612e4cad..770212b6768 100644 --- a/declarations.d.ts +++ b/declarations.d.ts @@ -228,36 +228,4 @@ declare module "@webassemblyjs/ast" { export function isFuncImportDescr(n: Node): boolean; } -// This "hack" is needed because typescript doesn't support recursive type definitions -// It's referenced from "ruleSet-conditions" in schemas/WebpackOptions.json -interface RuleSetConditionsRecursive - extends Array {} -interface RuleSetConditionsAbsoluteRecursive - extends Array< - import("./declarations/WebpackOptions").RuleSetConditionAbsolute - > {} - -/** - * Global variable declarations - * @todo Once this issue is resolved, remove these globals and add JSDoc onsite instead - * https://github.com/Microsoft/TypeScript/issues/15626 - */ -declare const $hash$; -declare const $requestTimeout$; -declare const installedModules; -declare const $require$; -declare const hotDownloadManifest; -declare const hotDownloadUpdateChunk; -declare const hotDisposeChunk; -declare const modules; -declare const installedChunks; -declare const hotAddUpdateChunk; -declare const parentHotUpdateCallback; -declare const $hotChunkFilename$; -declare const $hotMainFilename$; -declare namespace WebAssembly {} -declare const importScripts; -declare const $crossOriginLoading$; -declare const chunkId; - type TODO = any; diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 57f9df076c3..372d2b2f6cd 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -132,7 +132,7 @@ export type RuleSetCondition = * This interface was referenced by `WebpackOptions`'s JSON-Schema * via the `definition` "RuleSetConditions". */ -export type RuleSetConditions = RuleSetConditionsRecursive; +export type RuleSetConditions = RuleSetCondition[]; /** * One or multiple rule conditions * @@ -181,7 +181,7 @@ export type RuleSetConditionAbsolute = * This interface was referenced by `WebpackOptions`'s JSON-Schema * via the `definition` "RuleSetConditionsAbsolute". */ -export type RuleSetConditionsAbsolute = RuleSetConditionsAbsoluteRecursive; +export type RuleSetConditionsAbsolute = RuleSetConditionAbsolute[]; /** * This interface was referenced by `WebpackOptions`'s JSON-Schema * via the `definition` "RuleSetLoader". diff --git a/lib/HotModuleReplacement.runtime.js b/lib/HotModuleReplacement.runtime.js index 5756623e629..8427189b30a 100644 --- a/lib/HotModuleReplacement.runtime.js +++ b/lib/HotModuleReplacement.runtime.js @@ -2,7 +2,17 @@ MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -/*global $hash$ $requestTimeout$ installedModules $require$ hotDownloadManifest hotDownloadUpdateChunk hotDisposeChunk modules */ +// eslint-disable no-unused-vars +var $hash$ = undefined; +var $requestTimeout$ = undefined; +var installedModules = undefined; +var $require$ = undefined; +var hotDownloadManifest = undefined; +var hotDownloadUpdateChunk = undefined; +var hotDisposeChunk = undefined; +var modules = undefined; +var chunkId = undefined; + module.exports = function() { var hotApplyOnUpdate = true; // eslint-disable-next-line no-unused-vars @@ -204,7 +214,6 @@ module.exports = function() { /*foreachInstalledChunks*/ // eslint-disable-next-line no-lone-blocks { - /*globals chunkId */ hotEnsureUpdateChunk(chunkId); } if ( diff --git a/lib/node/NodeMainTemplate.runtime.js b/lib/node/NodeMainTemplate.runtime.js index d34388bf76f..0880124b2d0 100644 --- a/lib/node/NodeMainTemplate.runtime.js +++ b/lib/node/NodeMainTemplate.runtime.js @@ -2,7 +2,12 @@ MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -/*global installedChunks $hotChunkFilename$ hotAddUpdateChunk $hotMainFilename$ */ +// eslint-disable-next-line no-unused-vars +var $hotChunkFilename$ = undefined; +var hotAddUpdateChunk = undefined; +var installedChunks = undefined; +var $hotMainFilename$ = undefined; + module.exports = function() { // eslint-disable-next-line no-unused-vars function hotDownloadUpdateChunk(chunkId) { diff --git a/lib/node/NodeMainTemplateAsync.runtime.js b/lib/node/NodeMainTemplateAsync.runtime.js index 35eb47b665e..a021f5a0d4e 100644 --- a/lib/node/NodeMainTemplateAsync.runtime.js +++ b/lib/node/NodeMainTemplateAsync.runtime.js @@ -2,7 +2,13 @@ MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -/*global installedChunks $hotChunkFilename$ $require$ hotAddUpdateChunk $hotMainFilename$ */ +// eslint-disable-next-line no-unused-vars +var $hotChunkFilename$ = undefined; +var $require$ = undefined; +var hotAddUpdateChunk = undefined; +var $hotMainFilename$ = undefined; +var installedChunks = undefined; + module.exports = function() { // eslint-disable-next-line no-unused-vars function hotDownloadUpdateChunk(chunkId) { diff --git a/lib/web/JsonpMainTemplate.runtime.js b/lib/web/JsonpMainTemplate.runtime.js index 58dcf8312f1..cbaa01ef7aa 100644 --- a/lib/web/JsonpMainTemplate.runtime.js +++ b/lib/web/JsonpMainTemplate.runtime.js @@ -2,7 +2,14 @@ MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -/*globals hotAddUpdateChunk parentHotUpdateCallback document XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ $crossOriginLoading$ */ +// eslint-disable-next-line no-unused-vars +var hotAddUpdateChunk = undefined; +var parentHotUpdateCallback = undefined; +var $require$ = undefined; +var $hotMainFilename$ = undefined; +var $hotChunkFilename$ = undefined; +var $crossOriginLoading$ = undefined; + module.exports = function() { // eslint-disable-next-line no-unused-vars function webpackHotUpdateCallback(chunkId, moreModules) { diff --git a/lib/webworker/WebWorkerMainTemplate.runtime.js b/lib/webworker/WebWorkerMainTemplate.runtime.js index 8c63f7729e3..aa240b2246c 100644 --- a/lib/webworker/WebWorkerMainTemplate.runtime.js +++ b/lib/webworker/WebWorkerMainTemplate.runtime.js @@ -2,7 +2,15 @@ MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -/*globals installedChunks hotAddUpdateChunk parentHotUpdateCallback importScripts XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ */ +// eslint-disable-next-line no-unused-vars +var hotAddUpdateChunk = undefined; +var parentHotUpdateCallback = undefined; +var $require$ = undefined; +var $hotChunkFilename$ = undefined; +var $hotMainFilename$ = undefined; +var installedChunks = undefined; +var importScripts = undefined; + module.exports = function() { // eslint-disable-next-line no-unused-vars function webpackHotUpdateCallback(chunkId, moreModules) { diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 310e3388085..1fd61706d84 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -1428,8 +1428,7 @@ "$ref": "#/definitions/RuleSetCondition" } ] - }, - "tsType": "RuleSetConditionsRecursive" + } }, "RuleSetConditionsAbsolute": { "type": "array", @@ -1440,8 +1439,7 @@ "$ref": "#/definitions/RuleSetConditionAbsolute" } ] - }, - "tsType": "RuleSetConditionsAbsoluteRecursive" + } }, "RuleSetLoader": { "type": "string",