diff --git a/lib/NoModeWarning.js b/lib/NoModeWarning.js index 1fbc3426a..e985984f5 100644 --- a/lib/NoModeWarning.js +++ b/lib/NoModeWarning.js @@ -6,7 +6,13 @@ const WebpackError = require("./WebpackError"); -module.exports = class NoModeWarning extends WebpackError { +/** @typedef {import("./Module")} Module */ + +class NoModeWarning extends WebpackError { + /** + * @param {Module[]=} modules modules used + */ + // TODO: Do we need this modules argument from constructor if its not used? constructor(modules) { super(); @@ -20,4 +26,6 @@ module.exports = class NoModeWarning extends WebpackError { Error.captureStackTrace(this, this.constructor); } -}; +} + +module.exports = NoModeWarning; diff --git a/lib/WarnNoModeSetPlugin.js b/lib/WarnNoModeSetPlugin.js index 4a69a8cca..b33c7da15 100644 --- a/lib/WarnNoModeSetPlugin.js +++ b/lib/WarnNoModeSetPlugin.js @@ -6,7 +6,13 @@ const NoModeWarning = require("./NoModeWarning"); +/** @typedef {import("./Compiler")} Compiler */ + class WarnNoModeSetPlugin { + /** + * @param {Compiler} compiler webpack compiler instance + * @returns {void} + */ apply(compiler) { compiler.hooks.thisCompilation.tap("WarnNoModeSetPlugin", compilation => { compilation.warnings.push(new NoModeWarning());