jsx icon indicating copy to clipboard operation
jsx copied to clipboard

Disallow `<` after a JSX element

Open nicolo-ribaudo opened this issue 3 years ago • 0 comments

Fixes #120.

This was quite hard to specify:

  • I initially tried to add an early error to RelationalExpression saying something like "It is a SyntaxError if the left side of the expression recursively contains a JSXElementOrFragment as its right-most descendent.", but it would have required writing some custom sdo for every production that can derive a JSXElementOrFragment as a child of RelationalExpression.
  • 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.

nicolo-ribaudo avatar Feb 25 '22 19:02 nicolo-ribaudo