# yield-star-spacing

Rule `eslint/yield-star-spacing`. Require or disallow spacing around the `*` in `yield*` expressions

- Source: eslint
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Deprecated: yes
- Reach: 13.7M weekly downloads of presets that enable it
- Trend: +5.1% last quarter
- Rank: #711 by reach, #1517 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `yield-star-spacing` | no | safe | package `eslint` | [docs](https://eslint.org/docs/latest/rules/yield-star-spacing) |

## Code examples

### Correct: the rule accepts this

```js
function* generator() {
  yield* other();
}
```

```js
function *generator() {
  yield *other();
}
```

```js
function * generator() {
  yield * other();
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "yield-star-spacing": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Google](https://lintradar.dev/presets/google.md) | ESLint | `eslint-config-google` | 60 | 646.4K | +18.9% |

## Related rules

- [eslint/no-bitwise](https://lintradar.dev/rules/eslint/no-bitwise.md): Disallow bitwise operators
- [eslint/guard-for-in](https://lintradar.dev/rules/eslint/guard-for-in.md): Require `for-in` loops to include an `if` statement
- [eslint/block-scoped-var](https://lintradar.dev/rules/eslint/block-scoped-var.md): Enforce the use of variables within the scope they are defined
- [eslint/vars-on-top](https://lintradar.dev/rules/eslint/vars-on-top.md): Require `var` declarations be placed at the top of their containing scope
- [eslint/grouped-accessor-pairs](https://lintradar.dev/rules/eslint/grouped-accessor-pairs.md): Require grouped accessor pairs in object literals and classes
- [eslint/no-alert](https://lintradar.dev/rules/eslint/no-alert.md): Disallow the use of `alert`, `confirm`, and `prompt`

---

Web page: https://lintradar.dev/rules/eslint/yield-star-spacing. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
