Typescript 3.9 compatibility
Closed this issue ยท 7 comments
joi-extract-type @ 15.0.2 appears to be incompatible with Typescript 3.9 and above (at the time of writing 3.9.2).
Most of the errors seem to do with the usage of generics and circular references eg.:
Type alias 'extractType' circularly references itself
Type 'extractMap' is not generic
Seems that typescript 3.7 made some changes about this that we may have to adapt to
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#more-recursive-type-aliases
It seems the issues start with 3.9 - 3.8.3 works fine.
Yep, seeing the same issue here after running an npm install. package-lock TS 3.9.5
Yep^ - except I wasn't able to select a new dropdown from the same list that you've provided a screenshot of there @wspringer
I believe you can set it at a workspace level but I tend to have lots of projects open in the same instance of code, in which case the solution I've found is to override the default VSCode TS version based on the globally installed TS version via npm (mine is 3.8.3).
Open this file /Users/your_name/Library/Application Support/Code/User/settings.json
Add in "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib"
(points to npm i -g typescript@3.8.3
Reload your editor.
Basically, from the TypeScript team [^1]:
Certain things can be deferred if there's a different declaration to "pause" the circularity at. I don't want to commit any specific circular behavior to bug/not bug; it depends on a lot of different factors and is sensitive to exactly where TS tries to resolve certain conditionals.
So here is a fix to make the compiler of TypeScript 3.9.6 happy with Joi.extractType
: #35
Thanks for this! Any ETA on a new release that includes this?