microsoft / microsoft/tsdoc

Add an @member tag for documenting interface members outside of the interface

Open
#208 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5k
Forks
162
Avg merge
17h 24m
Merged PRs (30d)
8

Description

Sometimes you have a generic base interface type that you extend from, and you want to documenting a member of the extending interface without having to redeclare that member. In this instance, it would be useful to be able to document interface members in the interface's description. This is better explained in an example:

/**
 * A generic building.
 */
interface Building {
  /**
   * The total area of the building in sq. ft.
   */
  area: number;
}

// Annoying and prone to breaking if the base interface changes:

/**
 * A residential house that someone might live in.
 */
interface HouseA extends Building {
  /**
   * The total area of the house in sq. ft. House area doesn't include garages,
   * attics, and basements.
   */
  area: number;
  /**
   * The number of people living in the house.
   */
  residents: number;
}

// A preferable solution:

/**
 * A residential house that someone might live in.
 * @member area - The total area of the house in sq. ft. House area doesn't
 * include garages, attics, and basements.
 */
interface HouseB extends Building {
  /**
   * The number of people living in the house.
   */
  residents: number;
}

Contributor guide

No contributing guide indexed for this repository

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 or tests are named in the issue. Start by comparing the proposed TypeScript syntax with the existing TSDoc tag specification and parser behavior; done means @member can document an inherited interface member without redeclaring it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.