[eslint-refiner] ESLint Refiner — Daily Report 2026-07-25: require-fetch-try-catch #47933
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-07-26T06:13:26.514Z.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Overview
Reviewed the newest custom rule,
require-fetch-try-catch, and filed 2 grounded refinement issues. This is the first ESLint Refiner run since 2026-07-08 — a 17-day gap during whicheslint-factory/src/index.tsgrew from 12 to 30 rules. The README doc-debt flagged in prior runs is now resolved (nearly all rules documented).Key metrics
index.ts)require-fetch-try-catch(newest)await fetchsites auditedFindings (both grounded on the live
actions/setup/jscorpus)1. False positive — awaited-callback fetch (medium)
isInsideTryBlockstops the ancestor walk at any function boundary. Correct for fire-and-forget callbacks, but wrong when anasync () => {}is passed to a wrapper that is itselfawaited inside an enclosingtry.Grounded:
check_version_updates.cjs:92—await fetch(CONFIG_URL)insideasync () => {}passed towithRetry(...), all awaited inside thetryat line 89.withRetry(error_recovery.cjs:222) doesawait operation()and re-throws, so the rejection is caught — yet the rule flags it. The existing intentional invalid tests (setTimeout, stored-uninvoked) must stay flagged; only the directly-awaited inline-callback pattern should become valid.2. False negative — member-chained fetch escapes detection (medium)
isAwaitFetchCallonly matches an awaitedCallExpressionwhose callee is the barefetchIdentifier. Any chain (await fetch(url).then(...),.catch(...),.json()) has aMemberExpressioncallee and is silently ignored — including bare.then()chains with no rejection handler that would crash on a networkTypeError.Shape grounded:
validate_secrets.cjs:65,85—await fetch(...).catch(rethrowAbortError)(safe today via the caller's try, but the shape escapes). The fix must recognize a terminal.catch(...)/ 2-arg.then(onF, onR)as satisfying, to avoid flagging those sites.Positive signal
require-fetch-try-catchalready carries thehandler != nullcheck — the catch-lesstry/finallysoundness gap found in the olderrequire-fs-sync-try-catchrule (2026-07-08) was not repeated in newer rules. True-negatives confirmed atawf_reflect.cjs:185/315,apply_samples.cjs:191,artifact_client.cjs:95,send_otlp_span.cjs:1096.Next actions
no-err-stack-then-string-fallback,no-setfailed-then-exit-zero,require-fs-io-try-catch, theexecsync/execfilesyncpair, the interpolated-command rules.check_version_updates.cjs:92is no longer flagged andvalidate_secrets.cjs:65/85remain unflagged.memory/eslint-refinerbranch).References:
All reactions