@@ -19,21 +19,23 @@ export function validateFilterOption(
1919 verbose,
2020 } : { itemsToFilter : string [ ] ; skippedItems : string [ ] ; verbose : boolean } ,
2121) : void {
22+ const validItems = isCategoryOption ( option )
23+ ? categories . map ( ( { slug } ) => slug )
24+ : isPluginOption ( option )
25+ ? plugins . map ( ( { slug } ) => slug )
26+ : [ ] ;
27+
2228 const itemsToFilterSet = new Set ( itemsToFilter ) ;
2329 const skippedItemsSet = new Set ( skippedItems ) ;
24- const validItemsSet = new Set (
25- isCategoryOption ( option )
26- ? categories . map ( ( { slug } ) => slug )
27- : isPluginOption ( option )
28- ? plugins . map ( ( { slug } ) => slug )
29- : [ '' ] ,
30- ) ;
30+ const validItemsSet = new Set ( validItems ) ;
31+
3132 const nonExistentItems = itemsToFilter . filter (
3233 item => ! validItemsSet . has ( item ) && ! skippedItemsSet . has ( item ) ,
3334 ) ;
3435 const skippedValidItems = itemsToFilter . filter ( item =>
3536 skippedItemsSet . has ( item ) ,
3637 ) ;
38+
3739 if ( nonExistentItems . length > 0 ) {
3840 const message = createValidationMessage (
3941 option ,
@@ -50,8 +52,10 @@ export function validateFilterOption(
5052 ui ( ) . logger . warning ( message ) ;
5153 }
5254 if ( skippedValidItems . length > 0 && verbose ) {
55+ const item = getItemType ( option , skippedValidItems . length ) ;
56+ const prefix = skippedValidItems . length === 1 ? `a skipped` : `skipped` ;
5357 ui ( ) . logger . warning (
54- `The --${ option } argument references skipped ${ getItemType ( option , skippedValidItems . length ) } : ${ skippedValidItems . join ( ', ' ) } .` ,
58+ `The --${ option } argument references ${ prefix } ${ item } : ${ skippedValidItems . join ( ', ' ) } .` ,
5559 ) ;
5660 }
5761 if ( isPluginOption ( option ) && categories . length > 0 && verbose ) {
0 commit comments