Repository navigation
fix(core): retry JavaScript scope parses as TSX when they contain type syntax - #310
Conversation
…e syntax (cherry picked from commit ec6a2af)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes in the JavaScript scope-parser fallback and its Nuxt rule regression coverage.
- TSX retry — JavaScript-family scope parses now retry with the TSX dialect after an Error-severity JSX parse diagnostic, restoring support for TypeScript syntax that the former parser accepted in JavaScript files.
- Failure preservation — sources that still fail the TSX retry continue to throw or return
nullthrough the existing caller contracts. - Regression coverage — the Nuxt module-author test confirms unbound runtime helpers remain detectable in a
.jsfile containing anasexpression.
gpt-5.6-sol | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Session Waiting for GitHub merge request cd47f09f-57b9-4dae-9e6f-82485520b73e. Ready without changes. Inspected the diff, all supplied reviews, and current-head checks; no actionable findings remain. Focused `pnpm test --run` passed 40 tests. Targeted `vp lint --threads 1` passed with type analysis disabled; full validation passed in CI. `git diff --check` passed, and the working tree is clean. No repair commit was needed. |

#301 moved scope analysis onto oxc. typescript-estree used to accept type syntax in
.jsfiles, such as0.5 as number, but oxc's JSX dialect rejects it, so those files were silently skipped. Rules likeexplicit-runtime-importsthen missed auto-imported calls in them.On a parse error in the
jsxdialect, scope analysis now retries as TSX. The new test runsexplicit-runtime-importson a runtime.jsplugin that containsas number.This commit (ec6a2af) was pushed to
perf/oxc-scope-managerafter #301 merged, so it never reached main. I cherry-picked it unchanged.🤖 Generated with Claude Code