npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-playwright-silent-pass

v0.2.3

Published

ESLint rule that flags Playwright assertions that always pass — a Locator is never undefined/null/falsy, so expect(locator).toBeDefined()/.toBeTruthy()/.not.toBeNull() can never fail. Auto-fixable.

Readme

ESLint Plugin: Playwright Silent Pass

npm Playwright ESLint flat config Auto-fixable Part of e2e-skills License: Apache-2.0

One ESLint rule for a blind spot that eslint-plugin-playwright does not cover: assertions on a Playwright Locator that can never fail.

// ❌ always passes — a Locator is never undefined / null / falsy
expect(page.getByText('Welcome back')).toBeDefined();
expect(page.locator('.user-badge')).not.toBeNull();
expect(page.getByRole('button')).toBeTruthy();

// ✅ web-first, auto-retrying, can actually fail
await expect(page.getByText('Welcome back')).toBeVisible();

A Playwright locator is a synchronous object — it is always defined, never null, always truthy. So toBeDefined() / toBeTruthy() / not.toBeNull() on a locator assert nothing about the page; the test stays green whether the feature works or not.

Why a new rule?

eslint-plugin-playwright's prefer-web-first-assertions only flags the awaited-method form — expect(await locator.isVisible()).toBe(true). It does not flag the bare-locator always-true form above. no-restricted-matchers can ban a matcher globally but isn't locator-aware, so it false-positives on legitimate expect(count).toBeDefined(). This rule fills that gap and is designed to avoid false positives: it only fires when the expect subject is an inline chain anchored in a Playwright locator method, so plain expect(arr.filter(x)).toBeDefined() is never touched.

The always-pass class isn't hypothetical — fixes for it have been reviewed and merged into Storybook, code-server, Strapi, SvelteKit, Cal.com, and more (see e2e-skills · Proven in OSS, 10+ merged PRs). This rule catches the inline-locator slice of that class automatically.

Install

# npm
npm i -D eslint-plugin-playwright-silent-pass

# yarn
yarn add -D eslint-plugin-playwright-silent-pass

# pnpm
pnpm add -D eslint-plugin-playwright-silent-pass

# bun
bun add -d eslint-plugin-playwright-silent-pass

Usage (flat config, ESLint 9+)

// eslint.config.js
import silentPass from "eslint-plugin-playwright-silent-pass";

export default [
  silentPass.configs["flat/recommended"],
];

Or wire the rule yourself:

import silentPass from "eslint-plugin-playwright-silent-pass";

export default [
  {
    plugins: { "playwright-silent-pass": silentPass },
    rules: { "playwright-silent-pass/no-silent-pass": "error" },
  },
];

Legacy .eslintrc

{
  "plugins": ["playwright-silent-pass"],
  "rules": { "playwright-silent-pass/no-silent-pass": "error" }
}

Run

npx eslint .          # or: npx eslint --fix .
bunx eslint .         # or: bunx eslint --fix .

Rule: no-silent-pass

Flags expect(<inline locator>) followed by an always-true matcher:

| Matcher | Why it always passes on a Locator | |---|---| | .toBeDefined() | a Locator is never undefined | | .toBeTruthy() | a Locator object is always truthy | | .not.toBeNull() | a Locator is never null | | .not.toBeUndefined() | a Locator is never undefined | | .not.toBeFalsy() | a Locator object is never falsy |

A locator is recognized syntactically: an inline chain that includes a Playwright locator method — locator, getByRole, getByText, getByTestId, getByLabel, getByPlaceholder, getByAltText, or getByTitle (so page.getByRole(...).first().filter(...) counts; a plain arr.filter(...) does not).

Auto-fixable. eslint --fix rewrites inline-locator violations to await expect(locator).toBeVisible() (the common intent — same conservative default and await-insertion as the official prefer-web-first-assertions). Heuristic identifier matches (checkIdentifiers) are reported only, never auto-fixed.

Options

"playwright-silent-pass/no-silent-pass": ["error", { "checkIdentifiers": true }]
  • checkIdentifiers (default false) — also flag expect(<identifier>) when the identifier name looks like a locator (submitButton, userBadge, loginLink…). A heuristic, not type-aware: more coverage, some false-positive risk. For full accuracy on indirected locators, run a type-aware checker (typescript-eslint with parserOptions.project).

Scope

Catches the mechanical, inline always-true case. Semantic silent-pass smells — a test name that doesn't match its assertion, a delete test that never checks the row is gone, asserting the pre-state instead of the post-state — are not decidable by AST and are out of scope for any linter.

Related

Part of a small family for catching tests that pass but prove nothing:

  • eslint-plugin-cypress-silent-pass — the same always-pass check for Cypress.
  • e2e-skills — the full agent-skill catalog: 24 Playwright/Cypress anti-patterns, including the semantic silent-pass smells a linter can't decide (name↔assertion mismatch, missing post-state checks, missing auth setup, …).

This plugin is the mechanical, AST-decidable slice; e2e-skills covers the rest.

License

Apache-2.0 © voidmatcha. See LICENSE.