How do I traverse comments with babelTraverse
?
babelTraverse(nodes, {
CommentBlock: (path) => {
console.log(path)
},
CommentLine: (path) => {
console.log(path)
}
})
Error: You gave us a visitor for the node type CommentBlock but it's not a valid type