-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Missing support in @vue/runtime-dom
for TypeScript's --exactOptionalPropertyTypes
option
#6068
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
Labels
Comments
@vue/runtime-dom
for TypeScript's --exactOptionalPropertyTypes
option
2 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vue version
3.2.36
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-hguguz?file=tsconfig.json,src%2FApp.vue&terminal=dev
Steps to reproduce
vue-tsc --noEmit
What is expected?
The command
vue-tsc --noEmit
runs without errors.What is actually happening?
The command
vue-tsc --noEmit
gives type errors (output below was copied from StackBlitz reproduction):System Info
No response
Any additional comments?
TypeScript 4.4 introduced a new option
--exactOptionalPropertyTypes
which specifies that optional property types should be interpreted exactly as written, meaning that| undefined
is not added to the type.The
*HTMLAttributes
interfaces in@vue/runtime-dom
are lacking the| undefined
type, meaning thatvue-tsc
with enabled--exactOptionalPropertyTypes
flag will fail.Regarding the StackBlitz reproduction, the
ImgHTMLAttributes
interface should be defined at least asinstead of
However, for sake of completion the
| undefined
type needs to be added to all optional properties, not only thealt?
one.The text was updated successfully, but these errors were encountered: