File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1895,7 +1895,8 @@ namespace ts {
18951895 filesSpecs = < ReadonlyArray < string > > raw . files ;
18961896 const hasReferences = hasProperty ( raw , "references" ) && ! isNullOrUndefined ( raw . references ) ;
18971897 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 ) {
18991900 if ( sourceFile ) {
19001901 const fileName = configFileName || "tsconfig.json" ;
19011902 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 {
9696 include : null ,
9797 files : [ "../main.ts" ]
9898 } ) ,
99+ "dev/configs/fifth.json" : JSON . stringify ( {
100+ extends : "./fourth" ,
101+ include : [ "../tests/utils.ts" ] ,
102+ files : [ ]
103+ } ) ,
99104 "dev/extends.json" : JSON . stringify ( { extends : 42 } ) ,
100105 "dev/extends2.json" : JSON . stringify ( { extends : "configs/base" } ) ,
101106 "dev/main.ts" : "" ,
@@ -245,6 +250,15 @@ namespace ts {
245250 combinePaths ( basePath , "main.ts" )
246251 ] ) ;
247252
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+
248262 it ( "adds extendedSourceFiles only once" , ( ) => {
249263 const sourceFile = readJsonConfigFile ( "configs/fourth.json" , ( path ) => host . readFile ( path ) ) ;
250264 const dir = combinePaths ( basePath , "configs" ) ;
You can’t perform that action at this time.
0 commit comments