microsoft / microsoft/TypeScript

JSDoc typed function comments inside functions

Open
#59,967 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

🔍 Search Terms

"JSDoc inside functions", "JSDoc comments inside", "typed function comments"

✅ Viability Checklist
⭐ Suggestion

Are we able add support for adding JSDoc typed function comments inside functions, either natively or by a setting?

📃 Motivating Example

Personally, I find it easier to read JSDoc typed function comments when they are indented nicely inside functions, similar to Python, which would also pair really well with code folding.

function arrayMove(index) {
  /**
   * @param {Number} index
   * @return {Array}
   */
  // ...
}

I enquired about this on Stackoverflow last year

💻 Use Cases

.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are identified in the issue. Start by reviewing how TypeScript handles JSDoc comments inside function bodies and determine the intended behavior for the motivating example; done should mean supported indented JSDoc typing without changing JavaScript runtime output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.