I want to remove single comment from AST. I have babel plugin where I target a node. This node has some leadingComments. A node would be removed using path.remove() but the comments would remain present. How can I remove also the comment. I don't want to remove all the comments only some particular.
Quite unintuitively, but
Babel.types.removeComments(path.node);
does the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With