turn class declarations into variable declarations - fixes babel/babel-eslint#8
This commit is contained in:
parent
9117398452
commit
1ca488c3ec
@ -30,11 +30,6 @@ var astTransformVisitor = {
|
||||
delete node.argument;
|
||||
}
|
||||
|
||||
if (t.isClassProperty(node)) {
|
||||
// eslint doesn't like these
|
||||
this.remove();
|
||||
}
|
||||
|
||||
if (t.isImportBatchSpecifier(node)) {
|
||||
// ImportBatchSpecifier<name> => ImportNamespaceSpecifier<id>
|
||||
node.type = "ImportNamespaceSpecifier";
|
||||
@ -42,6 +37,19 @@ var astTransformVisitor = {
|
||||
delete node.name;
|
||||
}
|
||||
|
||||
// classes
|
||||
|
||||
if (t.isClassDeclaration(node)) {
|
||||
return t.variableDeclaration("let", [
|
||||
t.variableDeclarator(node.id, node)
|
||||
]);
|
||||
}
|
||||
|
||||
if (t.isClassProperty(node)) {
|
||||
// eslint doesn't like these
|
||||
this.remove();
|
||||
}
|
||||
|
||||
// JSX
|
||||
|
||||
if (t.isJSXIdentifier(node)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user