ESLint plugin for Playwright testing framework, providing lint rules to catch common mistakes and enforce best practices. Current stable version is v2.10.2, with frequent releases (weekly to bi-weekly). Supports both flat config (eslint.config.js) and legacy .eslintrc. Ships TypeScript types. Key differentiators: it is the official Playwright ESLint plugin, actively maintained, with 30+ rules including 'missing-playwright-await' to detect missing await on Playwright assertions, and 'no-wait-for-selector' replacement for deprecated APIs.
npm install eslint-plugin-playwrightVerified import paths — ran on the pinned version, not inferred.
Shows flat config usage: targeting tests/ folder, extending recommended flat config, and customizing a rule.
Use `playwright.configs['flat/recommended']` instead of `playwright.configs.recommended`
Update ESLint to >= 8.40.0 or stay on v1 if using older ESLint
Remove usage of page.waitForSelector and let Playwright handle waiting automatically
Use `const playwright = require('eslint-plugin-playwright')` then `playwright.configs['flat/recommended']`Choose one config format: flat config (eslint.config.js) or legacy (eslintrc)
Run `npm install -D eslint-plugin-playwright` (or yarn/pnpm)
Ensure eslint-plugin-playwright is installed and in your package.json devDependencies
Add an assertion inside the test, e.g., await expect(page).toHaveTitle(...)
Add `await` before the method call: `await page.goto(url)`