eslint-plugin-jest-playwright

raw JSON →
0.9.0 verified Sat Apr 25 auth: no javascript deprecated

ESLint plugin providing Playwright-specific lint rules and globals for jest-playwright test files. Version 0.9.0 was the last release (2022); the project has been superseded by eslint-plugin-playwright (v2.x) which supports both Playwright test runner and jest-playwright. Tracks Playwright best practices like missing awaits, no conditionals in tests, and valid titles. No longer actively maintained; users should migrate to eslint-plugin-playwright for ongoing fixes and ESLint v8/v9/v10 support.

error Error: Failed to load plugin 'jest-playwright' declared in '.eslintrc': Cannot find module 'eslint-plugin-jest-playwright'
cause Package not installed.
fix
npm install eslint-plugin-jest-playwright --save-dev
error ESLint couldn't determine the plugin 'jest-playwright' uniquely
cause Both eslint-plugin-jest-playwright and eslint-plugin-playwright are installed and provide overlapping rules.
fix
Remove eslint-plugin-jest-playwright and use only eslint-plugin-playwright.
deprecated This package is deprecated. Use eslint-plugin-playwright instead.
fix Replace 'eslint-plugin-jest-playwright' with 'eslint-plugin-playwright' in your ESLint config. See https://github.com/playwright-community/eslint-plugin-playwright for migration.
breaking Plugin does not support ESLint v9 flat config.
fix Migrate to eslint-plugin-playwright which supports flat config in v2.x.
gotcha No longer receives updates. Bug fixes and new features are only in eslint-plugin-playwright.
fix Switch to eslint-plugin-playwright.
npm install eslint-plugin-jest-playwright
yarn add eslint-plugin-jest-playwright
pnpm add eslint-plugin-jest-playwright

Configure ESLint with jest-playwright recommended rules and enable custom globals.

// .eslintrc.js
module.exports = {
  plugins: ['jest-playwright'],
  extends: ['plugin:jest-playwright/recommended'],
  env: {
    'jest-playwright/globals': true,
  },
  rules: {
    'jest-playwright/expect-expect': 'warn',
  },
};

// test.js
const { test, expect } = require('@playwright/test');
test('homepage title', async ({ page }) => {
  await page.goto('https://example.com');
  await expect(page).toHaveTitle(/Example/);
});