Socket
Socket
Sign inDemoInstall

eslint-plugin-playwright

Package Overview
Dependencies
0
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-playwright

ESLint plugin for Playwright testing.


Version published
Maintainers
2
Install size
61.4 kB
Created

Readme

Source

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.

🔧💡RuleDescription
max-nested-describeEnforces a maximum depth to nested describe calls
🔧missing-playwright-awaitEnforce Playwright APIs to be awaited
no-conditional-in-testDisallow conditional logic in tests
💡no-element-handleDisallow usage of element handles
no-evalDisallow usage of page.$eval and page.$$eval
💡no-focused-testDisallow usage of .only annotation
no-force-optionDisallow usage of the { force: true } option
no-page-pauseDisallow using page.pause
no-restricted-matchersDisallow specific matchers & modifiers
💡no-skipped-testDisallow usage of the .skip annotation
🔧no-useless-notDisallow usage of not matchers when a specific matcher exists
💡no-wait-for-timeoutDisallow usage of page.waitForTimeout
💡prefer-strict-equalSuggest using toStrictEqual()
🔧prefer-lowercase-titleEnforce lowercase test names
🔧prefer-to-beSuggest using toBe()
🔧prefer-to-have-lengthSuggest using toHaveLength()
require-top-level-describeRequire test cases and hooks to be inside a test.describe block
🔧require-require-soft-assertionsRequire assertions to use expect.soft()
valid-expectEnforce valid expect() usage

FAQs

Last updated on 17 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc