Skip to content

fix: no await sync events delay scope - #1374

Open
zigzagdev wants to merge 2 commits into
testing-library:mainfrom
zigzagdev:fix/no-await-sync-events-delay-scope
Open

fix: no await sync events delay scope#1374
zigzagdev wants to merge 2 commits into
testing-library:mainfrom
zigzagdev:fix/no-await-sync-events-delay-scope

Conversation

@zigzagdev

@zigzagdev zigzagdev commented Aug 28, 2026

Copy link
Copy Markdown

Checks

Changes

  • Fix no-await-sync-events: resolve the delay variable via scope (ASTUtils.findVariable) instead of matching on the identifier name across the whole file, so an unrelated delay variable declared elsewhere in the file no longer suppresses a legitimate await warning.
  • Add a regression test covering the cross-scope false negative (an unrelated delay = 1000 in one test block previously masked a delay = 0 in another).

Context

N/A

… file-wide name match

The rule tracked whether a `delay` variable was a positive integer using a
single file-scoped flag keyed only on the identifier name, so an unrelated
`delay` variable elsewhere in the file could mask a call whose own `delay`
was 0, causing the required `await` warning to be silently skipped.
… variable leak

Covers the scenario where an unrelated `delay` variable in one test block
previously suppressed the await warning for a differently-scoped `delay`
variable in another test block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant