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