Skip to content

Documentation of function parameters that utilize destructuring #604

Open
@ezzatron

Description

@ezzatron

I have a function with this definition:

/**
 * Transforms a vector by a matrix.
 *
 * @param r - A transformation matrix.
 * @param v - A vector.
 *
 * @returns The transformed vector.
 */
export function transform(
  [[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]]: Matrix,
  [x, y, z]: Vector,
): Vector {
  return [
    r11 * x + r12 * y + r13 * z,
    r21 * x + r22 * y + r23 * z,
    r31 * x + r32 * y + r33 * z,
  ];
}

I generate TSDoc documentation from this, which you can see correctly associates the @param tag with the parameters that use destructuring:

Screenshot 2024-06-12 at 10 00 42

However, JSR fails to make the same association, and documents these parameters as "unnamed":

Screenshot 2024-06-12 at 10 02 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    docs genRelated to the documentation generationupstreamIssue is in upstream project

    Type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions