-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve @ts-expect-error
directives
#776
Comments
A better solution would be to figure out how to avoid the recursive inference problem. If we can't find a solution, we could try to limit the recursiveness to a certain depth. Are you interested in exploring this problem? |
Done 😉 #778 |
Related issue at the TS repo: microsoft/TypeScript#38628 |
Good find! Looking at that issue, how about |
This may work, but it is a dirty hack. I would prefer an official solution, or that we rethink our implementation. But I will consider it. |
This will probably be fixed in the next version. |
v0.38.0 is available 🚀 |
As mentioned in #659 (comment), some prefer to keep
skipLibCheck
off. It's not about being pedantic, it can help explain otherwise cryptic errors (speaking from experience), and puts pressure on the ecosystem to keep their types clean.However, in this case it isn't an easy fix at all (looks like
QuestionMarkSchema
being recursive pushes the limits of inference, microsoft/TypeScript#30134, microsoft/TypeScript#47599). Hit my head for half an hour, to no avail.Thankfully, this repo already has
// @ts-expect-error
peppered throughout:valibot/library/src/types/other.ts
Lines 90 to 99 in 094d984
So all that needs to be done is just preserve these in the emitted
.d.ts
. Easier said than done, as I haven't been able to find iftsc
can even do it, but worst case, at least it could be a post-build script just adding these back in aboveQuestionMarkSchema
andQuestionMarkSchemaAsync
, and inside ofTuplePath
.The text was updated successfully, but these errors were encountered: