@@ -31,35 +31,35 @@ const {
31
31
32
32
/**
33
33
* @typedef {Record<string, unknown> } CssNanoOptions
34
- * @property {string= } configFile - Configuration file path
35
- * @property {string | [string, Record<string, unknown>] | undefined= } preset - CSS nano preset
34
+ * @property {string= } configFile Configuration file path
35
+ * @property {string | [string, Record<string, unknown>] | undefined= } preset CSS nano preset
36
36
*/
37
37
38
38
/** @typedef {Error & { plugin?: string, text?: string, source?: string } | string } Warning */
39
39
40
40
/**
41
41
* @typedef {object } WarningObject
42
- * @property {string } message - Warning message
43
- * @property {string= } plugin - Plugin name
44
- * @property {string= } text - Warning text
45
- * @property {number= } line - Line number
46
- * @property {number= } column - Column number
42
+ * @property {string } message Warning message
43
+ * @property {string= } plugin Plugin name
44
+ * @property {string= } text Warning text
45
+ * @property {number= } line Line number
46
+ * @property {number= } column Column number
47
47
*/
48
48
49
49
/**
50
50
* @typedef {object } ErrorObject
51
- * @property {string } message - Error message
52
- * @property {number= } line - Line number
53
- * @property {number= } column - Column number
54
- * @property {string= } stack - Error stack trace
51
+ * @property {string } message Error message
52
+ * @property {number= } line Line number
53
+ * @property {number= } column Column number
54
+ * @property {string= } stack Error stack trace
55
55
*/
56
56
57
57
/**
58
58
* @typedef {object } MinimizedResult
59
- * @property {string } code - Minimized code
60
- * @property {RawSourceMap= } map - Source map
61
- * @property {Array<Error | ErrorObject| string>= } errors - Errors
62
- * @property {Array<Warning | WarningObject | string>= } warnings - Warnings
59
+ * @property {string } code Minimized code
60
+ * @property {RawSourceMap= } map Source map
61
+ * @property {Array<Error | ErrorObject| string>= } errors Errors
62
+ * @property {Array<Warning | WarningObject | string>= } warnings Warnings
63
63
*/
64
64
65
65
/**
@@ -91,7 +91,7 @@ const {
91
91
92
92
/**
93
93
* @typedef {object } MinimizeFunctionHelpers
94
- * @property {() => boolean | undefined= } supportsWorkerThreads - Check if worker threads are supported
94
+ * @property {() => boolean | undefined= } supportsWorkerThreads Check if worker threads are supported
95
95
*/
96
96
97
97
/**
@@ -102,10 +102,10 @@ const {
102
102
/**
103
103
* @template T
104
104
* @typedef {object } InternalOptions
105
- * @property {string } name - Name
106
- * @property {string } input - Input
107
- * @property {RawSourceMap | undefined } inputSourceMap - Input source map
108
- * @property {{ implementation: MinimizerImplementation<T>, options: MinimizerOptions<T> } } minimizer - Minimizer
105
+ * @property {string } name Name
106
+ * @property {string } input Input
107
+ * @property {RawSourceMap | undefined } inputSourceMap Input source map
108
+ * @property {{ implementation: MinimizerImplementation<T>, options: MinimizerOptions<T> } } minimizer Minimizer
109
109
*/
110
110
111
111
/**
@@ -124,11 +124,11 @@ const {
124
124
125
125
/**
126
126
* @typedef {object } BasePluginOptions
127
- * @property {Rule= } test - Test rule
128
- * @property {Rule= } include - Include rule
129
- * @property {Rule= } exclude - Exclude rule
130
- * @property {WarningsFilter= } warningsFilter - Warnings filter
131
- * @property {Parallel= } parallel - Parallel option
127
+ * @property {Rule= } test Test rule
128
+ * @property {Rule= } include Include rule
129
+ * @property {Rule= } exclude Exclude rule
130
+ * @property {WarningsFilter= } warningsFilter Warnings filter
131
+ * @property {Parallel= } parallel Parallel option
132
132
*/
133
133
134
134
/**
@@ -202,7 +202,7 @@ class CssMinimizerPlugin {
202
202
/**
203
203
* @private
204
204
* @param {unknown } input Input to check
205
- * @returns {boolean } - Whether input is a source map
205
+ * @returns {boolean } Whether input is a source map
206
206
*/
207
207
static isSourceMap ( input ) {
208
208
// All required options for `new SourceMapConsumer(...options)`
@@ -226,7 +226,7 @@ class CssMinimizerPlugin {
226
226
* @param {WarningsFilter= } warningsFilter Warnings filter
227
227
* @param {TraceMap= } sourceMap Source map
228
228
* @param {Compilation["requestShortener"]= } requestShortener Request shortener
229
- * @returns {Error & { hideStack?: boolean, file?: string } | undefined } - Built warning
229
+ * @returns {Error & { hideStack?: boolean, file?: string } | undefined } Built warning
230
230
*/
231
231
static buildWarning (
232
232
warning ,
@@ -309,7 +309,7 @@ class CssMinimizerPlugin {
309
309
* @param {string } file File name
310
310
* @param {TraceMap= } sourceMap Source map
311
311
* @param {Compilation["requestShortener"]= } requestShortener Request shortener
312
- * @returns {Error } - Built error
312
+ * @returns {Error } Built error
313
313
*/
314
314
static buildError ( error , file , sourceMap , requestShortener ) {
315
315
/**
@@ -384,15 +384,17 @@ class CssMinimizerPlugin {
384
384
/**
385
385
* @private
386
386
* @param {Parallel } parallel Parallel option
387
- * @returns {number } - Available number of cores
387
+ * @returns {number } Available number of cores
388
388
*/
389
389
static getAvailableNumberOfCores ( parallel ) {
390
390
// In some cases cpus() returns undefined
391
391
// https://github.com/nodejs/node/issues/19022
392
392
393
393
const cpus =
394
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
394
395
typeof os . availableParallelism === "function"
395
- ? { length : os . availableParallelism ( ) }
396
+ ? // eslint-disable-next-line n/no-unsupported-features/node-builtins
397
+ { length : os . availableParallelism ( ) }
396
398
: os . cpus ( ) || { length : 1 } ;
397
399
398
400
return parallel === true || typeof parallel === "undefined"
@@ -404,7 +406,7 @@ class CssMinimizerPlugin {
404
406
* @private
405
407
* @template T
406
408
* @param {BasicMinimizerImplementation<T> & MinimizeFunctionHelpers } implementation Implementation
407
- * @returns {boolean } - Whether worker threads are supported
409
+ * @returns {boolean } Whether worker threads are supported
408
410
*/
409
411
static isSupportsWorkerThreads ( implementation ) {
410
412
return typeof implementation . supportsWorkerThreads !== "undefined"
@@ -418,7 +420,7 @@ class CssMinimizerPlugin {
418
420
* @param {Compilation } compilation Compilation
419
421
* @param {Record<string, import("webpack").sources.Source> } assets Assets
420
422
* @param {{availableNumberOfCores: number} } optimizeOptions Optimize options
421
- * @returns {Promise<void> } - Promise
423
+ * @returns {Promise<void> } Promise
422
424
*/
423
425
async optimize ( compiler , compilation , assets , optimizeOptions ) {
424
426
const cache = compilation . getCache ( "CssMinimizerWebpackPlugin" ) ;
@@ -709,7 +711,7 @@ class CssMinimizerPlugin {
709
711
710
712
/**
711
713
* @param {Compiler } compiler Compiler
712
- * @returns {void } - Void
714
+ * @returns {void } Void
713
715
*/
714
716
apply ( compiler ) {
715
717
const pluginName = this . constructor . name ;
0 commit comments