Skip to content

Parse JSX elements and fragments as primary expressions - #65725

Draft
magic-akari wants to merge 2 commits into
microsoft:mainfrom
magic-akari:fix/jsx-primary-expressions
Draft

magic-akari wants to merge 2 commits into
microsoft:mainfrom
magic-akari:fix/jsx-primary-expressions

Conversation

@magic-akari

Copy link
Copy Markdown
Contributor

The parser returned too early after reading a JSX element or fragment. This could split a valid expression at a line break or produce a spurious semicolon error on the same line.

This change parses JSX elements and fragments as primary expressions so member access, calls, and tagged templates can follow them in both .jsx and .tsx. Adjacent JSX roots still report TS2657.

Continue parsing member access, calls, and tagged templates after JSX,
including across line breaks. Check for adjacent roots before parsing
type arguments to preserve the missing-parent diagnostic.
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parser splits JSX from a following computed property access, call, or template literal

1 participant