@@ -29,6 +29,9 @@ const {
2929/** @typedef {import("postcss").Stringifier } Stringifier */
3030/** @typedef {import("@jridgewell/trace-mapping").TraceMap } TraceMap */
3131
32+ // eslint-disable-next-line jsdoc/reject-any-type
33+ /** @typedef {any } EXPECTED_ANY */
34+
3235/**
3336 * @typedef {Record<string, unknown> } CssNanoOptions
3437 * @property {string= } configFile Configuration file path
@@ -58,8 +61,8 @@ const {
5861 * @typedef {object } MinimizedResult
5962 * @property {string } code Minimized code
6063 * @property {RawSourceMap= } map Source map
61- * @property {Array< Error | ErrorObject| string> = } errors Errors
62- * @property {Array< Warning | WarningObject | string> = } warnings Warnings
64+ * @property {( Error | ErrorObject | string)[] = } errors Errors
65+ * @property {( Warning | WarningObject | string)[] = } warnings Warnings
6366 */
6467
6568/**
@@ -77,7 +80,7 @@ const {
7780
7881/**
7982 * @template T
80- * @typedef {T extends any [] ? { [P in keyof T]?: InferDefaultType<T[P]> } : InferDefaultType<T> } MinimizerOptions
83+ * @typedef {T extends EXPECTED_ANY [] ? { [P in keyof T]?: InferDefaultType<T[P]> } : InferDefaultType<T> } MinimizerOptions
8184 */
8285
8386/**
@@ -96,7 +99,7 @@ const {
9699
97100/**
98101 * @template T
99- * @typedef {T extends any [] ? { [P in keyof T]: BasicMinimizerImplementation<T[P]> & MinimizeFunctionHelpers; } : BasicMinimizerImplementation<T> & MinimizeFunctionHelpers } MinimizerImplementation
102+ * @typedef {T extends EXPECTED_ANY [] ? { [P in keyof T]: BasicMinimizerImplementation<T[P]> & MinimizeFunctionHelpers } : BasicMinimizerImplementation<T> & MinimizeFunctionHelpers } MinimizerImplementation
100103 */
101104
102105/**
@@ -110,9 +113,9 @@ const {
110113
111114/**
112115 * @typedef InternalResult
113- * @property {Array< { code: string, map: RawSourceMap | undefined }> } outputs - Outputs
114- * @property {Array< Warning | WarningObject | string> } warnings - Warnings
115- * @property {Array< Error | ErrorObject | string> } errors - Errors
116+ * @property {{ code: string, map: RawSourceMap | undefined }[] } outputs - Outputs
117+ * @property {( Warning | WarningObject | string)[] } warnings - Warnings
118+ * @property {( Error | ErrorObject | string)[] } errors - Errors
116119 */
117120
118121/** @typedef {undefined | boolean | number } Parallel */
@@ -137,7 +140,7 @@ const {
137140 */
138141
139142/**
140- * @typedef {ProcessOptions | { from?: string, to?: string, parser?: string | Syntax | Parser, stringifier?: string | Syntax | Stringifier, syntax?: string | Syntax } } ProcessOptionsExtender
143+ * @typedef {ProcessOptions | { from?: string, to?: string, parser?: string | Syntax | Parser, stringifier?: string | Syntax | Stringifier, syntax?: string | Syntax } } ProcessOptionsExtender
141144 */
142145
143146/**
@@ -209,13 +212,13 @@ class CssMinimizerPlugin {
209212 // https://github.com/mozilla/source-map#new-sourcemapconsumerrawsourcemap
210213 return Boolean (
211214 input &&
212- typeof input === "object" &&
213- input !== null &&
214- "version" in input &&
215- "sources" in input &&
216- Array . isArray ( input . sources ) &&
217- "mappings" in input &&
218- typeof input . mappings === "string" ,
215+ typeof input === "object" &&
216+ input !== null &&
217+ "version" in input &&
218+ "sources" in input &&
219+ Array . isArray ( input . sources ) &&
220+ "mappings" in input &&
221+ typeof input . mappings === "string" ,
219222 ) ;
220223 }
221224
@@ -391,10 +394,8 @@ class CssMinimizerPlugin {
391394 // https://github.com/nodejs/node/issues/19022
392395
393396 const cpus =
394- // eslint-disable-next-line n/no-unsupported-features/node-builtins
395397 typeof os . availableParallelism === "function"
396- ? // eslint-disable-next-line n/no-unsupported-features/node-builtins
397- { length : os . availableParallelism ( ) }
398+ ? { length : os . availableParallelism ( ) }
398399 : os . cpus ( ) || { length : 1 } ;
399400
400401 return parallel === true || typeof parallel === "undefined"
@@ -419,7 +420,7 @@ class CssMinimizerPlugin {
419420 * @param {Compiler } compiler Compiler
420421 * @param {Compilation } compilation Compilation
421422 * @param {Record<string, import("webpack").sources.Source> } assets Assets
422- * @param {{availableNumberOfCores: number} } optimizeOptions Optimize options
423+ * @param {{ availableNumberOfCores: number } } optimizeOptions Optimize options
423424 * @returns {Promise<void> } Promise
424425 */
425426 async optimize ( compiler , compilation , assets , optimizeOptions ) {
0 commit comments