Parsing error when yielding JSX without parenthesis
Closed this issue · 3 comments
kentor commented
Originally filed eslint/espree#355 but was told to file it here:
Currently we get a parsing error Unexpected token <
with this:
function* test() {
yield <Hey />;
}
However, if you use the babylon7 parser it works.
I used to just add parens around the JSX for this to work:
function* test() {
yield (<Hey />);
}
But it is now an issue when using eslint + eslint-plugin-prettier because prettier removes the parens and then eslint (using espree) gets a parsing error after that.
danez commented
babylon fixed it here:
babel/babel@de56e12
alexander-akait commented
/cc @RReverser friendly ping
RReverser commented
Looks like the port from Babylon should be easy, I'm happy to accept a PR.