This will ensure interoperability with other parsers such as esprima-next. Currently the following pre-walk of the raw AST is required:
// We need to fix the AST to match the expected format of recast (i.e. ast-types)
const vistitor = new class extends Visitor {
visitPrivateIdentifier(node) {
node.type = 'PrivateName'
return super.visitPrivateIdentifier(node);
}
}
vistitor.visit(ast);
Per the ESTree specification, PrivateName should should be PrivateIdentifier
This will ensure interoperability with other parsers such as esprima-next. Currently the following pre-walk of the raw AST is required:
See https://github.com/estree/estree/issues/240 for further details.