@@ -11,12 +11,13 @@ import type { RenderOptions } from "./index.js";
1111
1212export async function typed (
1313 analysis : core . Analysis ,
14- { emoji = true , summary = true , format = "auto" , ignoreRules = [ ] } : RenderOptions ,
14+ { emoji = true , summary = true , format = "auto" , ignoreRules = [ ] , ignoreResolutions = [ ] } : RenderOptions ,
1515) : Promise < string > {
1616 let output = "" ;
1717 const problems = analysis . problems . filter (
1818 ( problem ) => ! ignoreRules || ! ignoreRules . includes ( problemFlags [ problem . kind ] ) ,
1919 ) ;
20+ const resolutions = allResolutionKinds . filter ( ( kind ) => ! ignoreResolutions . includes ( kind ) ) ;
2021 const grouped = groupProblemsByKind ( problems ) ;
2122 const entrypoints = Object . keys ( analysis . entrypoints ) ;
2223 marked . setOptions ( {
@@ -43,6 +44,11 @@ export async function typed(
4344 if ( ignoreRules && ignoreRules . length ) {
4445 out ( chalk . gray ( ` (ignoring rules: ${ ignoreRules . map ( ( rule ) => `'${ rule } '` ) . join ( ", " ) } )\n` ) ) ;
4546 }
47+ if ( ignoreResolutions && ignoreResolutions . length ) {
48+ out (
49+ chalk . gray ( ` (ignoring resolutions: ${ ignoreResolutions . map ( ( resolution ) => `'${ resolution } '` ) . join ( ", " ) } )\n` ) ,
50+ ) ;
51+ }
4652
4753 if ( summary ) {
4854 const defaultSummary = marked ( ! emoji ? " No problems found" : " No problems found 🌟" ) ;
@@ -91,14 +97,14 @@ export async function typed(
9197 const flippedTable =
9298 format === "auto" || format === "table-flipped"
9399 ? new Table ( {
94- head : [ "" , ...allResolutionKinds . map ( ( kind ) => chalk . reset ( resolutionKinds [ kind ] ) ) ] ,
100+ head : [ "" , ...resolutions . map ( ( kind ) => chalk . reset ( resolutionKinds [ kind ] ) ) ] ,
95101 } )
96102 : undefined ;
97103 if ( flippedTable ) {
98104 entrypoints . forEach ( ( subpath , i ) => {
99105 flippedTable . push ( [
100106 entrypointHeaders [ i ] ,
101- ...allResolutionKinds . map ( ( resolutionKind ) => getCellContents ( subpath , resolutionKind ) ) ,
107+ ...resolutions . map ( ( resolutionKind ) => getCellContents ( subpath , resolutionKind ) ) ,
102108 ] ) ;
103109 } ) ;
104110 }
@@ -110,7 +116,7 @@ export async function typed(
110116 } ) as GenericTable < HorizontalTableRow > )
111117 : undefined ;
112118 if ( table ) {
113- allResolutionKinds . forEach ( ( kind ) => {
119+ resolutions . forEach ( ( kind ) => {
114120 table . push ( [ resolutionKinds [ kind ] , ...entrypoints . map ( ( entrypoint ) => getCellContents ( entrypoint , kind ) ) ] ) ;
115121 } ) ;
116122 }
0 commit comments