Skip to content

Allow typeless tags when types can be inferred #226

Closed
@rjbailey

Description

@rjbailey

I'd like to be able to describe return values and object properties using JSDoc tags, but without repeating type information from Flow annotations:

/**
 * Add five to `x`.
 *
 * @param x The number to add five to.
 * @returns `x` plus five.
 */
function addFive(x: number): number {
  return x + 5;
}

/**
 * A 2D point.
 *
 * @property x The x coordinate of the point.
 * @property y The y coordinate of the point.
 */
type Point = { x: number, y: number };

The @returns and @property tags are not reflected in the output at all (maybe because the {type} declaration is required by JSDoc, so they aren't recognized?).

Is it possible to parse these descriptions and combine them with inferred types?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions