1+ import { IWebpackCLI } from "webpack-cli" ;
2+
13const WEBPACK_PACKAGE = process . env . WEBPACK_PACKAGE || "webpack" ;
24
35class ConfigTestCommand {
4- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
5- async apply ( cli : any ) : Promise < void > {
6+ async apply ( cli : IWebpackCLI ) : Promise < void > {
67 await cli . makeCommand (
78 {
89 name : "configtest [config-path]" ,
@@ -19,15 +20,14 @@ class ConfigTestCommand {
1920 const configPaths = new Set < string > ( ) ;
2021
2122 if ( Array . isArray ( config . options ) ) {
22- // eslint-disable-next-line @typescript-eslint/no-explicit-any
23- config . options . forEach ( ( options : any ) => {
23+ config . options . forEach ( ( options ) => {
2424 if ( config . path . get ( options ) ) {
25- configPaths . add ( config . path . get ( options ) ) ;
25+ configPaths . add ( config . path . get ( options ) as string ) ;
2626 }
2727 } ) ;
2828 } else {
2929 if ( config . path . get ( config . options ) ) {
30- configPaths . add ( config . path . get ( config . options ) ) ;
30+ configPaths . add ( config . path . get ( config . options ) as string ) ;
3131 }
3232 }
3333
@@ -39,14 +39,16 @@ class ConfigTestCommand {
3939 cli . logger . info ( `Validate '${ Array . from ( configPaths ) . join ( " ," ) } '.` ) ;
4040
4141 try {
42- const error : Error [ ] = cli . webpack . validate ( config . options ) ;
42+ // @ts -expect-error cli.webpack.validate returns void
43+ const error : Error [ ] | undefined = cli . webpack . validate ( config . options ) ;
4344
4445 // TODO remove this after drop webpack@4
4546 if ( error && error . length > 0 ) {
47+ // @ts -expect-error schema argument is missing
4648 throw new cli . webpack . WebpackOptionsValidationError ( error ) ;
4749 }
4850 } catch ( error ) {
49- if ( cli . isValidationError ( error ) ) {
51+ if ( cli . isValidationError ( error as Error ) ) {
5052 cli . logger . error ( ( error as Error ) . message ) ;
5153 } else {
5254 cli . logger . error ( error ) ;
0 commit comments