Skip to content

Commit

Permalink
[babel] Fix issue with transform-react-inline-elements
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Dec 23, 2015
1 parent 4bd3924 commit c52e7eb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
module.exports = function() {
return {
visitor: {
JSXIdentifier: function(path) {
if (path.node.name === 'data-test') {
path.parentPath.remove();
}
},
Program(path) {
// On program start, do an explicit traversal up front for your plugin.
path.traverse({
JSXIdentifier: function(path) {
if (path.node.name === 'data-test') {
path.parentPath.remove();
}
},
});
}
},
};
};

0 comments on commit c52e7eb

Please sign in to comment.