google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 290 forks source link

`no-yield-dispatch` ESLint rule not working as expected #9119

Closed techanvil closed 1 month ago

techanvil commented 2 months ago

Bug Description

The no-yield-dispatch ESLint rule is allowing registry-dispatched actions to be returned from generator action functions.

It's only failing if a call to registry.dispatch() is returned directly; returning registry.dispatch().someAction() is not failing, as illustrated below in VSCode.

Steps to reproduce

  1. Return a registry-dispatched action from a generator.
  2. See no lint failure.
  3. Directly return the call to registry.dispatch().
  4. See the lint failure.

Screenshots

This is fine: image

This fails: image

image


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

eugene-manuilov commented 2 months ago

IB ✔️