complexity/noPlaywrightUselessAwait
complexity · since 2.4.2
Safe autofix
biome.json
{
"linter": {
"rules": {
"complexity": {
"noPlaywrightUselessAwait": "error"
}
}
}
}Disallow unnecessary await for Playwright methods that don't return promises.
await page.locator('.my-element');await page.getByRole('button');await expect(1).toBe(1);page.locator('.my-element');
await page.locator('.my-element').click();page.getByRole('button');
await page.getByRole('button').click();expect(1).toBe(1);
await expect(page.locator('.foo')).toBeVisible();Examples from the Biome documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
ESLint does not have this rule.
Oxlint does not have this rule.
complexity/noPlaywrightUselessAwait
complexity · since 2.4.2
{
"linter": {
"rules": {
"complexity": {
"noPlaywrightUselessAwait": "error"
}
}
}
}Disallow selecting Playwright elements by position with first(), last(), and nth().