Skip to content

RFC: Normalized form for standard TSDoc tags #13

Open
@octogonz

Description

@octogonz

Consider this example:

/**
 * Adds two numbers together.
 *
 * @remarks
 * This method is part of the {@link core-libary/Math | Math subsystem}.
 *
 * @param x - The first number to add
 * @param y - The second number to add
 * @returns The sum of `x` and `y`
 *
 * @beta
 */
function add(x: number, y: number): number;

Is the ordering of tags important? Would this be legal:

/**
 * @beta
 * @returns The sum of `x` and `y`
 * @param y - The second number to add
 * @param x - The first number to add
 * Adds two numbers together.
 *
 * @remarks
 * This method is part of the {@link core-libary/Math | Math subsystem}.
 */
function add(x: number, y: number): number;

What about this?

/**
 * @beta @returns The sum of `x` and `y`
 * @param y - The second number to add @param x - The first number to add
 * Adds two numbers together. @remarks This method is part of 
 * the {@link core-libary/Math | Math subsystem}.
 */
function add(x: number, y: number): number;

Some questions:

  1. If it's not legal, what's the best way to specify which orders are allowable?
  2. What should the parser do with ambiguous orderings?
  3. Should the TSDoc library include an operation for normalizing an AST?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions