tsdx ignores tsconfig.json "extends" keyword
See original GitHub issueCurrent Behavior
There’s an extends feature in tsconfig which allows configuration inheritance across multiple tsconfig files. This however isn’t recognized in tsdx, which parses tsconfig here:
The JSON object is used as-is, instead of drilling up to resolve parent config.
Expected behavior
tsdx should process extends
just like tsc does.
Suggested solution(s)
In a quick look through TypeScript’s source code I couldn’t find the place where extends
is handled, but it’s possible that TypeScript’s exported tsconfig parsing functions might handle extends for us automatically. See https://github.com/microsoft/TypeScript/blob/760393f893358a462b00eef7e8fb92342b0f71ad/lib/typescript.d.ts#L3639-L3647 what what TS offers in its API. The implementation is here: https://github.com/Microsoft/TypeScript/blob/6487d1ffe0d903b1e55a187ddeb973fe0d445a2f/src/compiler/parser.ts#L717
Additional context
This problem is similar to #483 in that both this issue and that one are caused by parsing tsconfig differently than tsc does.
Your environment
Software | Version(s) |
---|---|
TSDX | tsdx@0.12.3 |
TypeScript | typescript@3.7.5 |
Browser | n/a (this is a build issue) |
npm/Yarn | yarn@1.21.1 |
Node | v12.13.1 |
Operating System | MacOS Catalina 10.15.2 |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:20 (3 by maintainers)
Top GitHub Comments
@sw-yx think that might be the first time I’ve been asked to contribute less 🤔 🤔 🤔
Oh, I already did hah. @justingrant said he didn’t have time for this in https://github.com/jaredpalmer/tsdx/issues/483#issuecomment-581238335 so I made the solution myself (see above reference). Still need to add a test for the extends case, hence the draft, but will do that in a day or few as I have to focus on some other things