ostrowr/ts-json-validator

Invalid syntax in .d.ts files in Typescript 3.9

ostrowr opened this issue · 1 comments

Typescript 3.9 introduced a cap on type size. It's easy to reach that cap when using this library.

See microsoft/TypeScript#38557 for more information and details about the workarounds.

Describe the bug
.d.ts files are truncated, producing invalid syntax. "..."

To work around this, you can try the fix described here: microsoft/TypeScript#38557 (comment) or (possibly) split up your schemas into several files.

You can also continue to use 3.7 or 3.8 until this is fixed.

I'm hoping the Typescript maintainers change their mind about this cap.

To Reproduce
Any sufficiently complicated (set of) schemas in some file may hit this cap.

Expected behavior
tsc produces valid code

Actual behavior
tsc produces invalid code

Fixed in Typescript 4.1; see microsoft/TypeScript#38557