Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get type info and examples from JSDoc for .js/.mjs files #389

Closed
lionel-rowe opened this issue Mar 28, 2024 · 1 comment
Closed

Get type info and examples from JSDoc for .js/.mjs files #389

lionel-rowe opened this issue Mar 28, 2024 · 1 comment

Comments

@lionel-rowe
Copy link

lionel-rowe commented Mar 28, 2024

Given the following file add.mjs:

// @ts-check

/**
 * @param {number} x - the first number to add
 * @param {number} y - the second number to add
 * @returns {number}
 * 
 * @example
 * ```ts
 * add(1, 2) // 3
 * ```
 */
export function add(x, y) {
    return x + y
}

Running the command deno doc --html --name="Adder" add.mjs

Expected output

add(x: number, y: number): number

Parameters

x: number

  • the first number to add

y: number

  • the second number to add

Return Type

number

Examples

Example 1

add(1, 2) // 3

Actual output

add(x, y)

Parameters

x

  • the first number to add

y

  • the second number to add

Return Type

It would be awesome if JSDoc types and @examples were also picked up for .js and .mjs files.

@lionel-rowe lionel-rowe changed the title Get type info from JSDoc for .js/.mjs files Get type info and examples from JSDoc for .js/.mjs files Mar 28, 2024
@lionel-rowe
Copy link
Author

Oops, wrong repo. Closed in favor of denoland/deno_doc#393, which looks like the same issue.

@lionel-rowe lionel-rowe closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant