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;
|
delete node.argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t.isClassProperty(node)) {
|
|
||||||
// eslint doesn't like these
|
|
||||||
this.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (t.isImportBatchSpecifier(node)) {
|
if (t.isImportBatchSpecifier(node)) {
|
||||||
// ImportBatchSpecifier<name> => ImportNamespaceSpecifier<id>
|
// ImportBatchSpecifier<name> => ImportNamespaceSpecifier<id>
|
||||||
node.type = "ImportNamespaceSpecifier";
|
node.type = "ImportNamespaceSpecifier";
|
||||||
@ -42,6 +37,19 @@ var astTransformVisitor = {
|
|||||||
delete node.name;
|
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
|
// JSX
|
||||||
|
|
||||||
if (t.isJSXIdentifier(node)) {
|
if (t.isJSXIdentifier(node)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user