> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generators-Should-Yield

#### Sourcery rule id: `generators-should-yield`

#### Description

Avoid writing generators that don't `yield` any values.


#### Match

```javascript
function* wrongGen(x) {
  let val = 0;
  val += x;
}
```



#### Explanation

Generators without `yield` statements are confusing, since they defy a reader's expectations.
