Skip to content

Parse TSX generics without JSX false positives - #47

Merged
PerishCode merged 1 commit into
mainfrom
typescript/tsx-jsx-ambiguity
Jun 22, 2026
Merged

Parse TSX generics without JSX false positives#47
PerishCode merged 1 commit into
mainfrom
typescript/tsx-jsx-ambiguity

Conversation

@PerishCode

Copy link
Copy Markdown
Owner

Why

Flavor reports ts/parse/error on valid TSX from #46 because the TSX parser treats satisfies Record<A, B> type arguments and ordinary < comparison expressions as JSX openings.

What

  • Narrow expression-position JSX opening detection so member comparisons such as a.left < b.right stay binary expressions.
  • Parse as and satisfies expression tails through the type parser so Record<A, B> is consumed as a type reference instead of JSX-like tokens.
  • Add TSX parser regression coverage for both issue shapes.
  • Bump flavor-cli to 0.3.4 for the next beta base version.

Tests

  • cargo fmt --all --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo test --locked --workspace
  • cargo run --locked -p flavor-cli -- check --root . --config flavor.toml

Closes #46.

@PerishCode
PerishCode marked this pull request as ready for review June 22, 2026 08:27
@PerishCode
PerishCode merged commit 7f856a0 into main Jun 22, 2026
1 check passed
@PerishCode
PerishCode deleted the typescript/tsx-jsx-ambiguity branch June 22, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse valid TSX generics and comparison expressions without JSX false positives

1 participant