Skip to content

Commit

Permalink
Filter aliases from node types
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Aug 16, 2021
1 parent 3c70b89 commit 84105a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 51 deletions.
4 changes: 3 additions & 1 deletion packages/babel-types/scripts/generators/ast-types.js
Expand Up @@ -49,7 +49,9 @@ interface BaseNode {
export type CommentTypeShorthand = "leading" | "inner" | "trailing";
export type Node = ${t.TYPES.slice().sort().join(" | ")};\n\n`;
export type Node = ${t.TYPES.filter(k => !t.FLIPPED_ALIAS_KEYS[k])
.sort()
.join(" | ")};\n\n`;

const deprecatedAlias = {};
for (const type in t.DEPRECATED_KEYS) {
Expand Down
50 changes: 0 additions & 50 deletions packages/babel-types/src/ast-types/generated/index.ts
Expand Up @@ -56,19 +56,15 @@ export type Node =
| AssignmentPattern
| AwaitExpression
| BigIntLiteral
| Binary
| BinaryExpression
| BindExpression
| Block
| BlockParent
| BlockStatement
| BooleanLiteral
| BooleanLiteralTypeAnnotation
| BooleanTypeAnnotation
| BreakStatement
| CallExpression
| CatchClause
| Class
| ClassBody
| ClassDeclaration
| ClassExpression
Expand All @@ -77,13 +73,10 @@ export type Node =
| ClassPrivateMethod
| ClassPrivateProperty
| ClassProperty
| CompletionStatement
| Conditional
| ConditionalExpression
| ContinueStatement
| DebuggerStatement
| DecimalLiteral
| Declaration
| DeclareClass
| DeclareExportAllDeclaration
| DeclareExportDeclaration
Expand All @@ -102,49 +95,34 @@ export type Node =
| DoWhileStatement
| EmptyStatement
| EmptyTypeAnnotation
| EnumBody
| EnumBooleanBody
| EnumBooleanMember
| EnumDeclaration
| EnumDefaultedMember
| EnumMember
| EnumNumberBody
| EnumNumberMember
| EnumStringBody
| EnumStringMember
| EnumSymbolBody
| ExistsTypeAnnotation
| ExportAllDeclaration
| ExportDeclaration
| ExportDefaultDeclaration
| ExportDefaultSpecifier
| ExportNamedDeclaration
| ExportNamespaceSpecifier
| ExportSpecifier
| Expression
| ExpressionStatement
| ExpressionWrapper
| File
| Flow
| FlowBaseAnnotation
| FlowDeclaration
| FlowPredicate
| FlowType
| For
| ForInStatement
| ForOfStatement
| ForStatement
| ForXStatement
| Function
| FunctionDeclaration
| FunctionExpression
| FunctionParent
| FunctionTypeAnnotation
| FunctionTypeParam
| GenericTypeAnnotation
| Identifier
| IfStatement
| Immutable
| Import
| ImportAttribute
| ImportDeclaration
Expand All @@ -158,7 +136,6 @@ export type Node =
| InterfaceTypeAnnotation
| InterpreterDirective
| IntersectionTypeAnnotation
| JSX
| JSXAttribute
| JSXClosingElement
| JSXClosingFragment
Expand All @@ -174,19 +151,12 @@ export type Node =
| JSXSpreadAttribute
| JSXSpreadChild
| JSXText
| LVal
| LabeledStatement
| Literal
| LogicalExpression
| Loop
| MemberExpression
| MetaProperty
| Method
| Miscellaneous
| MixedTypeAnnotation
| ModuleDeclaration
| ModuleExpression
| ModuleSpecifier
| NewExpression
| Noop
| NullLiteral
Expand All @@ -197,7 +167,6 @@ export type Node =
| NumberTypeAnnotation
| NumericLiteral
| ObjectExpression
| ObjectMember
| ObjectMethod
| ObjectPattern
| ObjectProperty
Expand All @@ -212,32 +181,22 @@ export type Node =
| OptionalIndexedAccessType
| OptionalMemberExpression
| ParenthesizedExpression
| Pattern
| PatternLike
| PipelineBareFunction
| PipelinePrimaryTopicReference
| PipelineTopicExpression
| Placeholder
| Private
| PrivateName
| Program
| Property
| Proposal
| Pureish
| QualifiedTypeIdentifier
| RecordExpression
| RegExpLiteral
| RegexLiteral
| RestElement
| RestProperty
| ReturnStatement
| Scopable
| SequenceExpression
| SpreadElement
| SpreadProperty
| Standardized
| StandardizedOrProposal
| Statement
| StaticBlock
| StringLiteral
| StringLiteralTypeAnnotation
Expand All @@ -249,7 +208,6 @@ export type Node =
| TSAnyKeyword
| TSArrayType
| TSAsExpression
| TSBaseType
| TSBigIntKeyword
| TSBooleanKeyword
| TSCallSignatureDeclaration
Expand All @@ -258,7 +216,6 @@ export type Node =
| TSConstructorType
| TSDeclareFunction
| TSDeclareMethod
| TSEntityName
| TSEnumDeclaration
| TSEnumMember
| TSExportAssignment
Expand Down Expand Up @@ -296,11 +253,9 @@ export type Node =
| TSSymbolKeyword
| TSThisType
| TSTupleType
| TSType
| TSTypeAliasDeclaration
| TSTypeAnnotation
| TSTypeAssertion
| TSTypeElement
| TSTypeLiteral
| TSTypeOperator
| TSTypeParameter
Expand All @@ -316,7 +271,6 @@ export type Node =
| TaggedTemplateExpression
| TemplateElement
| TemplateLiteral
| Terminatorless
| ThisExpression
| ThisTypeAnnotation
| ThrowStatement
Expand All @@ -330,19 +284,15 @@ export type Node =
| TypeParameter
| TypeParameterDeclaration
| TypeParameterInstantiation
| TypeScript
| TypeofTypeAnnotation
| UnaryExpression
| UnaryLike
| UnionTypeAnnotation
| UpdateExpression
| UserWhitespacable
| V8IntrinsicIdentifier
| VariableDeclaration
| VariableDeclarator
| Variance
| VoidTypeAnnotation
| While
| WhileStatement
| WithStatement
| YieldExpression;
Expand Down

0 comments on commit 84105a4

Please sign in to comment.