diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb06a17e77..9e89b7cf13 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,6 +8,8 @@ If you are passioned about a bug/feature, but cannot find an issue describing it ## Make a change +### Set environment + Make sure you're running Node.js 20 or later. ```bash node --version @@ -28,12 +30,17 @@ npx playwright install Playwright is a multi-package repository that uses npm workspaces. For browser APIs, look at [`packages/playwright-core`](https://github.com/microsoft/playwright/blob/main/packages/playwright-core). For test runner, see [`packages/playwright`](https://github.com/microsoft/playwright/blob/main/packages/playwright). -Note that some files are generated by the build, so the watch process might override your changes if done in the wrong file. For example, TypeScript types for the API are generated from the [`docs/src`](https://github.com/microsoft/playwright/blob/main/docs/src). +### TypeScript Type Generation + +If your changes involve `TypeScript types`, ensure to modify the corresponding files in [`docs/src`](https://github.com/microsoft/playwright/blob/main/docs/src). +Note that some files are generated by the build, so the watch process might override your changes if done in the wrong file. For example, TypeScript types for the API are generated from this directory. + +### Linting Coding style is fully defined in [.eslintrc](https://github.com/microsoft/playwright/blob/main/.eslintrc.js). Before creating a pull request, or at any moment during development, run linter to check all kinds of things: - ```bash - npm run lint - ``` +```bash +npm run lint +``` Comments should be generally avoided. If the code would not be understood without comments, consider re-writing the code to make it self-explanatory.