File size: 515 Bytes
cc651f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"use strict";

exports.__esModule = true;
exports.default = void 0;

const removeJSXAttribute = (api, opts) => ({
  visitor: {
    JSXOpeningElement(path) {
      if (!opts.elements.includes(path.node.name.name)) return;
      path.get('attributes').forEach(attribute => {
        const nodeName = attribute.node.name;

        if (nodeName && opts.attributes.includes(nodeName.name)) {
          attribute.remove();
        }
      });
    }

  }
});

var _default = removeJSXAttribute;
exports.default = _default;