@@ -27,11 +27,12 @@ export async function emitDts(
27
27
const start = Date . now ( ) ;
28
28
const { configPath, declarationDir, name, dtsExtension, banner, footer } =
29
29
options ;
30
+ const configFileParseResult = loadTsconfig ( configPath ) ;
30
31
const {
31
32
options : rawCompilerOptions ,
32
33
fileNames,
33
34
projectReferences,
34
- } = loadTsconfig ( configPath ) ;
35
+ } = configFileParseResult ;
35
36
36
37
const compilerOptions = {
37
38
...rawCompilerOptions ,
@@ -49,6 +50,9 @@ export async function emitDts(
49
50
options : compilerOptions ,
50
51
projectReferences,
51
52
host,
53
+ configFileParsingDiagnostics : ts . getConfigFileParsingDiagnostics (
54
+ configFileParseResult ,
55
+ ) ,
52
56
} ) ;
53
57
54
58
const emitResult = program . emit ( ) ;
@@ -60,7 +64,7 @@ export async function emitDts(
60
64
const diagnosticMessages : string [ ] = [ ] ;
61
65
62
66
for ( const diagnostic of allDiagnostics ) {
63
- const fileLoc = getFileLoc ( diagnostic ) ;
67
+ const fileLoc = getFileLoc ( diagnostic , configPath ) ;
64
68
const message = `${ fileLoc } - ${ color . red ( 'error' ) } ${ color . gray ( `TS${ diagnostic . code } :` ) } ${ ts . flattenDiagnosticMessageText (
65
69
diagnostic . messageText ,
66
70
host . getNewLine ( ) ,
@@ -94,7 +98,7 @@ export async function emitDts(
94
98
} ;
95
99
96
100
const reportDiagnostic = ( diagnostic : ts . Diagnostic ) => {
97
- const fileLoc = getFileLoc ( diagnostic ) ;
101
+ const fileLoc = getFileLoc ( diagnostic , configPath ) ;
98
102
99
103
logger . error (
100
104
`${ fileLoc } - ${ color . red ( 'error' ) } ${ color . gray ( `TS${ diagnostic . code } :` ) } ` ,
0 commit comments