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.
Originally filed https://github.com/eslint/espree/issues/355 but was told to file it here:
Currently we get a parsing error
Unexpected token <
with this:https://astexplorer.net/#/gist/a96aa934d341355b14576ef0e006b02a/97e8c8019fd5610b88d9403b61406707188d8d1c
However, if you use the babylon7 parser it works.
I used to just add parens around the JSX for this to work:
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.