Draft
fix(eslint): detect dropped await on local core.summary aliases#43404
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ummary-write rule Extends the rule to detect dropped `await` on local variable aliases of `core.summary`, resolving the false negative described in #43324. Two alias patterns are now recognised: - `const/let summary = core.summary; summary.write()` - `const { summary } = core; summary.addRaw(x).write()` Re-assigned `let` bindings are conservatively rejected (their post-reassignment source is unknown). Non-core initialisers (e.g. `fs.summary`) are also ignored. Tests added: 5 new invalid cases (both corpus patterns + rename destructure + non-async + let variant) and 3 new valid cases (awaited alias, re-assigned let, non-core init). Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…eview Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix false negative on local summary aliases of core.summary
fix(eslint): detect dropped await on local core.summary aliases
Jul 4, 2026
Contributor
🤖 PR Triage — Run §28715668077
Detects dropped await on local core.summary aliases. +80/-2 TS rule, +40 test. Low risk eslint bugfix.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
require-await-core-summary-writerule had a false negative whencore.summarywas aliased to a local variable —getRootIdentifieronsummary.write()returned"summary", which failed theCORE_ALIASEScheck and silently skipped the call. This pattern is live in two corpus files.Changes
isCoreSummaryAlias(identifier)— new helper insidecreate()that uses ESLint scope analysis to check whether an identifier is a single-assignment local bound tocore.summary. Two patterns are tracked:const/let summary = core.summaryconst { summary } = core/const { summary: alias } = coreRe-assigned
letbindings are rejected viaref.isWrite() && !ref.init; non-core initialisers are ignored.rootsSummaryOrAlias(node)— replaces the directrootsSummarycall inExpressionStatement. Delegates torootsSummaryfirst (fast path), then resolvesIdentifiernodes through alias lookup and handles chained calls (summary.addRaw(x).write()).Now flagged
Still not flagged (zero false positives)