Skip to content

Commit 4bd3924

Browse files
Merge pull request #4 from oliviertassinari/babel-6
[babel] upgrade to babel@6
2 parents b4182c0 + ab1cbe5 commit 4bd3924

5 files changed

Lines changed: 17 additions & 13 deletions

File tree

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"react"
4+
]
5+
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-plugin-react-remove-properties",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Removes React properties",
55
"main": "lib/index.js",
66
"scripts": {
@@ -25,9 +25,11 @@
2525
"url": "https://github.com/oliviertassinari/babel-plugin-react-remove-properties/issues"
2626
},
2727
"dependencies": {
28-
"babel-core": "^5.6.4"
28+
"babel-core": "^6.2.1"
2929
},
3030
"devDependencies": {
31+
"babel-cli": "^6.2.0",
32+
"babel-preset-react": "^6.1.18",
3133
"istanbul": "^0.4.0",
3234
"mocha": "^2.2.5"
3335
}

src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use strict';
22

3-
module.exports = function({Plugin}) {
4-
return new Plugin('react-remove-properties', {
3+
module.exports = function() {
4+
return {
55
visitor: {
6-
JSXIdentifier(node) {
7-
if (node.name === 'data-test') {
8-
this.parentPath.dangerouslyRemove();
6+
JSXIdentifier: function(path) {
7+
if (path.node.name === 'data-test') {
8+
path.parentPath.remove();
99
}
1010
},
1111
},
12-
});
12+
};
1313
};

test/fixtures/simple/actual.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
React.createClass({
2-
render() {
2+
render: function() {
33
return (
44
<div className="bar" data-test="thisIsASelectorForSelenium">
55
Hello Wold!

test/fixtures/simple/expected.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
"use strict";
2-
31
React.createClass({
4-
render: function render() {
2+
render: function () {
53
return React.createElement(
64
"div",
75
{ className: "bar" },
86
"Hello Wold!"
97
);
108
}
119
});
12-

0 commit comments

Comments
 (0)