Rule
eslint-factory/src/rules/require-await-core-summary-write.ts
Problem
The rule only flags <core-like>.summary...write() where the root identifier matches isCoreLikeIdentifier (/^core/i, line 24-26). It cannot see through a local variable that aliases core.summary, so a dropped await on such an alias is silently missed.
getRootIdentifier for summary.write() returns "summary", which fails /^core/i, so rootsSummary() returns false and the call is never flagged.
Live evidence (this exact aliasing idiom is used in the corpus)
These sites all currently await correctly, but they establish that the alias pattern is real and in active use — dropping the await here would produce the exact bug the rule exists to prevent, undetected:
actions/setup/js/route_slash_command.cjs:20 — const summary = core.summary; then :38 await summary.write({ overwrite: false });
actions/setup/js/check_workflow_timestamp_api.cjs:414 / :435 — let summary = core.summary; then :422 / :445 await summary.write();
Repro (should be flagged, currently is not)
async function f() {
const summary = core.summary;
summary.write(); // FN: dropped await, not flagged
}
async function f() {
const { summary } = core;
summary.addRaw(x).write(); // FN
}
Acceptance criteria
- Track simple, single-assignment
const/let locals bound to core.summary (or destructured const { summary } = core) within the enclosing scope, and treat <alias>.write() / <alias>.addRaw(...).write() bare expression statements as flaggable.
- Preserve zero false positives: only resolve aliases whose initializer is statically
core.summary (or <coreLike>.summary); do not flag re-assigned or parameter-shadowed bindings whose source is unknown.
- Add invalid-case tests for the two repros above and a valid-case test where
summary is reassigned to a non-core value.
Priority
High — the alias name summary is a strong intent signal, the idiom is live in two corpus files, and the failure mode (truncated/missing step summary on early process exit) is exactly the rule's target.
Generated by 🤖 ESLint Refiner · 158.7 AIC · ⌖ 12.5 AIC · ⊞ 4.7K · ◷
Rule
eslint-factory/src/rules/require-await-core-summary-write.tsProblem
The rule only flags
<core-like>.summary...write()where the root identifier matchesisCoreLikeIdentifier(/^core/i, line 24-26). It cannot see through a local variable that aliasescore.summary, so a droppedawaiton such an alias is silently missed.getRootIdentifierforsummary.write()returns"summary", which fails/^core/i, sorootsSummary()returnsfalseand the call is never flagged.Live evidence (this exact aliasing idiom is used in the corpus)
These sites all currently
awaitcorrectly, but they establish that the alias pattern is real and in active use — dropping theawaithere would produce the exact bug the rule exists to prevent, undetected:actions/setup/js/route_slash_command.cjs:20—const summary = core.summary;then:38await summary.write({ overwrite: false });actions/setup/js/check_workflow_timestamp_api.cjs:414/:435—let summary = core.summary;then:422/:445await summary.write();Repro (should be flagged, currently is not)
Acceptance criteria
const/letlocals bound tocore.summary(or destructuredconst { summary } = core) within the enclosing scope, and treat<alias>.write()/<alias>.addRaw(...).write()bare expression statements as flaggable.core.summary(or<coreLike>.summary); do not flag re-assigned or parameter-shadowed bindings whose source is unknown.summaryis reassigned to a non-core value.Priority
High — the alias name
summaryis a strong intent signal, the idiom is live in two corpus files, and the failure mode (truncated/missing step summary on early process exit) is exactly the rule's target.