-
Notifications
You must be signed in to change notification settings - Fork 12.8k
request: Turn off required properties check in TSX context #12016
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
Comments
Duplicate of #7004. |
Yes, it's still relevant. It's exactly the same issue that is described here. If I mark members as optional, I'll have to add null checks for them everywhere, even for methods. This will not do. |
I missed that issue, thank you! |
@thorn0 Sorry, I am not very experienced with React/JSX. thanks for clarifying. |
@aluanhaddad JSX is an abstract syntax without inherent semantics so there is no such thing as the right and only way to type-check it. TypeScript recognizes this fact by providing means to configure how type-checking happens. These means are quite flexible, but just a bit not enough for some use cases. |
@thorn0 I didn't mean to suggest there was a right way or a wrong way, I was suggesting there might be a way. |
@aluanhaddad I didn't mean to argue. It was just a little background on this issue. |
I want to turn off required properties check in TSX context with using skate.js http://skate.js.org/
And, I don't want to turn of type checking about properties.
cc/ @bradleyayers do you interested in this issue?
TypeScript Version: 2.0.6
Code
Reproduce code is here.
https://gist.github.com/vvakame/e7a230fa558763e225b58d57b459f64d
summary
other information.
from src/compiler/checker.ts
I want to change
targetAttributesType && !sawSpreadedAny
to something like...targetAttributesType && !sawSpreadedAny && !suppressRequiredPropertyCheck
.Expected behavior:
We can compile my code.
Actual behavior:
tsc raise a lot of errors.
The text was updated successfully, but these errors were encountered: