andrew-bulthuis/javascript-rules icon
public
Published on 5/14/2025
Sample rule

Rules

Build & Development Commands

  • Use npm run dev for local development. - Use npm run build before pushing if you're modifying production code. - Always validate with npm run lint before commits.

Testing Guidelines

  • All changes must include related Playwright tests. - Use npm run test or npx playwright test. - Prefer using await expect(locator).toBeVisible() for UI stability. - Do not rely on setTimeout() — wait on selectors and conditions.

Code Style & Guidelines

  • Use camelCase for JS variables and functions. - Use const and let; never use var. - Follow async patterns — avoid deeply nested promises. - Break large functions into helpers (/utils) where possible.

Documentation Guidelines

  • Update or create .md files under playwright-knowledge/ for any reusable pattern. - Each helper function must include a doc comment. - Complex selectors must be documented inline.