Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing attributes/assertions to VISITOR_KEYS #15666

Merged
merged 2 commits into from May 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/babel-types/src/ast-types/generated/index.ts
Expand Up @@ -810,8 +810,8 @@ export interface ClassDeclaration extends BaseNode {
export interface ExportAllDeclaration extends BaseNode {
type: "ExportAllDeclaration";
source: StringLiteral;
assertions?: Array<ImportAttribute> | null;
attributes?: Array<ImportAttribute> | null;
assertions?: Array<ImportAttribute> | null;
exportKind?: "type" | "value" | null;
}

Expand All @@ -832,8 +832,8 @@ export interface ExportNamedDeclaration extends BaseNode {
ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier
>;
source?: StringLiteral | null;
assertions?: Array<ImportAttribute> | null;
attributes?: Array<ImportAttribute> | null;
assertions?: Array<ImportAttribute> | null;
exportKind?: "type" | "value" | null;
}

Expand All @@ -858,8 +858,8 @@ export interface ImportDeclaration extends BaseNode {
ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier
>;
source: StringLiteral;
assertions?: Array<ImportAttribute> | null;
attributes?: Array<ImportAttribute> | null;
assertions?: Array<ImportAttribute> | null;
importKind?: "type" | "typeof" | "value" | null;
module?: boolean | null;
}
Expand Down
6 changes: 6 additions & 0 deletions packages/babel-types/src/builders/generated/index.ts
Expand Up @@ -634,10 +634,12 @@ export function classDeclaration(
}
export function exportAllDeclaration(
source: t.StringLiteral,
attributes: Array<t.ImportAttribute> | null = null,
): t.ExportAllDeclaration {
return validateNode<t.ExportAllDeclaration>({
type: "ExportAllDeclaration",
source,
attributes,
});
}
export function exportDefaultDeclaration(
Expand All @@ -658,12 +660,14 @@ export function exportNamedDeclaration(
t.ExportSpecifier | t.ExportDefaultSpecifier | t.ExportNamespaceSpecifier
> = [],
source: t.StringLiteral | null = null,
attributes: Array<t.ImportAttribute> | null = null,
): t.ExportNamedDeclaration {
return validateNode<t.ExportNamedDeclaration>({
type: "ExportNamedDeclaration",
declaration,
specifiers,
source,
attributes,
});
}
export function exportSpecifier(
Expand Down Expand Up @@ -695,11 +699,13 @@ export function importDeclaration(
t.ImportSpecifier | t.ImportDefaultSpecifier | t.ImportNamespaceSpecifier
>,
source: t.StringLiteral,
attributes: Array<t.ImportAttribute> | null = null,
): t.ImportDeclaration {
return validateNode<t.ImportDeclaration>({
type: "ImportDeclaration",
specifiers,
source,
attributes,
});
}
export function importDefaultSpecifier(
Expand Down
9 changes: 6 additions & 3 deletions packages/babel-types/src/definitions/core.ts
Expand Up @@ -1485,7 +1485,8 @@ defineType("ClassDeclaration", {
});

defineType("ExportAllDeclaration", {
visitor: ["source"],
builder: ["source", "attributes"],
visitor: ["source", "attributes", "assertions"],
aliases: [
"Statement",
"Declaration",
Expand Down Expand Up @@ -1537,7 +1538,8 @@ defineType("ExportDefaultDeclaration", {
});

defineType("ExportNamedDeclaration", {
visitor: ["declaration", "specifiers", "source"],
builder: ["declaration", "specifiers", "source", "attributes"],
visitor: ["declaration", "specifiers", "source", "attributes", "assertions"],
aliases: [
"Statement",
"Declaration",
Expand Down Expand Up @@ -1692,7 +1694,8 @@ defineType("ForOfStatement", {
});

defineType("ImportDeclaration", {
visitor: ["specifiers", "source"],
builder: ["specifiers", "source", "attributes"],
visitor: ["specifiers", "source", "attributes", "assertions"],
aliases: ["Statement", "Declaration", "ImportOrExportDeclaration"],
fields: {
attributes: {
Expand Down