"use strict";

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();
          }
        }

      });
    }

  }
});