Skip to content

fix: title react-hooks-js/todo diagnostics as unsupported syntax#792

Merged
aidenybai merged 1 commit into
mainfrom
devin/1781243544-react-hooks-js-todo-title
Jun 12, 2026
Merged

fix: title react-hooks-js/todo diagnostics as unsupported syntax#792
aidenybai merged 1 commit into
mainfrom
devin/1781243544-react-hooks-js-todo-title

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Every adopted React Compiler diagnostic got the same "React Compiler can't optimize this" headline. But the compiler's todo rule isn't an optimization miss in the user's code — it fires when the compiler bails out on syntax it doesn't handle yet (e.g. (BuildHIR::lowerExpression) Handle TaggedTemplateExpression expressions), so the generic headline misattributed the problem.

resolveDiagnosticTitle in core/src/runners/oxlint/parse-output.ts now special-cases the rule:

plugin === "react-hooks-js"
  rule === "todo"  "React Compiler doesn't support this syntax"
  otherwise       "React Compiler can't optimize this"

Message/help/category are unchanged; only the headline differs. Covered by an inline-snapshot test of the full parsed Diagnostic for a react-hooks-js(todo) finding plus a guard that other react-hooks-js rules keep the generic headline (packages/core/tests/react-compiler-diagnostic-title.test.ts). Changeset included (patch).

Link to Devin session: https://app.devin.ai/sessions/feefb69f5fa64204bb4a32209eaf1f84
Requested by: @aidenybai


Note

Low Risk
User-facing copy only in oxlint diagnostic title resolution; no scan logic or scoring changes.

Overview
React Compiler todo diagnostics now show the headline "React Compiler doesn't support this syntax" instead of the shared "React Compiler can't optimize this" string. That matches cases where the compiler bails on syntax it does not handle yet (the react-hooks-js/todo rule), rather than implying the user’s code failed optimization.

resolveDiagnosticTitle in parse-output.ts branches on rule === "todo" for react-hooks-js; message, help, and category are unchanged. Tests cover the todo title via an inline snapshot and assert other react-hooks-js rules still use the generic headline. Patch changeset included.

Reviewed by Cursor Bugbot for commit dd8a2b0. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@792
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@792
npm i https://pkg.pr.new/react-doctor@792

commit: dd8a2b0

@github-actions

Copy link
Copy Markdown
Contributor

No React Doctor issues found. 🎉

Reviewed by React Doctor for commit dd8a2b0.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Test results

Ran the branch CLI end-to-end against a fixture project (babel-plugin-react-compiler in devDependencies, new.target in a component to force a compiler Todo bail-out, plus a ref.current-during-render control).

  • react-hooks-js/todo diagnostic carries title: "React Compiler doesn't support this syntax"passed
  • react-hooks-js/refs diagnostic keeps title: "React Compiler can't optimize this"passed
  • Terminal renderer shows the new headline — passed
  • Snapshot test + existing parse-output tests (9 total) — passed
  • CI green (19/19)
JSON report evidence
{ "plugin": "react-hooks-js", "rule": "todo",
  "title": "React Compiler doesn't support this syntax",
  "help": "Todo: (BuildHIR::lowerExpression) Handle MetaProperty expressions other than import.meta" }
{ "plugin": "react-hooks-js", "rule": "refs",
  "title": "React Compiler can't optimize this" }
Terminal output
✖ Performance: React Compiler doesn't support this syntax
  This component misses React Compiler's automatic
  memoization & re-renders more than it should. ...
  → Todo: (BuildHIR::lowerExpression) Handle MetaProperty
  expressions other than import.meta

Devin session

@aidenybai aidenybai merged commit 19d99ee into main Jun 12, 2026
20 checks passed
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