This page describes how to submit and manage a pull request (PR) to the TypeScript repository: what pre-submission requirements exist, which automated checks run, what bot notifications are triggered by specific file changes, and how PRs are merged.
For guidance on writing the tests required as part of a PR, see 15.2 For setting up the local development environment before submitting, see 15.1 For information on the CI pipeline jobs themselves in more detail, see 13.1
Important: As of 2025, this repository only accepts PRs that fix critical issues in the 6.x line. New feature contributions should be directed to
microsoft/typescript-go. See CONTRIBUTING.md1-3 for the current policy.
Before opening a PR, the following conditions must be met:
| Requirement | Details |
|---|---|
| Linked issue | The issue must be in the Backlog milestone or labelled help wanted |
| Up-to-date branch | Branch must be based on a recent commit in main |
| Tests pass locally | Run hereby runtests or hereby runtests-parallel locally |
| Tests included | At least one test must fail without the change; tests should cover permutations |
| Baselines updated | Run hereby baseline-accept and include baseline changes in the commit |
| Code style | Follow the project coding guidelines; dprint formatting is enforced |
These requirements are stated in CONTRIBUTING.md139-148 and echoed in the PR description template at .github/pull_request_template.md1-19
Upon submitting a PR for the first time, an automated bot will post instructions to sign the Microsoft Contributor License Agreement (CLA). The CLA grants Microsoft permission to use the submitted change under the project's license. Signing is required before the PR can be merged. See CONTRIBUTING.md133-135
PR lifecycle from submission to merge:
Sources: CONTRIBUTING.md133-152 .github/workflows/pr-modified-files.yml1-139 .github/pull_request_template.md1-19
Every PR targeting main or a release-* branch triggers the ci.yml workflow. The checks that run on a PR event are a subset of the full matrix.
CI jobs and when they run on PRs:
Sources: .github/workflows/ci.yml27-104 .github/workflows/ci.yml416-438
| Job | What It Checks |
|---|---|
test | Runs the full test suite; prints baseline diff on failure |
lint | Runs npm run lint (ESLint) |
knip | Checks for unused exports via knip |
format | Runs npx dprint check for formatting conformance |
typecheck | Runs npx hereby build-src to ensure the source typechecks |
smoke | Builds an LKG, packs it, installs into a fresh project, and invokes tsc and tsserver |
package-size | Compares packed size of the PR branch vs. the base branch; posts to step summary |
self-check | Builds tsc, then uses it to re-compile the TypeScript source itself |
misc | Builds scripts and runs ESLint rule unit tests |
required | A gate job; fails if any required job did not succeed or skip |
The required job at .github/workflows/ci.yml416-438 ensures all listed jobs must either succeed or be explicitly skipped for the PR to be mergeable. A job result of failure or cancelled causes required to fail.
The package-size job only runs on pull_request events .github/workflows/ci.yml287-288 and compares the current PR's packed size against the base branch using scripts/checkPackageSize.mjs.
The pr-modified-files.yml workflow runs on pull_request_target events (meaning it executes at the base of the PR, not the PR branch, for security) and inspects which files were modified using the GitHub GraphQL API. It then posts targeted comments or takes automated actions.
File change detection and response logic:
Sources: .github/workflows/pr-modified-files.yml40-139
| Changed File | Automated Response |
|---|---|
src/lib/dom.generated.d.ts, src/lib/webworker.generated.d.ts (non-owner) | PR is closed automatically with a message directing the author to microsoft/TypeScript-DOM-lib-generator |
src/server/protocol.ts | A comment is posted pinging @sheetalkamat, @mjbvz, and @joj to review tsserver protocol compatibility |
tests/baselines/reference/api/typescript.d.ts | A comment is posted requesting the change be documented on the API Breaking Changes wiki page, and pinging @DanielRosenwasser and @RyanCavanaugh |
Comments are only posted once per PR; the already_commented.sh helper script checks existing bot comments before posting again .github/workflows/pr-modified-files.yml81-90
The pr_owners.txt file (fetched from main at runtime) lists GitHub usernames exempt from the generated-DOM-file auto-close check .github/workflows/pr-modified-files.yml41-49
Fixes # as a prompt)hereby baseline-accept output committed)See .github/pull_request_template.md1-19 for the full checklist shown to PR authors.
Avoid force-pushing, particularly after receiving review feedback. Force-pushed changes are not easily viewable on GitHub. Since all PRs are squash merged, the individual commits on the branch do not affect the merge commit; only the PR title matters. See CONTRIBUTING.md152-153
To avoid line ending issues, configure git with:
autocrlf = input
whitespace = cr-at-eol
If a PR modifies src/compiler/diagnosticMessages.json, the hereby generate-diagnostics task must be run to regenerate diagnosticInformationMap.generated.ts. The post-checkout git hook scripts/hooks/post-checkout1-2 does this automatically after branch switches, and the pre-commit hook scripts/hooks/pre-commit1-4 runs dprint fmt on staged files. See 10.3 for more on git hooks.
If the test CI job fails due to baseline differences, the workflow prints the diff:
npx hereby baseline-accept
git add tests/baselines/reference
git diff --staged --exit-code
See .github/workflows/ci.yml125-131 Separately, the baselines job (which does not run on PRs but does run on pushes) regenerates all baselines from scratch and checks for unexpected additions, modifications, or deletions. See 12.3 for a full explanation of the baseline system.
lib.d.ts ChangesChanges to the standard library declaration files in src/lib/ must be made by hand (except for generated DOM files). The relevant paths are:
| Path | Purpose |
|---|---|
src/lib/ | Authoritative source of library .d.ts files |
lib/ | LKG copies, used to bootstrap compilation; updated only on release |
built/local/ | Build output; updated by running hereby |
Generated files — src/lib/dom.generated.d.ts and src/lib/webworker.generated.d.ts — must not be edited directly. Changes go through microsoft/TypeScript-DOM-lib-generator. PRs editing these files will be automatically closed by the pr-modified-files.yml bot. See 15.7 for more on library definition changes.
Sources: CONTRIBUTING.md154-174 .github/workflows/pr-modified-files.yml92-107
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.