add support for type cast expressions - fixes babel/babel-eslint#102
This commit is contained in:
parent
5ba504f809
commit
b699e4f2aa
@ -171,6 +171,10 @@ var astTransformVisitor = {
|
||||
delete node.argument;
|
||||
}
|
||||
|
||||
if (t.isTypeCastExpression(node)) {
|
||||
return node.expression;
|
||||
}
|
||||
|
||||
if (t.isFlow(node)) {
|
||||
return this.remove();
|
||||
}
|
||||
|
||||
@ -124,6 +124,14 @@ describe("verify", function () {
|
||||
);
|
||||
});
|
||||
|
||||
it("type cast expression", function () {
|
||||
verifyAndAssertMessages(
|
||||
"for (let a of (a: Array)) {}",
|
||||
{},
|
||||
[]
|
||||
);
|
||||
});
|
||||
|
||||
it("class usage", function () {
|
||||
verifyAndAssertMessages(
|
||||
"class Lol {} module.exports = Lol;",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user