-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Handle @jsx
pragmas for TypeScript
#3560
Comments
It should be analyzed in the transformer. |
Would it not be useful to add a |
Nope, it's not part of the spec so it can't go into the AST. |
But it is part of the TS spec, no? https://www.typescriptlang.org/docs/handbook/jsx.html#configuring-jsx |
That's not an AST spec, it's just documentation 😅 |
OK, true! But what's the difference? Spec and config are both things which are present in the source text, and alter the meaning of the code. Therefore I feel it's better to store that useful info in AST. And we have to parse it somewhere, so might as well parse it in the parser. But I don't feel strongly about it - say no one more time, and I'll shut up! |
PS It'd also be faster to find these comments in parser while parsing comments anyway, rather than searching through all comments again later. |
You can save them into |
In #3553 The lines in https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsxComplexSignatureHasApplicabilityError.tsx
are compiler settings for the test file, they aren't pragmas. In tsx files, the prgrama
produces
which is working as intended. |
We recently added more support for
@jsx
pragmas in conformance suite (#3553).I believe some of these should be handled in parser/semantic/transformer (not sure which) instead for TS/TSX files. According to TS docs, they're valid:
https://www.typescriptlang.org/docs/handbook/jsx.html#configuring-jsx
The text was updated successfully, but these errors were encountered: