From 5f9c532d088f2b0a89794398f2cf08d71ecd1447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 26 May 2022 09:27:53 -0400 Subject: [PATCH] fix: remove TSDeclareFunction from ExportDefaultDeclaration (#14591) --- packages/babel-types/src/ast-types/generated/index.ts | 6 +----- packages/babel-types/src/builders/generated/index.ts | 6 +----- packages/babel-types/src/definitions/core.ts | 1 - 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/babel-types/src/ast-types/generated/index.ts b/packages/babel-types/src/ast-types/generated/index.ts index ac7c27b4f7b8..a13ee342a030 100644 --- a/packages/babel-types/src/ast-types/generated/index.ts +++ b/packages/babel-types/src/ast-types/generated/index.ts @@ -811,11 +811,7 @@ export interface ExportAllDeclaration extends BaseNode { export interface ExportDefaultDeclaration extends BaseNode { type: "ExportDefaultDeclaration"; - declaration: - | FunctionDeclaration - | TSDeclareFunction - | ClassDeclaration - | Expression; + declaration: FunctionDeclaration | ClassDeclaration | Expression; exportKind?: "value" | null; } diff --git a/packages/babel-types/src/builders/generated/index.ts b/packages/babel-types/src/builders/generated/index.ts index 30870df8a9af..bbc7d7050fba 100644 --- a/packages/babel-types/src/builders/generated/index.ts +++ b/packages/babel-types/src/builders/generated/index.ts @@ -634,11 +634,7 @@ export function exportAllDeclaration( }); } export function exportDefaultDeclaration( - declaration: - | t.FunctionDeclaration - | t.TSDeclareFunction - | t.ClassDeclaration - | t.Expression, + declaration: t.FunctionDeclaration | t.ClassDeclaration | t.Expression, ): t.ExportDefaultDeclaration { return validateNode({ type: "ExportDefaultDeclaration", diff --git a/packages/babel-types/src/definitions/core.ts b/packages/babel-types/src/definitions/core.ts index 92591951cafd..c5f6114f299e 100644 --- a/packages/babel-types/src/definitions/core.ts +++ b/packages/babel-types/src/definitions/core.ts @@ -1490,7 +1490,6 @@ defineType("ExportDefaultDeclaration", { declaration: { validate: assertNodeType( "FunctionDeclaration", - "TSDeclareFunction", "ClassDeclaration", "Expression", ),