Skip to content

fix(lib): add missing JSDoc to ReadonlySet and fix Set#size grammar#63488

Closed
Zelys-DFKH wants to merge 1 commit into
microsoft:mainfrom
Zelys-DFKH:fix/lib-readonly-set-jsdoc
Closed

fix(lib): add missing JSDoc to ReadonlySet and fix Set#size grammar#63488
Zelys-DFKH wants to merge 1 commit into
microsoft:mainfrom
Zelys-DFKH:fix/lib-readonly-set-jsdoc

Conversation

@Zelys-DFKH
Copy link
Copy Markdown

Closes #63480, closes #63481.

Two small documentation fixes in src/lib/es2015.collection.d.ts, both tagged Help Wanted.

Grammar fix (#63480): Set#size JSDoc said "the number of (unique) elements in Set" — missing "the" before "Set". Changed to match Map#size and the rest of the file.

Missing JSDoc (#63481): ReadonlySet had no documentation on forEach, has, or size, while Set<T> has full JSDoc on every member. Added the three missing blocks using the same text as Set<T>. The callback type reference changes from Set<T> to ReadonlySet<T>.

ReadonlyMap has the same gap, but that's a separate issue. Stayed minimal here.

Checklist:

  • There is an associated issue in the Backlog milestone
  • Code is up-to-date with the main branch
  • hereby runtests — doc-only change (JSDoc comments only); no types or signatures changed, no baselines affected
  • New or updated unit tests — not applicable for JSDoc-only changes

Closes microsoft#63480: Set#size JSDoc said "in Set" — added the missing article
("in the Set") to match the grammar used in Map#size and everywhere else
in the file.

Closes microsoft#63481: ReadonlySet.forEach, ReadonlySet.has, and ReadonlySet.size
had no JSDoc at all. Added comments mirroring the corresponding Set<T>
members (updating the callback type reference from Set<T> to ReadonlySet<T>
where applicable).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Zelys-DFKH
Copy link
Copy Markdown
Author

Closing to revise before resubmission — draft opened prematurely.

@Zelys-DFKH Zelys-DFKH closed this May 17, 2026
@MartinJohns
Copy link
Copy Markdown
Contributor

There are already open PR to fix these issues. Why open another one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReadonlySet lacks documentation for has, forEach and size Set#size has grammar typo in lib.es2015.collection.d.ts

2 participants