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

Commit

Permalink
Revert #584 (#697)
Browse files Browse the repository at this point in the history
* Revert "Treat type alias declarationlike function declaration (#584)"

This reverts commit 020d012.
  • Loading branch information
hzoo authored Sep 27, 2018
1 parent 8f78e28 commit 98c1f13
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
9 changes: 0 additions & 9 deletions lib/babylon-to-espree/toAST.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@ var astTransformVisitor = {
delete node.bound;
}

if (path.isTypeAlias()) {
node.type = "FunctionDeclaration";
node.generator = false;
node.async = false;
node.expression = false;
node.params = [];
node.body = node.right;
}

// flow: prevent "no-undef"
// for "Component" in: "let x: React.Component"
if (path.isQualifiedTypeIdentifier()) {
Expand Down
12 changes: 0 additions & 12 deletions test/non-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -1091,18 +1091,6 @@ describe("verify", () => {
{ "no-unused-vars": 1, "no-undef": 1 }
);
});

it("cyclic type dependencies should not error #485", () => {
verifyAndAssertMessages(
unpad(`
type Node<T> = { head: T, tail: Node<T> };
type A = B[];
type B = number;
`),
{ "no-use-before-define": 0 },
[]
);
});
});

it("class usage", () => {
Expand Down

0 comments on commit 98c1f13

Please sign in to comment.