fix: title react-hooks-js/todo diagnostics as unsupported syntax#792
Merged
Conversation
Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
commit: |
Contributor
|
No React Doctor issues found. 🎉 Reviewed by React Doctor for commit |
Contributor
Author
Test resultsRan the branch CLI end-to-end against a fixture project (
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 |
This was referenced Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every adopted React Compiler diagnostic got the same
"React Compiler can't optimize this"headline. But the compiler'stodorule 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.resolveDiagnosticTitleincore/src/runners/oxlint/parse-output.tsnow special-cases the rule:Message/help/category are unchanged; only the headline differs. Covered by an inline-snapshot test of the full parsed
Diagnosticfor areact-hooks-js(todo)finding plus a guard that otherreact-hooks-jsrules 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
tododiagnostics 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 (thereact-hooks-js/todorule), rather than implying the user’s code failed optimization.resolveDiagnosticTitleinparse-output.tsbranches onrule === "todo"forreact-hooks-js; message, help, and category are unchanged. Tests cover thetodotitle via an inline snapshot and assert otherreact-hooks-jsrules 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.