JSPM

  • Created
  • Published
  • Downloads 1979516
  • Score
    100M100P100Q202216F
  • License MIT

ESLint plugin for Playwright testing.

Package Exports

  • eslint-plugin-playwright
  • eslint-plugin-playwright/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-playwright) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ESLint Plugin Playwright

Test NPM

ESLint plugin for your Playwright testing needs.

Installation

Yarn

yarn add -D eslint-plugin-playwright

NPM

npm install -D eslint-plugin-playwright

Usage

This plugin bundles two configurations to work with both @playwright/test or jest-playwright.

With Playwright test runner

{
  "extends": ["plugin:playwright/playwright-test"]
}

With Jest Playwright

{
  "extends": ["plugin:playwright/jest-playwright"]
}

List of Supported Rules

✔: Enabled in the recommended configuration.
🔧: Some problems reported by this rule are automatically fixable by the --fix command line option.
💡: Some problems reported by this rule are manually fixable by editor suggestions.

🔧 💡 Rule Description
max-nested-describe Enforces a maximum depth to nested describe calls
🔧 missing-playwright-await Enforce Playwright APIs to be awaited
no-conditional-in-test Disallow conditional logic in tests
💡 no-element-handle Disallow usage of element handles
no-eval Disallow usage of page.$eval and page.$$eval
💡 no-focused-test Disallow usage of .only annotation
no-force-option Disallow usage of the { force: true } option
no-page-pause Disallow using page.pause
no-restricted-matchers Disallow specific matchers & modifiers
💡 no-skipped-test Disallow usage of the .skip annotation
🔧 no-useless-not Disallow usage of not matchers when a specific matcher exists
💡 no-wait-for-timeout Disallow usage of page.waitForTimeout
💡 prefer-strict-equal Suggest using toStrictEqual()
🔧 prefer-lowercase-title Enforce lowercase test names
🔧 prefer-to-be Suggest using toBe()
🔧 prefer-to-have-length Suggest using toHaveLength()
require-top-level-describe Require test cases and hooks to be inside a test.describe block
🔧 require-require-soft-assertions Require assertions to use expect.soft()
valid-expect Enforce valid expect() usage