@@ -66,9 +66,9 @@ export class DependencyDeputy {
66
66
manifestPath,
67
67
manifestStr,
68
68
manifest,
69
- ignoreDependencies,
70
- ignoreBinaries,
71
- ignoreUnresolved,
69
+ ignoreDependencies : id ,
70
+ ignoreBinaries : ib ,
71
+ ignoreUnresolved : iu ,
72
72
} : {
73
73
name : string ;
74
74
cwd : string ;
@@ -110,16 +110,20 @@ export class DependencyDeputy {
110
110
this . setInstalledBinaries ( name , installedBinaries ) ;
111
111
this . setHasTypesIncluded ( name , hasTypesIncluded ) ;
112
112
113
+ const ignoreDependencies = id . map ( toRegexOrString ) ;
114
+ const ignoreBinaries = ib . map ( toRegexOrString ) ;
115
+ const ignoreUnresolved = iu . map ( toRegexOrString ) ;
116
+
113
117
this . _manifests . set ( name , {
114
118
workspaceDir : dir ,
115
119
manifestPath,
116
120
manifestStr,
117
- ignoreDependencies : ignoreDependencies . map ( toRegexOrString ) ,
118
- ignoreBinaries : ignoreBinaries . map ( toRegexOrString ) ,
119
- ignoreUnresolved : ignoreUnresolved . map ( toRegexOrString ) ,
120
- usedIgnoreDependencies : new Set < string | RegExp > ( ) ,
121
- usedIgnoreBinaries : new Set < string | RegExp > ( ) ,
122
- usedIgnoreUnresolved : new Set < string | RegExp > ( ) ,
121
+ ignoreDependencies,
122
+ ignoreBinaries,
123
+ ignoreUnresolved,
124
+ unusedIgnoreDependencies : new Set ( ignoreDependencies ) ,
125
+ unusedIgnoreBinaries : new Set ( ignoreBinaries ) ,
126
+ unusedIgnoreUnresolved : new Set ( ignoreUnresolved ) ,
123
127
dependencies,
124
128
devDependencies,
125
129
peerDependencies : new Set ( peerDependencies ) ,
@@ -347,15 +351,15 @@ export class DependencyDeputy {
347
351
if ( ignoreItem ) {
348
352
delete issueSet [ issueKey ] ;
349
353
counters [ type ] -- ;
350
- manifest . usedIgnoreDependencies . add ( ignoreItem ) ;
354
+ manifest . unusedIgnoreDependencies . delete ( ignoreItem ) ;
351
355
} else if ( issue . workspace !== ROOT_WORKSPACE_NAME ) {
352
356
const manifest = this . getWorkspaceManifest ( ROOT_WORKSPACE_NAME ) ;
353
357
if ( manifest ) {
354
358
const ignoreItem = findMatch ( manifest . ignoreDependencies , packageName ) ;
355
359
if ( ignoreItem ) {
356
360
delete issueSet [ issueKey ] ;
357
361
counters [ type ] -- ;
358
- manifest . usedIgnoreDependencies . add ( ignoreItem ) ;
362
+ manifest . unusedIgnoreDependencies . delete ( ignoreItem ) ;
359
363
}
360
364
}
361
365
}
@@ -381,15 +385,15 @@ export class DependencyDeputy {
381
385
if ( ignoreItem ) {
382
386
delete issueSet [ issueKey ] ;
383
387
counters [ type ] -- ;
384
- manifest . usedIgnoreBinaries . add ( ignoreItem ) ;
388
+ manifest . unusedIgnoreBinaries . delete ( ignoreItem ) ;
385
389
} else {
386
390
const manifest = this . getWorkspaceManifest ( ROOT_WORKSPACE_NAME ) ;
387
391
if ( manifest ) {
388
392
const ignoreItem = findMatch ( manifest . ignoreBinaries , issue . symbol ) ;
389
393
if ( ignoreItem ) {
390
394
delete issueSet [ issueKey ] ;
391
395
counters [ type ] -- ;
392
- manifest . usedIgnoreBinaries . add ( ignoreItem ) ;
396
+ manifest . unusedIgnoreBinaries . delete ( ignoreItem ) ;
393
397
}
394
398
}
395
399
}
@@ -409,15 +413,15 @@ export class DependencyDeputy {
409
413
if ( ignoreItem ) {
410
414
delete issueSet [ issueKey ] ;
411
415
counters . unresolved -- ;
412
- manifest . usedIgnoreUnresolved . add ( ignoreItem ) ;
416
+ manifest . unusedIgnoreUnresolved . delete ( ignoreItem ) ;
413
417
} else {
414
418
const manifest = this . getWorkspaceManifest ( ROOT_WORKSPACE_NAME ) ;
415
419
if ( manifest ) {
416
420
const ignoreItem = findMatch ( manifest . ignoreUnresolved , issue . symbol ) ;
417
421
if ( ignoreItem ) {
418
422
delete issueSet [ issueKey ] ;
419
423
counters . unresolved -- ;
420
- manifest . usedIgnoreUnresolved . add ( ignoreItem ) ;
424
+ manifest . unusedIgnoreUnresolved . delete ( ignoreItem ) ;
421
425
}
422
426
}
423
427
}
@@ -440,22 +444,16 @@ export class DependencyDeputy {
440
444
const configurationHints : ConfigurationHints = new Set ( ) ;
441
445
442
446
for ( const [ workspaceName , manifest ] of this . _manifests . entries ( ) ) {
443
- for ( const identifier of manifest . ignoreDependencies ) {
444
- if ( ! manifest . usedIgnoreDependencies . has ( identifier ) ) {
445
- configurationHints . add ( { workspaceName, identifier, type : 'ignoreDependencies' } ) ;
446
- }
447
+ for ( const identifier of manifest . unusedIgnoreDependencies ) {
448
+ configurationHints . add ( { workspaceName, identifier, type : 'ignoreDependencies' } ) ;
447
449
}
448
450
449
- for ( const identifier of manifest . ignoreBinaries ) {
450
- if ( ! manifest . usedIgnoreBinaries . has ( identifier ) ) {
451
- configurationHints . add ( { workspaceName, identifier, type : 'ignoreBinaries' } ) ;
452
- }
451
+ for ( const identifier of manifest . unusedIgnoreBinaries ) {
452
+ configurationHints . add ( { workspaceName, identifier, type : 'ignoreBinaries' } ) ;
453
453
}
454
454
455
- for ( const identifier of manifest . ignoreUnresolved ) {
456
- if ( ! manifest . usedIgnoreUnresolved . has ( identifier ) ) {
457
- configurationHints . add ( { workspaceName, identifier, type : 'ignoreUnresolved' } ) ;
458
- }
455
+ for ( const identifier of manifest . unusedIgnoreUnresolved ) {
456
+ configurationHints . add ( { workspaceName, identifier, type : 'ignoreUnresolved' } ) ;
459
457
}
460
458
}
461
459
0 commit comments