@@ -1739,14 +1739,23 @@ namespace ts {
1739
1739
return false ;
1740
1740
}
1741
1741
1742
+ export interface TSConfig {
1743
+ compilerOptions : CompilerOptions ;
1744
+ compileOnSave : boolean | undefined ;
1745
+ references : ReadonlyArray < ProjectReference > | undefined ;
1746
+ exclude ?: ReadonlyArray < string > ;
1747
+ include ?: ReadonlyArray < string > ;
1748
+ files : ReadonlyArray < string > | undefined ;
1749
+ }
1750
+
1742
1751
/**
1743
1752
* Generate an uncommented, complete tsconfig for use with "--showConfig"
1744
1753
* @param configParseResult options to be generated into tsconfig.json
1745
1754
* @param configFileName name of the parsed config file - output paths will be generated relative to this
1746
1755
* @param host provides current directory and case sensitivity services
1747
1756
*/
1748
1757
/** @internal */
1749
- export function convertToTSConfig ( configParseResult : ParsedCommandLine , configFileName : string , host : { getCurrentDirectory ( ) : string , useCaseSensitiveFileNames : boolean } ) : object {
1758
+ export function convertToTSConfig ( configParseResult : ParsedCommandLine , configFileName : string , host : { getCurrentDirectory ( ) : string , useCaseSensitiveFileNames : boolean } ) : TSConfig {
1750
1759
const getCanonicalFileName = createGetCanonicalFileName ( host . useCaseSensitiveFileNames ) ;
1751
1760
const files = map (
1752
1761
filter (
@@ -1774,13 +1783,13 @@ namespace ts {
1774
1783
build : undefined ,
1775
1784
version : undefined ,
1776
1785
} ,
1777
- references : map ( configParseResult . projectReferences , r => ( { ...r , path : r . originalPath , originalPath : undefined } ) ) ,
1786
+ references : map ( configParseResult . projectReferences , r => ( { ...r , path : r . originalPath ? r . originalPath : "" , originalPath : undefined } ) ) ,
1778
1787
files : length ( files ) ? files : undefined ,
1779
1788
...( configParseResult . configFileSpecs ? {
1780
1789
include : filterSameAsDefaultInclude ( configParseResult . configFileSpecs . validatedIncludeSpecs ) ,
1781
1790
exclude : configParseResult . configFileSpecs . validatedExcludeSpecs
1782
1791
} : { } ) ,
1783
- compilerOnSave : ! ! configParseResult . compileOnSave ? true : undefined
1792
+ compileOnSave : ! ! configParseResult . compileOnSave ? true : undefined
1784
1793
} ;
1785
1794
return config ;
1786
1795
}
0 commit comments