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

Commit

Permalink
Revert "Treat type alias declarationlike function declaration (#584)"
Browse files Browse the repository at this point in the history
This reverts commit 020d012.
  • Loading branch information
hzoo committed Sep 27, 2018
1 parent fd7b9d5 commit 52e3f79
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
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
Expand Up @@ -1091,18 +1091,6 @@ describe("verify", () => {
{ "no-unused-vars": 1, "no-undef": 1 }
);
});

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

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

0 comments on commit 52e3f79

Please sign in to comment.