ostrowr / ts-json-validator

Let JSON play nicely with Typescript
MIT License
342 stars 7 forks source link

Invalid syntax in .d.ts files in Typescript 3.9 #33

Closed ostrowr closed 3 years ago

ostrowr commented 4 years ago

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

See https://github.com/microsoft/TypeScript/issues/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: https://github.com/microsoft/TypeScript/issues/38557#issuecomment-628894564 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

ostrowr commented 3 years ago

Fixed in Typescript 4.1; see https://github.com/microsoft/TypeScript/issues/38557