Etiquette for Your First Pull Request to Someone Else's Package
Most maintainers of reusable packages are glad to get outside help, but they review it in spare hours. A first contribution that respects that constraint gets merged; one that ignores it sits open for months. This guide covers the unwritten rules, in the order you will meet them.
Before you write any code
Start by reading what the project has already told you. Many repositories carry a CONTRIBUTING.md at the root or in .github/, and GitHub links to it automatically when someone opens an issue or pull request. It usually answers the questions people otherwise ask in comments: which branch to target, how to run the test suite, whether commits need a sign-off line, and which kinds of change the maintainers do not want.
Then search the issue tracker, including closed issues. If your idea was discussed and declined two years ago, reopening it with a surprise pull request feels like an ambush. If nothing exists, open a short issue describing the problem (not your solution) and ask whether a fix would be welcome. For a one-line typo fix this step is overkill; for anything that touches the public API it is essential, because API changes commit the maintainer to supporting your design for years.
Shaping the change
- One concern per pull request. A bug fix plus a formatting sweep plus a renamed helper is three reviews squeezed into one. Split them.
- Match the house style. Run the project's own formatter and linter rather than yours. If the repo has a
.editorconfigor a configured formatter, the diff should show only meaningful lines. - Add or update a test. A fix without a test asks the maintainer to write one for you, or to trust that the bug will not return.
- Leave the version alone. Do not bump
versioninpackage.jsonorpyproject.tomlunless the guide says so. Releases are usually the maintainer's call. - Mention the changelog. If the project keeps an "Unreleased" section, add a line in its format. Our changelog entry how-to shows what a useful line looks like.
Writing the description
The pull request description is read before the diff, so make it carry the context. A workable shape:
Fixes #212
What: parseRange() now rejects "1.2.x-beta" instead of returning null.
Why: callers treated null as "any version", which matched too widely.
How tested: added cases to test/range.test.js; ran npm test on Node 18 and 20.
User-visible: yes, throws TypeError where it previously returned null.
The "user-visible" line matters more than contributors expect. It tells the maintainer immediately whether this is a patch, a minor or a breaking change under semantic versioning, which decides when it can ship.
During review
Treat review comments as questions about the code, not about you. Answer each one, push follow-up commits rather than force-pushing over history unless asked, and resolve threads only after the reviewer agrees. If a week passes with no response, one polite ping is fine; three in a day is not. If the maintainer decides not to merge, thank them and move on. Forking is always available, and a respectful exchange makes your next contribution far more likely to land.
Quick checklist
- Read CONTRIBUTING.md and the code of conduct.
- Search issues; open one first for non-trivial changes.
- Keep the diff focused and formatted with the project's tools.
- Include a test and a changelog line where the project uses one.
- Write a description that states what, why, how tested and user impact.