Skip to content

fix(core): retry JavaScript scope parses as TSX when they contain type syntax - #310

Merged
vite-hub[bot] merged 1 commit into
mainfrom
fix/scope-tsx-retry
Nov 1, 2026
Merged

vite-hub[bot] merged 1 commit into
mainfrom
fix/scope-tsx-retry

Conversation

@onmax

@onmax onmax commented Nov 1, 2026

Copy link
Copy Markdown
Owner

#301 moved scope analysis onto oxc. typescript-estree used to accept type syntax in .js files, such as 0.5 as number, but oxc's JSX dialect rejects it, so those files were silently skipped. Rules like explicit-runtime-imports then missed auto-imported calls in them.

On a parse error in the jsx dialect, scope analysis now retries as TSX. The new test runs explicit-runtime-imports on a runtime .js plugin that contains as number.

This commit (ec6a2af) was pushed to perf/oxc-scope-manager after #301 merged, so it never reached main. I cherry-picked it unchanged.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T12:50:43.938811Z b77bf67 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm dlx https://pkg.pr.new/vite-doctor@310

commit: b77bf67

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 null through the existing caller contracts.
  • Regression coverage — the Nuxt module-author test confirms unbound runtime helpers remain detectable in a .js file containing an as expression.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@vite-hub

vite-hub Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-01T12:58:16.336Z 15m 5s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Waiting for GitHub merge request cd47f09f-57b9-4dae-9e6f-82485520b73e.

View session

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.

@vite-hub
vite-hub Bot merged commit 673993d into main Nov 1, 2026
20 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 1, 2026
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.

1 participant