CI Perf Lint

playwright-config-uses-npm-run

Why it matters

A repository pins a package manager through its lockfile or packageManager field. When playwright.config.* still invokes package scripts through npm run, the test run depends on a second, unpinned toolchain: npm may not be installed in CI, and even when it is, it adds an inconsistent startup path next to the package manager the rest of the pipeline uses.

What it flags

The scanner flags a playwright.config.* file when both hold:

It does not flag:

Suggested action

Call package scripts through the repository’s package manager, or use node --run, instead of npm run. Keep the script name and any arguments unchanged.

Verification

Confirm the web server starts in an environment where only the repository’s package manager is installed, and compare startup time.

What the scanner does

The collector resolves the repository’s package manager from package.json and lockfiles, extracts webServer.command values from each playwright.config.* file, and looks for npm run invocations. A process.env.CI ternary is resolved to its CI branch so local-only npm usage is ignored.