@zohodesk/client_build_tool
Version:
A CLI tool to build web applications and client libraries
23 lines (18 loc) • 458 B
JavaScript
;
module.exports = () => ({
visitor: {
Program(path, state) {
let properties = state.opts.properties || [];
if (properties.length === 0) {
properties = properties.concat(state.opts.attributeNames);
}
path.traverse({
JSXIdentifier(path2) {
if (properties.indexOf(path2.node.name.toLowerCase()) > -1) {
path2.parentPath.remove();
}
}
});
}
}
});