Use TSX parser instead of Typescript parser for JavaScript and JSX#229
Use TSX parser instead of Typescript parser for JavaScript and JSX#229maxbrunsfeld merged 5 commits intomasterfrom
Conversation
|
Is there any testing that should be added for this? Previously, we would have gotten parse errors on any |
|
Let's do something like this, but with a |
Also, add a unit test for JSX in JavaScript. Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
|
While we were here, @rewinfrey and I also added some limited support for Type arguments in TSX (microsoft/TypeScript#22415). |
| (JsxElement | ||
| (JsxOpeningElement | ||
| (Identifier) | ||
| (Empty) |
There was a problem hiding this comment.
JsxOpeningElement terms now have an optional TypeArguments child. We based this off the way that type arguments are handled in the New node.
tclem
left a comment
There was a problem hiding this comment.
LGTM. Can we do a manually run of the parse-examples target (we use to do this in CI, but travis can't quiet keep up with the workload)?
JavaScript (and
.jsx) files can contain JSX (and cannot use TypeScript's type assertion syntax), so we need to use the TSX dialect of TypeScript when parsing and analyzing them.