-
Notifications
You must be signed in to change notification settings - Fork 18
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
Type assertion error #47
Comments
I try it in ts playground. Get a lot of errors.Could u check this code? |
Actually I run the AST parser in a javascript file. Here is a simpler version of the code:
The point is, the error occurs whenever there is any type assertion in the code be it : |
This is a very ambiguous syntax between JSX and TS. You can see in the stack trace that it's being treated as JSX. |
I haven't tried the type casting approach but that seems to be a valid temporary solution. However, changing all of the type assertion to type casting would seems to be a pretty tedious work in a large codebase. I don't really need the type assertion in the return response for now, so my temporary solution for now is to delete the type assertion before being parsed by the AST parser. |
This is the parser code that I used
The source code file contains the Secret type assertion which cause the parser to fail:
Error:
Are there some additional options that I need to enable to make this work ?
The text was updated successfully, but these errors were encountered: