@@ -202,14 +202,13 @@ export function register (opts: Options = {}): Register {
202
202
203
203
// Require the TypeScript compiler and configuration.
204
204
const cwd = process . cwd ( )
205
- const { compilerOptions, project, skipProject, files } = options
206
205
const typeCheck = options . typeCheck === true || options . transpileOnly !== true
207
206
const compiler = require . resolve ( options . compiler || 'typescript' , { paths : [ cwd ] } )
208
207
const ts : typeof _ts = require ( compiler )
209
208
const transformers = options . transformers || undefined
210
209
const readFile = options . readFile || ts . sys . readFile
211
210
const fileExists = options . fileExists || ts . sys . fileExists
212
- const config = readConfig ( cwd , ts , fileExists , readFile , compilerOptions , project , skipProject , files )
211
+ const config = readConfig ( cwd , ts , fileExists , readFile , options )
213
212
const configDiagnosticList = filterDiagnostics ( config . errors , ignoreDiagnostics )
214
213
const extensions = [ '.ts' , '.tsx' ]
215
214
@@ -451,19 +450,16 @@ function readConfig (
451
450
ts : TSCommon ,
452
451
fileExists : ( path : string ) => boolean ,
453
452
readFile : ( path : string ) => string | undefined ,
454
- compilerOptions ?: object ,
455
- project ?: string ,
456
- skipProject ?: boolean | null ,
457
- includeFiles ?: boolean | null
453
+ options : Options
458
454
) : _ts . ParsedCommandLine {
459
455
let config : any = { compilerOptions : { } }
460
456
let basePath = normalizeSlashes ( cwd )
461
457
let configFileName : string | undefined = undefined
462
458
463
459
// Read project configuration when available.
464
- if ( ! skipProject ) {
465
- configFileName = project
466
- ? normalizeSlashes ( resolve ( cwd , project ) )
460
+ if ( ! options . skipProject ) {
461
+ configFileName = options . project
462
+ ? normalizeSlashes ( resolve ( cwd , options . project ) )
467
463
: ts . findConfigFile ( normalizeSlashes ( cwd ) , fileExists )
468
464
469
465
if ( configFileName ) {
@@ -480,13 +476,13 @@ function readConfig (
480
476
}
481
477
482
478
// Remove resolution of "files".
483
- if ( ! includeFiles ) {
479
+ if ( ! options . files ) {
484
480
config . files = [ ]
485
- config . includes = [ ]
481
+ config . include = [ ]
486
482
}
487
483
488
484
// Override default configuration options `ts-node` requires.
489
- config . compilerOptions = Object . assign ( { } , config . compilerOptions , compilerOptions , TS_NODE_COMPILER_OPTIONS )
485
+ config . compilerOptions = Object . assign ( { } , config . compilerOptions , options . compilerOptions , TS_NODE_COMPILER_OPTIONS )
490
486
491
487
return fixConfig ( ts , ts . parseJsonConfigFileContent ( config , ts . sys , basePath , undefined , configFileName ) )
492
488
}
0 commit comments