-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Support JSX Element as JSX Attribute Value #7410
Description
TypeScript Version:
1.8.2
Background:
I have been working on trying to get https://github.com/eslint/typescript-eslint-parser, a TypeScript parser plugin for ESLint, off the ground, and the job this weekend has been to begin adding JSX support.
ESLint uses espree and so the aim of the project is to convert the output of the tsc to an AST which espree expects. We already have a solid suite of JSX tests to develop against (taken from the espree project itself), but I have come up against a tsc error in one of them so far.
My issue is that it seems currently the tsc does not accept this "embedded-tags" JSX syntax:
Code
<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />;Expected behavior:
Please note the AST produced by espree (see in particular the tokens array): http://astexplorer.net/#/9WAjizSvbC
Actual behavior:
...compared to the one produced by the tsc (note the issues found in parseDiagnostics):
http://astexplorer.net/#/YehKzLJYMW