remove flow types and class property keys
This commit is contained in:
parent
d301c8e099
commit
47c1673092
@ -58,6 +58,10 @@ var astTransformVisitor = {
|
|||||||
delete node.argument;
|
delete node.argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (t.isFlow(node)) {
|
||||||
|
return this.remove();
|
||||||
|
}
|
||||||
|
|
||||||
if (t.isRestElement(node)) {
|
if (t.isRestElement(node)) {
|
||||||
return node.argument;
|
return node.argument;
|
||||||
}
|
}
|
||||||
@ -82,6 +86,10 @@ var astTransformVisitor = {
|
|||||||
return t.inherits(t.thisExpression(), node);
|
return t.inherits(t.thisExpression(), node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (t.isClassProperty(node)) {
|
||||||
|
delete node.key;
|
||||||
|
}
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
|
|
||||||
if (t.isFunction(node)) {
|
if (t.isFunction(node)) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "babel-eslint",
|
"name": "babel-eslint",
|
||||||
"version": "3.0.0",
|
"version": "3.0.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@ -131,4 +131,12 @@ describe("verify", function () {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("class properties", function () {
|
||||||
|
verifyAndAssertMessages(
|
||||||
|
"class Lol { foo = 'bar'; }",
|
||||||
|
{ "no-undef": 1 },
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user