Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 98c1f13

Browse files
authored
Revert #584 (#697)
* Revert "Treat type alias declarationlike function declaration (#584)" This reverts commit 020d012.
1 parent 8f78e28 commit 98c1f13

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

lib/babylon-to-espree/toAST.js

-9
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,6 @@ var astTransformVisitor = {
7272
delete node.bound;
7373
}
7474

75-
if (path.isTypeAlias()) {
76-
node.type = "FunctionDeclaration";
77-
node.generator = false;
78-
node.async = false;
79-
node.expression = false;
80-
node.params = [];
81-
node.body = node.right;
82-
}
83-
8475
// flow: prevent "no-undef"
8576
// for "Component" in: "let x: React.Component"
8677
if (path.isQualifiedTypeIdentifier()) {

test/non-regression.js

-12
Original file line numberDiff line numberDiff line change
@@ -1091,18 +1091,6 @@ describe("verify", () => {
10911091
{ "no-unused-vars": 1, "no-undef": 1 }
10921092
);
10931093
});
1094-
1095-
it("cyclic type dependencies should not error #485", () => {
1096-
verifyAndAssertMessages(
1097-
unpad(`
1098-
type Node<T> = { head: T, tail: Node<T> };
1099-
type A = B[];
1100-
type B = number;
1101-
`),
1102-
{ "no-use-before-define": 0 },
1103-
[]
1104-
);
1105-
});
11061094
});
11071095

11081096
it("class usage", () => {

0 commit comments

Comments
 (0)