Skip to content

parser: apply ASI when TS contextual keywords precede a newline - #34258

Merged
dylan-conway merged 11 commits into
mainfrom
farm/80275baa/ts-contextual-keyword-asi
Jul 15, 2026
Merged

parser: apply ASI when TS contextual keywords precede a newline#34258
dylan-conway merged 11 commits into
mainfrom
farm/80275baa/ts-contextual-keyword-asi

parser: apply ASI when declare/abstract/interface/accessor precede a …

ea68291
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 15, 2026 in 13m 9s

Code review found 1 potential issue

Found 5 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/js_parser/parse/parse_stmt.rs:1793-1797 Confusing diagnostic: 'Expected "class" but found "class"'

Annotations

Check warning on line 1797 in src/js_parser/parse/parse_stmt.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Confusing diagnostic: 'Expected "class" but found "class"'

nit: this produces the self-contradictory diagnostic `Expected "class" but found "class"` (codified verbatim in the new tests at transpiler.test.js:235-236), because `p.lexer.expected(T::TClass)` fires while the lexer is already sitting on `T::TClass`. Consider matching esbuild's `Decorators are not valid here` or this file's existing `Unexpected newline after "..."` pattern instead. Same applies to the `TsStmtDeclare` arm at lines 1813-1814.