create-playwright-seed
v1.2.0
Published
A CLI to scaffolding Playwright with TypeScript and ESLint
Maintainers
Readme
create-playwright-seed
CLI tool for advanced configuration of Playwright projects. It first runs the standard Playwright initializer and then offers additional options for configuring TypeScript, ESLint, and Prettier.
Prerequisites
- Node.js: Recommended: 20.x LTS or 22.x LTS.
Usage
The simplest way is to use npm init:
npm init playwright-seedOr run directly via npx:
npx create-playwright-seedHow It Works
- Playwright Initialization: First, the official
npm init playwright@latestcommand is executed, guiding you through the standard setup steps (choosing language, test folder, etc.). - Additional Configuration: After the basic setup is complete, the CLI will prompt you to select additional options (navigate with arrows, select with space):
- Install TypeScript: Installs the
typescriptpackage as a dev dependency. - Add Recommended tsconfig.json: Adds a
tsconfig.jsonwith recommended settings for modern TypeScript (ES2022, NodeNext). - Setup ESLint + Prettier + Plugins:
- Installs
eslint,prettier, and a set of plugins:typescript-eslint,eslint-plugin-playwright,eslint-plugin-prettier,eslint-config-prettier. - Generates
eslint.config.mts(or.mjs) with configured rules for Playwright and TypeScript.
- Installs
- Setup Husky & lint-staged:
- Installs
huskyandlint-stagedto automatically format and lint your code before committing. - Configures a
pre-commithook that runsprettierandeslinton staged files.
- Installs
- Add Pull Request Checklist to .github:
- Creates a
.github/pull_request_template.mdfile with a ready-to-use checklist for your Pull Requests.
- Creates a
- Install TypeScript: Installs the
Technologies & Repositories
This tool integrates and configures the following open-source projects:
- Playwright - End-to-end testing framework.
- TypeScript - Typed superset of JavaScript.
- ESLint - Pluggable JavaScript linter.
- Prettier - Opinionated code formatter.
- Husky - Git hooks made easy.
- lint-staged - Run linters on git staged files.
- typescript-eslint - Tooling which enables ESLint to support TypeScript.
- eslint-plugin-playwright - ESLint plugin for Playwright.
