jsx
jsx copied to clipboard
Disallow `<` after a JSX element
Fixes #120.
This was quite hard to specify:
- I initially tried to add an early error to
RelationalExpressionsaying something like "It is a SyntaxError if the left side of the expression recursively contains aJSXElementOrFragmentas its right-most descendent.", but it would have required writing some custom sdo for every production that can derive aJSXElementOrFragmentas a child ofRelationalExpression. - The spec explicitly ignores lookaheads in static semantics, so I wanted to avoid doing it.
:warning: Almost all the tools already implement this error, but it would be a breaking change for the Flow type checker.