-
-
Notifications
You must be signed in to change notification settings - Fork 286
-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
[@smui/common] TypeError for projects with exactOptionalPropertyTypes: true
#664
Labels
bug
Something isn't working
Comments
5 tasks
I tried fixing it, an easy fix would be to replace
|
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hello, I have a TS project using SMUI and I want to turn on the
exactOptionalPropertyTypes
tsconfig option. The trouble is, since SMUI distributes TS source files, those get checked by the TS compiler as well, so the extra check gets applied to them as well... and it fails.I would like to stress that this is not a false positive - the extra check uncovers what is really a potential issue in
@smui/common
. See the following line:svelte-material-ui/packages/common/src/internal/dispatch.ts
Lines 15 to 18 in 19ea8ed
Here the
new CustomEvent
infers itsT
type from the type of thedetail
property - which with the extra check is more strictly inferred asT | undefined
- this is IMHO correct, because the property is marked as optional in the function signature...To Reproduce
Steps to reproduce the behavior:
@smui/common
in a project (install it from NPM)exactOptionalPropertyTypes
Expected behavior
No error
Actual behavior
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: