Description
The require-return-after-core-setfailed ESLint rule has a soundness gap: it only scans statement lists (BlockStatement.body, SwitchCase.consequent, Program.body), so braceless if/else/loop consequents like:
if (bad) core.setFailed("x"); doMore(); // NOT caught by rule
...are never checked, while braced equivalents are correctly caught. Although there are currently 0 live braceless sites, this is a latent soundness gap that will silently miss real violations as the codebase grows.
Suggested Changes
- Update
require-return-after-core-setfailed rule implementation to handle braceless consequents in IfStatement, ElseStatement, and loop bodies
- Add test cases to the rule's test suite covering braceless
if with setFailed without a following return
- Verify the existing test cases still pass
Files Affected
actions/setup/js/ — ESLint rule source for require-return-after-core-setfailed
- Corresponding test file for this rule
Success Criteria
- Braceless
if (cond) core.setFailed(msg); continueExecution(); is flagged by the rule
- Braced-with-return case remains a true negative
- All existing rule tests pass
Source
Extracted from ESLint Refiner Daily Report #45388
Priority
Medium — Latent soundness gap; low current risk but will silently grow
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 205.3 AIC · ⌖ 5.26 AIC · ⊞ 7K · ◷
Description
The
require-return-after-core-setfailedESLint rule has a soundness gap: it only scans statement lists (BlockStatement.body,SwitchCase.consequent,Program.body), so bracelessif/else/loopconsequents like:...are never checked, while braced equivalents are correctly caught. Although there are currently 0 live braceless sites, this is a latent soundness gap that will silently miss real violations as the codebase grows.
Suggested Changes
require-return-after-core-setfailedrule implementation to handle braceless consequents inIfStatement,ElseStatement, and loop bodiesifwithsetFailedwithout a followingreturnFiles Affected
actions/setup/js/— ESLint rule source forrequire-return-after-core-setfailedSuccess Criteria
if (cond) core.setFailed(msg); continueExecution();is flagged by the ruleSource
Extracted from ESLint Refiner Daily Report #45388
Priority
Medium — Latent soundness gap; low current risk but will silently grow