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

jsdoc type including module: prefix is not parsed correctly #25684

Closed
jkieboom opened this issue Jul 16, 2018 · 2 comments
Closed

jsdoc type including module: prefix is not parsed correctly #25684

jkieboom opened this issue Jul 16, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@jkieboom
Copy link

TypeScript Version: 3.0.0-dev.201xxxxx

Search Terms: jsdoc parse type module

Code

/**
 * @module namespaced/class/Type
 */

/**
 * Refers to a module: prefixed type
 * @param {module:namespaced/class/Type} param - A parameter
 **/
function f(type: Type) {}

Expected behavior:

When inspecting the AST (in this case for a tslint rule), I expected the type of the JSDocParameterTag node to be module:namespaced/class/Type. Instead, it appears parsing the type stopped at : and the node.comment part is :namespaced/class/Type} param - A parameter.

Actual behavior:

I would expect the type to be correctly parsed as well as the remainder of the @param tag.

Playground Link:

Related Issues:

@mhegazy
Copy link
Contributor

mhegazy commented Jul 16, 2018

@module is not supported. use @param {import("namespaced/class/Type")} param - A parameter instead.

More in https://github.com/Microsoft/TypeScript/wiki/JSDoc-support-in-JavaScript

@mhegazy
Copy link
Contributor

mhegazy commented Jul 16, 2018

Duplicate of #22158

@mhegazy mhegazy marked this as a duplicate of #22158 Jul 16, 2018
@mhegazy mhegazy added the Duplicate An existing issue was already created label Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants