@@ -290,7 +290,7 @@ function mixin(target: any, source: any): any {
290
290
291
291
function rawToTsCompilerOptions ( jsonOptions : CompilerOptions , projectDir : string ) : ts . CompilerOptions {
292
292
// Cannot use Object.create because the compiler checks hasOwnProperty
293
- var compilerOptions = < ts . CompilerOptions > mixin ( { } , defaults ) ;
293
+ var compilerOptions = < ts . CompilerOptions > mixin ( { } , defaults ) ;
294
294
for ( var key in jsonOptions ) {
295
295
if ( typescriptEnumMap [ key ] ) {
296
296
compilerOptions [ key ] = typescriptEnumMap [ key ] [ jsonOptions [ key ] . toLowerCase ( ) ] ;
@@ -322,7 +322,7 @@ function rawToTsCompilerOptions(jsonOptions: CompilerOptions, projectDir: string
322
322
323
323
function tsToRawCompilerOptions ( compilerOptions : ts . CompilerOptions ) : CompilerOptions {
324
324
// Cannot use Object.create because JSON.stringify will only serialize own properties
325
- var jsonOptions = < CompilerOptions > mixin ( { } , compilerOptions ) ;
325
+ var jsonOptions = < CompilerOptions > mixin ( { } , compilerOptions ) ;
326
326
327
327
Object . keys ( compilerOptions ) . forEach ( ( key ) => {
328
328
if ( jsonEnumMap [ key ] && compilerOptions [ key ] ) {
@@ -375,8 +375,8 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
375
375
var projectFile = tsconfig . resolveSync ( dir ) ;
376
376
377
377
if ( ! projectFile ) {
378
- throw errorWithDetails < GET_PROJECT_NO_PROJECT_FOUND_Details > (
379
- new Error ( errors . GET_PROJECT_NO_PROJECT_FOUND ) , { projectFilePath : fsu . consistentPath ( pathOrSrcFile ) , errorMessage : 'not found' } ) ;
378
+ throw errorWithDetails < GET_PROJECT_NO_PROJECT_FOUND_Details > (
379
+ new Error ( errors . GET_PROJECT_NO_PROJECT_FOUND ) , { projectFilePath : fsu . consistentPath ( pathOrSrcFile ) , errorMessage : 'not found' } ) ;
380
380
}
381
381
382
382
var projectFileDirectory = path . dirname ( projectFile ) + path . sep ;
@@ -442,7 +442,7 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
442
442
externalTranspiler : projectSpec . externalTranspiler == undefined ? undefined : projectSpec . externalTranspiler ,
443
443
scripts : projectSpec . scripts || { } ,
444
444
buildOnSave : ! ! projectSpec . buildOnSave ,
445
- atom : { rewriteTsconfig : true , formatOnSave : false }
445
+ atom : { rewriteTsconfig : true , formatOnSave : ! ! projectSpec . atom . formatOnSave }
446
446
} ;
447
447
448
448
// Validate the raw compiler options before converting them to TS compiler options
@@ -521,7 +521,7 @@ function increaseProjectForReferenceAndImports(files: string[]): string[] {
521
521
}
522
522
}
523
523
524
- var getReferencedOrImportedFiles = ( files : string [ ] ) : string [ ] => {
524
+ var getReferencedOrImportedFiles = ( files : string [ ] ) : string [ ] => {
525
525
var referenced : string [ ] [ ] = [ ] ;
526
526
527
527
files . forEach ( file => {
@@ -553,7 +553,7 @@ function increaseProjectForReferenceAndImports(files: string[]): string[] {
553
553
return file ;
554
554
}
555
555
return getIfExists ( file ) ;
556
- } ) . filter ( file => ! ! file )
556
+ } ) . filter ( file => ! ! file )
557
557
. concat (
558
558
preProcessedFileInfo . importedFiles
559
559
. filter ( ( fileReference ) => pathIsRelative ( fileReference . fileName ) )
@@ -564,7 +564,7 @@ function increaseProjectForReferenceAndImports(files: string[]): string[] {
564
564
file = getIfExists ( `${ file } /index` ) ;
565
565
}
566
566
return file ;
567
- } ) . filter ( file => ! ! file )
567
+ } ) . filter ( file => ! ! file )
568
568
)
569
569
) ;
570
570
} ) ;
@@ -610,9 +610,9 @@ function getDefinitionsForNodeModules(projectDir: string, files: string[]): { ou
610
610
// Find our `typings` (anything in a typings folder with extension `.d.ts` is considered a typing)
611
611
// These are INF powerful
612
612
var ourTypings = files
613
- . filter ( f => path . basename ( path . dirname ( f ) ) == 'typings' && endsWith ( f , '.d.ts' )
613
+ . filter ( f => path . basename ( path . dirname ( f ) ) == 'typings' && endsWith ( f , '.d.ts' )
614
614
|| path . basename ( path . dirname ( path . dirname ( f ) ) ) == 'typings' && endsWith ( f , '.d.ts' ) ) ;
615
- ourTypings . forEach ( f => typings [ path . basename ( f ) ] = { filePath : f , version : Infinity } ) ;
615
+ ourTypings . forEach ( f => typings [ path . basename ( f ) ] = { filePath : f , version : Infinity } ) ;
616
616
var existing = createMap ( files . map ( fsu . consistentPath ) ) ;
617
617
618
618
function addAllReferencedFilesWithMaxVersion ( file : string ) {
@@ -635,7 +635,7 @@ function getDefinitionsForNodeModules(projectDir: string, files: string[]): { ou
635
635
if ( fs . existsSync ( file + '.d.ts' ) ) {
636
636
return file + '.d.ts' ;
637
637
}
638
- } ) . filter ( f => ! ! f ) ;
638
+ } ) . filter ( f => ! ! f ) ;
639
639
640
640
// Only ones we don't have by name yet
641
641
// TODO: replace INF with an actual version
@@ -644,7 +644,7 @@ function getDefinitionsForNodeModules(projectDir: string, files: string[]): { ou
644
644
// Add these
645
645
files . forEach ( f => typings [ path . basename ( f ) ] = { filePath : f , version : Infinity } ) ;
646
646
// Keep expanding
647
- files . forEach ( f => addAllReferencedFilesWithMaxVersion ( f ) ) ;
647
+ files . forEach ( f => addAllReferencedFilesWithMaxVersion ( f ) ) ;
648
648
}
649
649
650
650
// Keep going up till we find node_modules
@@ -691,11 +691,11 @@ function getDefinitionsForNodeModules(projectDir: string, files: string[]): { ou
691
691
692
692
var all = Object . keys ( typings )
693
693
. map ( typing => typings [ typing ] . filePath )
694
- . map ( x => fsu . consistentPath ( x ) ) ;
694
+ . map ( x => fsu . consistentPath ( x ) ) ;
695
695
var implicit = all
696
- . filter ( x => ! existing [ x ] ) ;
696
+ . filter ( x => ! existing [ x ] ) ;
697
697
var ours = all
698
- . filter ( x => existing [ x ] ) ;
698
+ . filter ( x => existing [ x ] ) ;
699
699
700
700
return { implicit, ours, packagejson } ;
701
701
}
0 commit comments