Looking at AST explorer, JSDoc comments are parsed into a nice domain specific AST. Example:
So the following code:
/**
* @mytag Test comment
*/
const X = 1
Looks something like this parsed:
VariableStatement
|- declarationList... (irrelevant)
|- jsDoc
|- JSDocComment
|- tags
|-JSDocCommentTag
Now in the package @babel/types
there are no factories for jsDoc nodes also no ast node has a jsDoc field like on astexplorer.net
What is the situation with this? I'd like to construct ast nodes with JSDoc tags. Does typings+factories live in separate package?
The ASTExplorer link has the Typescript parser enabled, not Babel's. Typescript parses JSDoc comments, because Typescript lets you use JSDoc annotations for types.