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 late 2025, development in this codebase is winding down. This repository only accepts PRs that fix critical 6.0 issues. At minimum, any bug that existed in 5.9 is not considered critical unless it's a security issue. All new code changes should be submitted to the typescript-go repository. Feature additions and behavioral changes are currently on pause until TypeScript 7.0 is completed. See CONTRIBUTING.md1-6 and README.md31-39
Issues suitable for contribution are marked with the help wanted label or placed in the Backlog milestone. You can find them by searching:
is:issue label:"help wanted"
or
is:issue milestone:Backlog
Features with language design impact, or that are adequately satisfied with external tools, will not be accepted even if labeled help wanted. See CONTRIBUTING.md122-123
Do not leave "claiming" comments on issues (e.g., "I'm going to work on this"). There are several reasons for this policy:
You do not need anyone's permission before starting work on a help wanted or Backlog issue. See CONTRIBUTING.md126-132
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 (.github/pull_request_template.md5) |
| Up-to-date branch | Branch must be based on a recent commit in main (.github/pull_request_template.md6) |
| Tests pass locally | Run hereby runtests or hereby runtests-parallel (.github/pull_request_template.md7) |
| Tests included | At least one test must fail without the change; tests should cover permutations (CONTRIBUTING.md143-145) |
| Baselines updated | Run hereby baseline-accept and include baseline changes (CONTRIBUTING.md146) |
| Code style | Follow the Coding guidelines (CONTRIBUTING.md147) |
| Git configuration | Set autocrlf = input and whitespace = cr-at-eol to avoid line ending issues (CONTRIBUTING.md148) |
| AI Disclosure | If AI-authored, disclose this in the PR description. Bulk agent-driven PRs are not accepted (CONTRIBUTING.md7-17) |
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 using hereby baseline-accept .github/workflows/ci.yml118-130 |
lint | Runs npm run lint (ESLint) .github/workflows/ci.yml166-178 |
knip | Checks for unused exports via knip .github/workflows/ci.yml179-191 |
format | Runs npx dprint check for formatting conformance .github/workflows/ci.yml192-211 |
typecheck | Runs npx hereby build-src to ensure the source typechecks .github/workflows/ci.yml212-224 |
smoke | Builds an LKG, packs it, installs into a fresh project, and invokes tsc and tsserver .github/workflows/ci.yml225-263 |
package-size | Compares packed size of the PR branch vs. the base branch; posts to step summary .github/workflows/ci.yml287-313 |
self-check | Builds tsc, then uses it to re-compile the TypeScript source itself .github/workflows/ci.yml340-353 |
required | A gate job; fails if any required job did not succeed or skip .github/workflows/ci.yml416-438 |
The required job 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 .github/workflows/ci.yml433-437
The pr-modified-files.yml workflow runs on pull_request_target events. This workflow inspects which files were modified using the GitHub GraphQL API and posts targeted comments or takes automated actions.
File change detection and response logic:
Sources: .github/workflows/pr-modified-files.yml1-139
Duplicate comment prevention: The already_commented.sh script fetches all comments by typescript-bot using the gh pr view command and checks if the specific message substring already exists before posting .github/workflows/pr-modified-files.yml81-90
File change detection: The is_changed.sh script uses the GitHub GraphQL API to fetch all changed files, paginating through results for large PRs .github/workflows/pr-modified-files.yml53-78
Fixes # as a prompt).hereby baseline-accept output committed).Avoid force-pushing changes after receiving review feedback. Since TypeScript PRs are squash merged, the specific commits on your PR branch do not matter — only the final PR title matters for the commit message. Focus on making your changes easy to review .CONTRIBUTING.md150-152
Line endings: Configure git to avoid line ending issues:
Git hooks: The repository provides git hooks symlinked into .git/hooks/ during npm ci via scripts/link-hooks.mjs1-28
| Hook | Location | Purpose |
|---|---|---|
post-checkout | scripts/hooks/post-checkout1-2 | Runs hereby generate-diagnostics after branch switches |
pre-commit | scripts/hooks/pre-commit1-4 | Runs dprint fmt on staged files and re-stages them |
When the test suite detects differences in baseline outputs, tests will fail. The CI workflow will print the diff in the logs if the test step fails .github/workflows/ci.yml125-131
Local Inspection:
After verifying that baseline changes are correct, accept them:
This copies files from tests/baselines/local/ to tests/baselines/reference/. The changed reference files should be included in your commit .CONTRIBUTING.md263-270
Baseline tests generate multiple output files in tests/baselines/local/ (which are gitignored per .gitignore11-20):
| File Extension | Content |
|---|---|
.js | Combined JavaScript and .d.ts output |
.errors.txt | Compiler diagnostics |
.types | Type of each expression in the test |
.symbols | Symbol for each identifier in the test |
Sources: CONTRIBUTING.md244-270 .gitignore11-20
PRs are subject to security scanning:
update-package-lock.yaml workflow runs daily to keep dependencies up-to-date .github/workflows/update-package-lock.yaml1-86Sources: .github/workflows/codeql.yml .github/workflows/scorecard.yml .github/workflows/update-package-lock.yaml
Refresh this wiki