@@ -51,7 +51,7 @@ function replaceAt(str: string, index: number, replace: string): string {
5151 */
5252const traverseAndGetProperties = ( arr : object [ ] , prop : string ) : boolean => {
5353 let hasProp : boolean = false ;
54- arr . forEach ( ( p : object ) => {
54+ arr . forEach ( ( p : object ) : void => {
5555 if ( p [ prop ] ) {
5656 hasProp = true ;
5757 }
@@ -72,7 +72,7 @@ const traverseAndGetProperties = (arr: object[], prop: string): boolean => {
7272const searchProps = ( answers : object , input : string ) : Promise < string [ ] > => {
7373 input = input || "" ;
7474 return Promise . resolve (
75- PROPS . filter ( ( prop : string ) =>
75+ PROPS . filter ( ( prop : string ) : boolean =>
7676 prop . toLowerCase ( ) . includes ( input . toLowerCase ( ) ) ,
7777 ) ,
7878 ) ;
@@ -207,15 +207,15 @@ export default class AddGenerator extends Generator {
207207 const originalPropDesc : object = defOrPropDescription [ 0 ] . enum ;
208208 // Array -> Object -> Merge objects into one for compat in manualOrListInput
209209 defOrPropDescription = Object . keys ( defOrPropDescription [ 0 ] . enum )
210- . map ( ( p : string ) => {
210+ . map ( ( p : string ) : object => {
211211 return Object . assign (
212212 { } ,
213213 {
214214 [ originalPropDesc [ p ] ] : "noop" ,
215215 } ,
216216 ) ;
217217 } )
218- . reduce ( ( result : object , currentObject : object ) => {
218+ . reduce ( ( result : object , currentObject : object ) : object => {
219219 for ( const key in currentObject ) {
220220 if ( currentObject . hasOwnProperty ( key ) ) {
221221 result [ key ] = currentObject [ key ] ;
@@ -323,14 +323,14 @@ export default class AddGenerator extends Generator {
323323 "node_modules/webpack/lib/*Plugin.js" ,
324324 "node_modules/webpack/lib/**/*Plugin.js" ,
325325 ] )
326- . map ( ( p : string ) =>
326+ . map ( ( p : string ) : string =>
327327 p
328328 . split ( "/" )
329329 . pop ( )
330330 . replace ( ".js" , "" ) ,
331331 )
332332 . find (
333- ( p : string ) => p . toLowerCase ( ) . indexOf ( answerToAction . actionAnswer ) >= 0 ,
333+ ( p : string ) : boolean => p . toLowerCase ( ) . indexOf ( answerToAction . actionAnswer ) >= 0 ,
334334 ) ;
335335
336336 if ( pluginExist ) {
@@ -341,7 +341,7 @@ export default class AddGenerator extends Generator {
341341 "node_modules/webpack/schemas/plugins/**/*Plugin.json" ,
342342 ] )
343343 . find (
344- ( p : string ) =>
344+ ( p : string ) : boolean =>
345345 p
346346 . split ( "/" )
347347 . pop ( )
@@ -361,9 +361,9 @@ export default class AddGenerator extends Generator {
361361 let pluginsSchemaProps : string [ ] = [ "other" ] ;
362362 if ( pluginSchema ) {
363363 Object . keys ( pluginSchema )
364- . filter ( ( p : string ) => Array . isArray ( pluginSchema [ p ] ) )
365- . forEach ( ( p : string ) => {
366- Object . keys ( pluginSchema [ p ] ) . forEach ( ( n : string ) => {
364+ . filter ( ( p : string ) : boolean => Array . isArray ( pluginSchema [ p ] ) )
365+ . forEach ( ( p : string ) : void => {
366+ Object . keys ( pluginSchema [ p ] ) . forEach ( ( n : string ) : void => {
367367 if ( pluginSchema [ p ] [ n ] . properties ) {
368368 pluginsSchemaProps = Object . keys (
369369 pluginSchema [ p ] [ n ] . properties ,
0 commit comments