@@ -22,7 +22,6 @@ import { basename, dirname, relative, resolve } from 'path';
2222
2323import { IMinimatch , Minimatch } from 'minimatch' ;
2424import { parseConfigFileTextToJson } from 'typescript' ;
25- import deepMerge from 'deepmerge' ;
2625
2726import { REPO_ROOT } from '../constants' ;
2827
@@ -36,17 +35,7 @@ function makeMatchers(directory: string, patterns: string[]) {
3635}
3736
3837function parseTsConfig ( path : string ) {
39- // eslint-disable-next-line prefer-const
40- let { error, config } = parseConfigFileTextToJson ( path , readFileSync ( path , 'utf8' ) ) ;
41- if ( config . extends ) {
42- const extendsPath = resolve ( dirname ( path ) , config . extends ) ;
43- const extendSource = parseTsConfig ( extendsPath ) ;
44- // This is a really rough approximation of Typescript's `extends`
45- // behaviour and doesn't correctly include all files. But I couldn't find
46- // a public API to read a fully extend config. Seems like
47- // `getParsedCommandLine` might be what we want but unsure how to use it?
48- config = deepMerge ( config , extendSource ) ;
49- }
38+ const { error, config } = parseConfigFileTextToJson ( path , readFileSync ( path , 'utf8' ) ) ;
5039
5140 if ( error ) {
5241 throw error ;
@@ -81,7 +70,7 @@ export class Project {
8170 exclude ?: string [ ] ;
8271 } ;
8372
84- if ( files || ! include ) {
73+ if ( ( files && files . length > 0 ) || ! include ) {
8574 throw new Error (
8675 'tsconfig.json files in the Kibana repo must use "include" keys and not "files"'
8776 ) ;
@@ -91,7 +80,7 @@ export class Project {
9180 this . disableTypeCheck = options . disableTypeCheck || false ;
9281 this . disableNoEmit = options . disableNoEmit || false ;
9382 this . name = options . name || relative ( REPO_ROOT , this . directory ) || basename ( this . directory ) ;
94- this . include = makeMatchers ( this . directory , include ) ;
83+ this . include = makeMatchers ( this . directory , include || [ ] ) ;
9584 this . exclude = makeMatchers ( this . directory , exclude ) ;
9685 }
9786
0 commit comments