JavaScript and TypeScript, JSX included, are read by TypeScript's parser for comment-only changes (PIPT-76) #332

Merged
merge-queue merged 1 commit from comment-jsx into main 2026-11-30 16:00:53 -08:00
Owner

Work package: https://openproject.home.romaine.life/wp/PIPT-76

Follows the comment-only change (#316). Its hand-written lexer couldn't tell JSX's text (<a>http://x</a>) from a comment, so every .tsx and .jsx file, and JavaScript that might hold JSX, still built on a comment edit.

What changes

  • Added typescript@6.0.3 to the suites' dependencies (about 24 MB). 6.0 is the last TypeScript whose parser is a stable JavaScript API; 7.0's is the native compiler's, marked unstable.
  • comments.mjs reads JavaScript and TypeScript, JSX included, with TypeScript's parser: the code is the syntax tree with each token's exact text, and comments a tool reads stay in it. A file with a syntax error counts whole.
  • @deprecated now counts as code. The independent check below found TypeScript marks it on the node, and a lint rule can refuse a deprecated use. #316's lexer, live now, treated it as a plain comment in .ts files; this fixes that.
  • Removed the hand-written regular-expression and template handling that only JavaScript used.
  • README rule 2 says so.

Verified: all 2,025 JavaScript and TypeScript files in the fleet's local clones are now read (none counted whole, .tsx included). With every dropped comment's letters changed, TypeScript 5.9's parser (a separate copy) gives the same tree, kinds, texts, operators and flags, for all 1,562 files that have comments.

🤖 Generated with Claude Code

Work package: https://openproject.home.romaine.life/wp/PIPT-76 Follows the comment-only change (#316). Its hand-written lexer couldn't tell JSX's text (`<a>http://x</a>`) from a comment, so every `.tsx` and `.jsx` file, and JavaScript that might hold JSX, still built on a comment edit. **What changes** - Added `typescript@6.0.3` to the suites' dependencies (about 24 MB). 6.0 is the last TypeScript whose parser is a stable JavaScript API; 7.0's is the native compiler's, marked unstable. - `comments.mjs` reads JavaScript and TypeScript, JSX included, with TypeScript's parser: the code is the syntax tree with each token's exact text, and comments a tool reads stay in it. A file with a syntax error counts whole. - `@deprecated` now counts as code. The independent check below found TypeScript marks it on the node, and a lint rule can refuse a deprecated use. #316's lexer, live now, treated it as a plain comment in `.ts` files; this fixes that. - Removed the hand-written regular-expression and template handling that only JavaScript used. - README rule 2 says so. **Verified:** all 2,025 JavaScript and TypeScript files in the fleet's local clones are now read (none counted whole, `.tsx` included). With every dropped comment's letters changed, TypeScript 5.9's parser (a separate copy) gives the same tree, kinds, texts, operators and flags, for all 1,562 files that have comments. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
JavaScript and TypeScript, JSX included, are read by TypeScript's parser for comment-only changes (PIPT-76)
All checks were successful
Fleet / align (pull_request) Successful in 24s
Tofu providers / lock (pull_request) Successful in 25s
Suite default / scope (pull_request) Successful in 54s
Suite default / check-fetches (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 50s
Suite default / check-logs (pull_request) Successful in 41s
Suite default / reused-checks (pull_request) Successful in 33s
CI / changes (pull_request) Successful in 37s
CI / cache-save (windows-latest) (pull_request) Has been skipped
CI / azure-cli (pull_request) Has been skipped
CI / cached-images (pull_request) Has been skipped
CI / actionlint (pull_request) Has been skipped
CI / prune-releases (pull_request) Has been skipped
CI / release-version (pull_request) Has been skipped
CI / check-versions (pull_request) Has been skipped
CI / check-fetches (pull_request) Has been skipped
CI / check-image-digests (pull_request) Has been skipped
CI / container-health (pull_request) Has been skipped
CI / home-cache-linux (pull_request) Has been skipped
CI / home-cache-windows (pull_request) Has been skipped
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
CI / manifest-check-linux (pull_request) Has been skipped
CI / service-runtime (one) (pull_request) Successful in 1m23s
CI / service-runtime (two) (pull_request) Successful in 1m14s
CI / service-cancellation (pull_request) Successful in 1m24s
CI / suite-tests-linux (pull_request) Successful in 3m4s
CI / setup-linux (cluster) (pull_request) Successful in 5m12s
CI / suite-tests-windows (pull_request) Successful in 2m11s
CI / setup-windows (pull_request) Successful in 8m57s
merge-queue landed on main
61d2404664
The hand-written lexer couldn't tell JSX's text from a comment, so every
.tsx and .jsx file, and JavaScript that may hold JSX, still built on a
comment edit. TypeScript 6.0.3's parser (the last whose parser is a stable
JavaScript API; 7.0's is the native compiler's unstable one) reads them
now: the code is the syntax tree with each token's exact text, and a
comment a tool reads stays in it. @deprecated joins those comments: the
check against TypeScript 5.9 found TypeScript marks it on the node.
First-time contributor

merge-queue stopped this at 61d2404: CI failed: CI / setup-windows (pull_request). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at 61d2404: CI failed: CI / setup-windows (pull_request). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
merge-queue deleted branch comment-jsx 2026-11-30 16:00:53 -08:00
Sign in to join this conversation.
No description provided.