nursery/noPlaywrightNthMethods
nursery · since 2.6.3
No autofix
biome.json
{
"linter": {
"rules": {
"nursery": {
"noPlaywrightNthMethods": "error"
}
}
}
}Disallow selecting Playwright elements by position with first(), last(), and nth().
await page.locator("button").first().click();await page.locator("button").last().click();await page.locator("button").nth(3).click();await page.getByRole("button", { name: "Submit" }).click();
await page.getByTestId("submit-button").click();
await page.getByRole("listitem").filter({ hasText: "Product 2" }).click();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.
nursery/noPlaywrightNthMethods
nursery · since 2.6.3
{
"linter": {
"rules": {
"nursery": {
"noPlaywrightNthMethods": "error"
}
}
}
}Disallow unnecessary await for Playwright methods that don't return promises.