File tree 2 files changed +16
-1
lines changed 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1895,7 +1895,8 @@ namespace ts {
1895
1895
filesSpecs = < ReadonlyArray < string > > raw . files ;
1896
1896
const hasReferences = hasProperty ( raw , "references" ) && ! isNullOrUndefined ( raw . references ) ;
1897
1897
const hasZeroOrNoReferences = ! hasReferences || raw . references . length === 0 ;
1898
- if ( filesSpecs . length === 0 && hasZeroOrNoReferences ) {
1898
+ const hasExtends = hasProperty ( raw , "extends" ) ;
1899
+ if ( filesSpecs . length === 0 && hasZeroOrNoReferences && ! hasExtends ) {
1899
1900
if ( sourceFile ) {
1900
1901
const fileName = configFileName || "tsconfig.json" ;
1901
1902
const diagnosticMessage = Diagnostics . The_files_list_in_config_file_0_is_empty ;
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ namespace ts {
96
96
include : null ,
97
97
files : [ "../main.ts" ]
98
98
} ) ,
99
+ "dev/configs/fifth.json" : JSON . stringify ( {
100
+ extends : "./fourth" ,
101
+ include : [ "../tests/utils.ts" ] ,
102
+ files : [ ]
103
+ } ) ,
99
104
"dev/extends.json" : JSON . stringify ( { extends : 42 } ) ,
100
105
"dev/extends2.json" : JSON . stringify ( { extends : "configs/base" } ) ,
101
106
"dev/main.ts" : "" ,
@@ -245,6 +250,15 @@ namespace ts {
245
250
combinePaths ( basePath , "main.ts" )
246
251
] ) ;
247
252
253
+ testSuccess ( "can overwrite top-level files using extended []" , "configs/fifth.json" , {
254
+ allowJs : true ,
255
+ noImplicitAny : true ,
256
+ strictNullChecks : true ,
257
+ module : ModuleKind . System
258
+ } , [
259
+ combinePaths ( basePath , "tests/utils.ts" )
260
+ ] ) ;
261
+
248
262
it ( "adds extendedSourceFiles only once" , ( ) => {
249
263
const sourceFile = readJsonConfigFile ( "configs/fourth.json" , ( path ) => host . readFile ( path ) ) ;
250
264
const dir = combinePaths ( basePath , "configs" ) ;
You can’t perform that action at this time.
0 commit comments