# noPlaywrightUselessAwait

Rule `biome/noPlaywrightUselessAwait`. Disallow unnecessary `await` for Playwright methods that don't return promises.

- Source: biome
- Technologies: Testing
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1924 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `complexity/noPlaywrightUselessAwait` | no | safe | group complexity, since 2.4.2 | [docs](https://biomejs.dev/linter/rules/no-playwright-useless-await/) |

## Code examples

### Incorrect: the rule reports this

```js
await page.locator('.my-element');
```

```js
await page.getByRole('button');
```

```js
await expect(1).toBe(1);
```

### Correct: the rule accepts this

```js
page.locator('.my-element');
await page.locator('.my-element').click();
```

```js
page.getByRole('button');
await page.getByRole('button').click();
```

```js
expect(1).toBe(1);
await expect(page.locator('.foo')).toBeVisible();
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "complexity": {
        "noPlaywrightUselessAwait": "error"
      }
    }
  }
}
```

## Related rules

- [biome/noPlaywrightPagePause](https://lintradar.dev/rules/biome/noPlaywrightPagePause.md): Disallow using `page.pause()`.
- [biome/noPlaywrightWaitForNavigation](https://lintradar.dev/rules/biome/noPlaywrightWaitForNavigation.md): Disallow using `page.waitForNavigation()`.
- [biome/noPlaywrightNthMethods](https://lintradar.dev/rules/biome/noPlaywrightNthMethods.md): Disallow selecting Playwright elements by position with `first()`, `last()`, and `nth()`.
- [biome/noPlaywrightWaitForSelector](https://lintradar.dev/rules/biome/noPlaywrightWaitForSelector.md): Disallow using `page.waitForSelector()`.
- [biome/noPlaywrightNetworkidle](https://lintradar.dev/rules/biome/noPlaywrightNetworkidle.md): Disallow usage of the `networkidle` option.
- [biome/noPlaywrightWaitForTimeout](https://lintradar.dev/rules/biome/noPlaywrightWaitForTimeout.md): Disallow using `page.waitForTimeout()`.

---

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