@@ -10,11 +10,12 @@ import { readFile, stat, unlink } from "fs/promises";
10
10
import { createRequire } from "module" ;
11
11
import path from "path" ;
12
12
import readline from "readline" ;
13
- import { problemFlags , resolutionKinds } from "./problemUtils.js" ;
13
+ import { problemFlags } from "./problemUtils.js" ;
14
14
import { readConfig } from "./readConfig.js" ;
15
15
import * as render from "./render/index.js" ;
16
16
import { major , minor } from "semver" ;
17
17
import { getExitCode } from "./getExitCode.js" ;
18
+ import { applyProfile , profiles } from "./profiles.js" ;
18
19
19
20
const packageJson = createRequire ( import . meta. url ) ( "../package.json" ) ;
20
21
const version = packageJson . version ;
@@ -28,6 +29,8 @@ const formats = Object.keys({
28
29
} satisfies Record < render . Format , any > ) as render . Format [ ] ;
29
30
30
31
interface Opts extends render . RenderOptions {
32
+ profile ?: keyof typeof profiles ;
33
+
31
34
pack ?: boolean ;
32
35
fromNpm ?: boolean ;
33
36
definitelyTyped ?: boolean | string ;
@@ -81,9 +84,7 @@ particularly ESM-related module resolution issues.`,
81
84
new Option ( "--ignore-rules <rules...>" , "Specify rules to ignore" ) . choices ( Object . values ( problemFlags ) ) . default ( [ ] ) ,
82
85
)
83
86
. 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" ) ,
87
88
)
88
89
. option ( "--summary, --no-summary" , "Whether to print summary information about the different errors" )
89
90
. option ( "--emoji, --no-emoji" , "Whether to use any emojis" )
@@ -93,6 +94,10 @@ particularly ESM-related module resolution issues.`,
93
94
const opts = program . opts < Opts > ( ) ;
94
95
await readConfig ( program , opts . configPath ) ;
95
96
97
+ if ( opts . profile ) {
98
+ applyProfile ( opts . profile , opts ) ;
99
+ }
100
+
96
101
if ( opts . quiet ) {
97
102
console . log = ( ) => { } ;
98
103
}
0 commit comments