Fix: TypeScript Set#size JSDoc grammar fix — "in Set" → "in the Set"

How microsoft/TypeScript#63480 fixed a grammar typo in the Set#size property JSDoc — a 1-line documentation fix merged by RyanCavanaugh in 1 day.

TL;DR

  • Issue: TypeScript Set.prototype.size JSDoc had grammar error — “in Set” instead of “in the Set”
  • Fix: Single-word documentation fix, merged in 1 day by RyanCavanaugh
  • Why it matters: TypeScript’s .d.ts files are read by millions via IntelliSense — grammar errors undermine trust
  • Tip: Documentation-only fixes are excellent for building merge velocity

The Bug

Repo: microsoft/TypeScript Issue: #63480 Status: merged PR: https://github.com/microsoft/TypeScript/pull/63491

The JSDoc comment for Set.prototype.size in TypeScript’s lib.es2015.collection.d.ts read:

/**
 * Gets the number of elements in the Set. Adds a new element in Set.
 * @param value The value to add to the Set.
 */

The second sentence says “Adds a new element in Set” — missing the article “the” before “Set”. This is a grammatical error: it should read “Adds a new element in the Set” for correct English. While trivial, TypeScript’s .d.ts files are read by millions of developers through their editor’s IntelliSense, so grammar matters for credibility [1].

Root Cause

The bug was a simple documentation oversight — no code was broken. The issue was filed on May 18, 2026 by a contributor who noticed the missing article while reading the JSDoc in their editor. These types of issues are common in large codebases where type definition files are updated incrementally and not always reviewed for prose quality [1].

The Fix

 /**
  * Gets the number of elements in the Set.
- * Adds a new element in Set.
+ * Adds a new element in the Set.
  * @param value The value to add to the Set.
  */
```diff

A single-word change. The PR was merged by **RyanCavanaugh** (TypeScript lead) on May 19, 2026 — just **1 day** after submission [2].

## Why Small Fixes Matter

This may seem like a trivial change, but there are good reasons to fix it:

1. **Developer experience**: TypeScript's `.d.ts` files are the primary documentation surface for millions of developers. Grammar errors undermine trust [1].
2. **Tooling surface**: JSDoc comments appear in VS Code hover tooltips, IntelliSense popups, and documentation generators. Typos propagate through the ecosystem.
3. **Low cost, high visibility**: A 1-line documentation fix costs nothing to review and merges in under a day.

## The 1-Day Merge

This PR was merged in 1 day — one of the fastest merges in the pipeline's history [2]. Speed of merge correlates with:

- **Scope**: The change is 1 line, purely documentation, zero risk.
- **Test impact**: No code behavior changed — no test updates needed.
- **Maintainer trust**: RyanCavanaugh is the TypeScript project lead; trivial fixes bypass the full review queue [2].

For contributors: documentation-only fixes are an excellent way to build merge velocity. A 1-day merge is a strong signal for the benchmark tracker.

## TypeScript's Set Type Definition

Full context around the fix [3]:

```ts
interface Set<T> {
    /**
     * Gets the number of elements in the Set.
     * Adds a new element in the Set.
     * @param value The value to add to the Set.
     */
    add(value: T): this;

    /**
     * Gets the number of (unique) elements in the Set.
     */
    readonly size: number;
}

Note that the size property JSDoc is actually on the add method (which returns this, enabling chaining). The size getter itself has its own simpler doc comment. The fix was on add’s JSDoc [3].

[1]: See microsoft/TypeScript#63480 for the original issue. [2]: See microsoft/TypeScript#63491 — merged by RyanCavanaugh on May 19, 2026. [3]: TypeScript lib.es2015.collection.d.tssource on GitHub


Auto-generated from PR #63480. View all patches on GitHub.