You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
eslint-factory: no-unsafe-catch-error-property guard is whole-block, causing branch-order false negatives #42189
The rule treats a single getErrorMessage(err) or err instanceof Error anywhere in a catch block as suppressing every unsafe access in that block (hasGuard is per-frame, order-independent — see CallExpression/BinaryExpression handlers in eslint-factory/src/rules/no-unsafe-catch-error-property.ts:72-92). A guard in one branch wrongly suppresses an unguarded access executed in a sibling/earlier branch.
Example missed today
try{f();}catch(err){if(cond){returngetErrorMessage(err);}core.setFailed(err.message);// unsafe, but suppressed by the guard above}
Acceptance criteria
Suppress an access only when a guard dominates it (lexically precedes in same/enclosing block), not when any guard exists.
Add invalid test: guard in one branch, unsafe access in another → still flagged.
Add valid test: guard then access in same straight-line block → not flagged.
No regression on existing nested-try and instanceof-ternary cases.
Activity
github-actions commentedon Jun 29, 2026
🍪 Issue Monster selected this for Copilot
I have identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
fix(eslint-factory): fix no-unsafe-catch-error-property branch-order …
github-actions commentedon Jul 6, 2026
This issue was automatically closed because it expired on 2026-07-06T06:55:02.667Z.