Background
Per error-boundaries.spec.diff.md, the current error-boundaries rule only inspects ReturnStatement nodes for JSX inside try blocks, missing intermediate variable assignments.
React Compiler's ValidateNoJSXInTryStatement flags any JsxExpression / JsxFragment instruction.
Current behavior
function Component() {
try {
const el = <div />; // ❌ currently missed
return el;
} catch {}
}
Expected behavior
When traversing TryStatement, also detect JSX expressions inside VariableDeclarator, AssignmentExpression, and similar nodes.
References
- Diff report:
plugins/eslint-plugin-react-x/src/rules/error-boundaries/error-boundaries.spec.diff.md (§2.1 / §7)
- SPEC:
ValidateNoJSXInTryStatement
Priority
P0 — low implementation cost (extend existing visitor), high alignment benefit.
Background
Per
error-boundaries.spec.diff.md, the currenterror-boundariesrule only inspectsReturnStatementnodes for JSX inside try blocks, missing intermediate variable assignments.React Compiler's
ValidateNoJSXInTryStatementflags anyJsxExpression/JsxFragmentinstruction.Current behavior
Expected behavior
When traversing
TryStatement, also detect JSX expressions insideVariableDeclarator,AssignmentExpression, and similar nodes.References
plugins/eslint-plugin-react-x/src/rules/error-boundaries/error-boundaries.spec.diff.md(§2.1 / §7)ValidateNoJSXInTryStatementPriority
P0 — low implementation cost (extend existing visitor), high alignment benefit.