# noPlaywrightEval

Rule `biome/noPlaywrightEval`. Disallow usage of `page.$eval()` and `page.$$eval()`.

- Source: biome
- Technologies: Testing
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1919 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `style/noPlaywrightEval` | no | no | group style, since 2.4.2 | [docs](https://biomejs.dev/linter/rules/no-playwright-eval/) |

## Code examples

### Incorrect: the rule reports this

```js
await page.$eval('.foo', el => el.textContent);
```

```js
const texts = await page.$$eval('.foo', els => els.map(el => el.textContent));
```

### Correct: the rule accepts this

```js
const text = await page.locator('.foo').evaluate(el => el.textContent);
```

```js
const texts = await page.locator('.foo').evaluateAll(els => els.map(el => el.textContent));
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "noPlaywrightEval": "error"
      }
    }
  }
}
```

## Related rules

- [biome/noPlaywrightElementHandle](https://lintradar.dev/rules/biome/noPlaywrightElementHandle.md): Disallow usage of element handles (`page.$()` and `page.$$()`).
- [biome/noPlaywrightForceOption](https://lintradar.dev/rules/biome/noPlaywrightForceOption.md): Disallow usage of the `{ force: true }` option.
- [biome/noObsoleteTags](https://lintradar.dev/rules/biome/noObsoleteTags.md): Disallow obsolete HTML elements.
- [biome/noPlaywrightNetworkidle](https://lintradar.dev/rules/biome/noPlaywrightNetworkidle.md): Disallow usage of the `networkidle` option.
- [biome/noNonScalableViewport](https://lintradar.dev/rules/biome/noNonScalableViewport.md): Disallow disabling zoom with `user-scalable=no` in the `<meta name="viewport">` element.
- [biome/noPlaywrightNthMethods](https://lintradar.dev/rules/biome/noPlaywrightNthMethods.md): Disallow selecting Playwright elements by position with `first()`, `last()`, and `nth()`.

---

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