From 52e3f799148c2e8544eb9b7de0784007853ce654 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 27 Sep 2018 10:22:17 -0400 Subject: [PATCH] Revert "Treat type alias declarationlike function declaration (#584)" This reverts commit 020d012c554913fea137f4129798ce31a4896dfe. --- lib/babylon-to-espree/toAST.js | 9 --------- test/non-regression.js | 12 ------------ 2 files changed, 21 deletions(-) diff --git a/lib/babylon-to-espree/toAST.js b/lib/babylon-to-espree/toAST.js index 88349d7c..b3da41f0 100644 --- a/lib/babylon-to-espree/toAST.js +++ b/lib/babylon-to-espree/toAST.js @@ -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()) { diff --git a/test/non-regression.js b/test/non-regression.js index 15c0a282..4c43b29f 100644 --- a/test/non-regression.js +++ b/test/non-regression.js @@ -1091,18 +1091,6 @@ describe("verify", () => { { "no-unused-vars": 1, "no-undef": 1 } ); }); - - it("cyclic type dependencies #485", () => { - verifyAndAssertMessages( - unpad(` - type Node = { head: T, tail: Node }; - type A = B[]; - type B = number; - `), - { "no-use-before-define": 1 }, - [] - ); - }); }); it("class usage", () => {