@@ -10,11 +10,12 @@ import { readFile, stat, unlink } from "fs/promises";
1010import { createRequire } from "module" ;
1111import path from "path" ;
1212import readline from "readline" ;
13- import { problemFlags , resolutionKinds } from "./problemUtils.js" ;
13+ import { problemFlags } from "./problemUtils.js" ;
1414import { readConfig } from "./readConfig.js" ;
1515import * as render from "./render/index.js" ;
1616import { major , minor } from "semver" ;
1717import { getExitCode } from "./getExitCode.js" ;
18+ import { applyProfile , profiles } from "./profiles.js" ;
1819
1920const packageJson = createRequire ( import . meta. url ) ( "../package.json" ) ;
2021const version = packageJson . version ;
@@ -28,6 +29,8 @@ const formats = Object.keys({
2829} satisfies Record < render . Format , any > ) as render . Format [ ] ;
2930
3031interface Opts extends render . RenderOptions {
32+ profile ?: keyof typeof profiles ;
33+
3134 pack ?: boolean ;
3235 fromNpm ?: boolean ;
3336 definitelyTyped ?: boolean | string ;
@@ -81,9 +84,7 @@ particularly ESM-related module resolution issues.`,
8184 new Option ( "--ignore-rules <rules...>" , "Specify rules to ignore" ) . choices ( Object . values ( problemFlags ) ) . default ( [ ] ) ,
8285 )
8386 . addOption (
84- new Option ( "--ignore-resolutions <resolutions...>" , "Specify resolutions to ignore" )
85- . choices ( Object . keys ( resolutionKinds ) )
86- . default ( [ ] ) ,
87+ new Option ( "--profile <profile>" , "Specify analysis profile" ) . choices ( Object . keys ( profiles ) ) . default ( "strict" ) ,
8788 )
8889 . option ( "--summary, --no-summary" , "Whether to print summary information about the different errors" )
8990 . option ( "--emoji, --no-emoji" , "Whether to use any emojis" )
@@ -93,6 +94,10 @@ particularly ESM-related module resolution issues.`,
9394 const opts = program . opts < Opts > ( ) ;
9495 await readConfig ( program , opts . configPath ) ;
9596
97+ if ( opts . profile ) {
98+ applyProfile ( opts . profile , opts ) ;
99+ }
100+
96101 if ( opts . quiet ) {
97102 console . log = ( ) => { } ;
98103 }
0 commit comments