@@ -11,12 +11,13 @@ import type { RenderOptions } from "./index.js";
11
11
12
12
export async function typed (
13
13
analysis : core . Analysis ,
14
- { emoji = true , summary = true , format = "auto" , ignoreRules = [ ] } : RenderOptions ,
14
+ { emoji = true , summary = true , format = "auto" , ignoreRules = [ ] , ignoreResolutions = [ ] } : RenderOptions ,
15
15
) : Promise < string > {
16
16
let output = "" ;
17
17
const problems = analysis . problems . filter (
18
18
( problem ) => ! ignoreRules || ! ignoreRules . includes ( problemFlags [ problem . kind ] ) ,
19
19
) ;
20
+ const resolutions = allResolutionKinds . filter ( ( kind ) => ! ignoreResolutions . includes ( kind ) ) ;
20
21
const grouped = groupProblemsByKind ( problems ) ;
21
22
const entrypoints = Object . keys ( analysis . entrypoints ) ;
22
23
marked . setOptions ( {
@@ -43,6 +44,11 @@ export async function typed(
43
44
if ( ignoreRules && ignoreRules . length ) {
44
45
out ( chalk . gray ( ` (ignoring rules: ${ ignoreRules . map ( ( rule ) => `'${ rule } '` ) . join ( ", " ) } )\n` ) ) ;
45
46
}
47
+ if ( ignoreResolutions && ignoreResolutions . length ) {
48
+ out (
49
+ chalk . gray ( ` (ignoring resolutions: ${ ignoreResolutions . map ( ( resolution ) => `'${ resolution } '` ) . join ( ", " ) } )\n` ) ,
50
+ ) ;
51
+ }
46
52
47
53
if ( summary ) {
48
54
const defaultSummary = marked ( ! emoji ? " No problems found" : " No problems found 🌟" ) ;
@@ -93,14 +99,14 @@ export async function typed(
93
99
const flippedTable =
94
100
format === "auto" || format === "table-flipped"
95
101
? new Table ( {
96
- head : [ "" , ...allResolutionKinds . map ( ( kind ) => chalk . reset ( resolutionKinds [ kind ] ) ) ] ,
102
+ head : [ "" , ...resolutions . map ( ( kind ) => chalk . reset ( resolutionKinds [ kind ] ) ) ] ,
97
103
} )
98
104
: undefined ;
99
105
if ( flippedTable ) {
100
106
entrypoints . forEach ( ( subpath , i ) => {
101
107
flippedTable . push ( [
102
108
entrypointHeaders [ i ] ,
103
- ...allResolutionKinds . map ( ( resolutionKind ) => getCellContents ( subpath , resolutionKind ) ) ,
109
+ ...resolutions . map ( ( resolutionKind ) => getCellContents ( subpath , resolutionKind ) ) ,
104
110
] ) ;
105
111
} ) ;
106
112
}
@@ -112,7 +118,7 @@ export async function typed(
112
118
} ) as GenericTable < HorizontalTableRow > )
113
119
: undefined ;
114
120
if ( table ) {
115
- allResolutionKinds . forEach ( ( kind ) => {
121
+ resolutions . forEach ( ( kind ) => {
116
122
table . push ( [ resolutionKinds [ kind ] , ...entrypoints . map ( ( entrypoint ) => getCellContents ( entrypoint , kind ) ) ] ) ;
117
123
} ) ;
118
124
}
0 commit comments