Playwright
Playwright end-to-end test rules from eslint-plugin-playwright, applied to TypeScript test files driven by the @playwright/test runner. Guard Playwright-specific patterns, locator usage, web-first assertions, focused/slowed tests. That would otherwise compile and run silently.
Source: eslint-plugin-playwright (MIT).
playwright/expect-expect: Require every Playwright test body to contain at least oneexpect(...)call.playwright/max-expects: Limit the assertion count inside a single Playwright test body.playwright/no-conditional-expect: Rejectexpect(...)calls underif/try/catchor other conditional branches in Playwright tests.playwright/no-conditional-in-test: Reject conditional logic (if/switch/ternary) inside Playwright test bodies.playwright/no-duplicate-hooks: Reject duplicate Playwright setup/teardown hook calls (test.beforeEach/test.afterEach/etc.) in the sametest.describe.playwright/no-duplicate-slow: Reject repeatedtest.slow()calls inside the same test, the first call already marks the test slow.playwright/no-element-handle: Reject the legacyElementHandle-style Playwright API (page.$,page.$$).playwright/no-eval: Rejectpage.$evalandpage.$$eval.playwright/no-focused-test: Rejecttest.only,test.describe.only, and similar focused Playwright tests.playwright/no-force-option: Reject Playwright{ force: true }options on actionable commands (click,fill, β¦).playwright/no-get-by-title: RejectgetByTitle(...)locators.playwright/no-hooks: Reject Playwrighttest.beforeEach/test.afterEach/etc. Hooks.playwright/no-nested-step: Reject nestedtest.step(...)calls.playwright/no-networkidle: Reject thenetworkidleload-state inpage.waitForLoadStateand navigation options.playwright/no-nth-methods: Reject.first(),.last(), and.nth(...)on locators.playwright/no-page-pause: Rejectpage.pause()debugging calls.playwright/no-skipped-test: Rejecttest.skip,test.describe.skip, and the conditionaltest.skip()annotation.playwright/no-slowed-test: Rejecttest.slow()marks on Playwright tests.playwright/no-standalone-expect: Rejectexpect(...)calls outside the body of a Playwright test or lifecycle hook.playwright/no-wait-for-navigation: Rejectpage.waitForNavigation.playwright/no-wait-for-selector: Rejectpage.waitForSelector.playwright/no-wait-for-timeout: Rejectpage.waitForTimeout(ms)sleeps.playwright/prefer-locator: Prefer locator-based Playwright APIs (page.locator(sel).click()) over page-level convenience methods (page.click(selector)).playwright/prefer-to-have-count: Preferexpect(locator).toHaveCount(n)over asserting onawait locator.count().playwright/prefer-to-have-length: Preferexpect(value).toHaveLength(n)over asserting onvalue.lengthdirectly.playwright/prefer-web-first-assertions: Prefer Playwright web-first assertions (expect(locator).toBeVisible(),.toHaveText(...)) over composed manual waits.playwright/require-to-pass-timeout: Require an explicittimeoutoption onexpect(...).toPass(...).playwright/require-to-throw-message: Require a message argument onexpect(...).toThrow(...).playwright/valid-describe-callback: Validate the shape of Playwrighttest.describecallbacks.playwright/valid-expect: Validateexpect(...)arity and matcher chaining: exactly one argument, terminated by a matcher call, and async matchers properly awaited.playwright/valid-title: Require non-empty static Playwright test anddescribetitles.
Last updated on