Skip to content

Remove misplaced parameter description from RegExp#source JSDoc - #64352

Open
hikmetba-bit wants to merge 1 commit into
microsoft:mainfrom
hikmetba-bit:fix/regexp-source-jsdoc-typo
Open

hikmetba-bit wants to merge 1 commit into
microsoft:mainfrom
hikmetba-bit:fix/regexp-source-jsdoc-typo

Conversation

@hikmetba-bit

Copy link
Copy Markdown

tsc/internal/bundled/libs/lib.es5.d.ts's RegExp.source JSDoc reads:

/** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
readonly source: string;

The trailing sentence describes a method parameter named regExp, but source is a read-only property that takes no argument — there's no regExp involved in reading it. The sibling properties right below it (global, ignoreCase, multiline) all end their comment immediately after "Read-only." with no such addendum, which is what this one should do too.

Verified src/ no longer exists in this repo (the Go port under tsc/ is now the sole implementation) and this bundled .d.ts file is meant to be hand-edited directly — per tsc/internal/bundled/README.md, only the DOM/web-worker lib files are generated and off-limits to hand edits; lib.es5.d.ts isn't one of those.

Two related typos reported in the same original issue (a pasted-in String#replace/String#match doc, and a similar String#match doc in lib.es2015.symbol.wellknown.d.ts) have already been fixed since the issue was filed; this is the one remaining leftover.

Fixes #36299

🤖 Generated with Claude Code

RegExpObject.source's JSDoc ended with "The regExp argument is a
Regular expression object. It can be a variable name or a literal."
That sentence describes a method parameter, but source is a read-only
property that takes no argument; sibling properties (global, ignoreCase,
multiline) end their comment right after "Read-only."

Fixes microsoft#36299

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 19, 2026 16:47
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 19, 2026
@typescript-automation typescript-automation Bot added For Backlog Bug PRs that fix a backlog bug labels Sep 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

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

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

Typo in String#match (lib.es2015.symbol.wellknown)

3 participants