Skip to content

Commit

Permalink
Remove Proposal alias
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Aug 16, 2021
1 parent a818759 commit e34cf48
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 98 deletions.
1 change: 0 additions & 1 deletion packages/babel-traverse/src/path/generated/asserts.ts
Expand Up @@ -416,7 +416,6 @@ export interface NodePathAssetions {
assertPrivateName(opts?: object): asserts this is NodePath<t.PrivateName>;
assertProgram(opts?: object): asserts this is NodePath<t.Program>;
assertProperty(opts?: object): asserts this is NodePath<t.Property>;
assertProposal(opts?: object): asserts this is NodePath<t.Proposal>;
assertPureish(opts?: object): asserts this is NodePath<t.Pureish>;
assertQualifiedTypeIdentifier(
opts?: object,
Expand Down
1 change: 0 additions & 1 deletion packages/babel-traverse/src/path/generated/validators.ts
Expand Up @@ -261,7 +261,6 @@ export interface NodePathValidators {
isPrivateName(opts?: object): this is NodePath<t.PrivateName>;
isProgram(opts?: object): this is NodePath<t.Program>;
isProperty(opts?: object): this is NodePath<t.Property>;
isProposal(opts?: object): this is NodePath<t.Proposal>;
isPureish(opts?: object): this is NodePath<t.Pureish>;
isQualifiedTypeIdentifier(
opts?: object,
Expand Down
4 changes: 0 additions & 4 deletions packages/babel-types/scripts/generators/docs.js
Expand Up @@ -231,16 +231,12 @@ const aliasDescriptions = {
"A cover of [BindingPattern](https://tc39.es/ecma262/#prod-BindingPattern)s. ",
Private: "A cover of private class elements and private identifiers.",
Property: "A cover of object properties and class properties.",
Proposal:
"A cover of AST nodes which are proprosed for inclusion in ECMAScript.",
Pureish:
"A cover of AST nodes which do not have side-effects. In other words, there is no observable behaviour changes if they are evaluated more than once.",
Scopable:
"A cover of [FunctionParent](#functionparent) and [BlockParent](#blockparent).",
Standardized:
"A cover of AST nodes which are part of an official ECMAScript specification.",
StandardizedOrProposal:
"A cover of AST nodes which are part of an official ECMAScript specification or a proposed for inclusion.",
Statement:
"A cover of any [Statement](https://tc39.es/ecma262/#prod-Statement)s.",
TSBaseType: "A cover of primary TypeScript type annotations.",
Expand Down
6 changes: 0 additions & 6 deletions packages/babel-types/src/asserts/generated/index.ts
Expand Up @@ -1760,12 +1760,6 @@ export function assertMiscellaneous(
): asserts node is t.Miscellaneous {
assert("Miscellaneous", node, opts);
}
export function assertProposal(
node: object | null | undefined,
opts?: object | null,
): asserts node is t.Proposal {
assert("Proposal", node, opts);
}
export function assertTypeScript(
node: object | null | undefined,
opts?: object | null,
Expand Down
34 changes: 1 addition & 33 deletions packages/babel-types/src/ast-types/generated/index.ts
Expand Up @@ -2181,22 +2181,7 @@ export type StandardizedOrProposal =
| ClassProperty
| ClassPrivateProperty
| ClassPrivateMethod
| PrivateName
| ArgumentPlaceholder
| BindExpression
| ImportAttribute
| Decorator
| DoExpression
| ExportDefaultSpecifier
| RecordExpression
| TupleExpression
| DecimalLiteral
| StaticBlock
| ModuleExpression
| TopicReference
| PipelineTopicExpression
| PipelineBareFunction
| PipelinePrimaryTopicReference;
| PrivateName;
export type Expression =
| ArrayExpression
| AssignmentExpression
Expand Down Expand Up @@ -2631,22 +2616,6 @@ export type JSX =
| JSXOpeningFragment
| JSXClosingFragment;
export type Miscellaneous = Noop | Placeholder | V8IntrinsicIdentifier;
export type Proposal =
| ArgumentPlaceholder
| BindExpression
| ImportAttribute
| Decorator
| DoExpression
| ExportDefaultSpecifier
| RecordExpression
| TupleExpression
| DecimalLiteral
| StaticBlock
| ModuleExpression
| TopicReference
| PipelineTopicExpression
| PipelineBareFunction
| PipelinePrimaryTopicReference;
export type TypeScript =
| TSParameterProperty
| TSDeclareFunction
Expand Down Expand Up @@ -2816,7 +2785,6 @@ export interface Aliases {
EnumMember: EnumMember;
JSX: JSX;
Miscellaneous: Miscellaneous;
Proposal: Proposal;
TypeScript: TypeScript;
TSTypeElement: TSTypeElement;
TSType: TSType;
Expand Down
1 change: 0 additions & 1 deletion packages/babel-types/src/constants/generated/index.ts
Expand Up @@ -52,7 +52,6 @@ export const ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS["EnumBody"];
export const ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS["EnumMember"];
export const JSX_TYPES = FLIPPED_ALIAS_KEYS["JSX"];
export const MISCELLANEOUS_TYPES = FLIPPED_ALIAS_KEYS["Miscellaneous"];
export const PROPOSAL_TYPES = FLIPPED_ALIAS_KEYS["Proposal"];
export const TYPESCRIPT_TYPES = FLIPPED_ALIAS_KEYS["TypeScript"];
export const TSTYPEELEMENT_TYPES = FLIPPED_ALIAS_KEYS["TSTypeElement"];
export const TSTYPE_TYPES = FLIPPED_ALIAS_KEYS["TSType"];
Expand Down
5 changes: 1 addition & 4 deletions packages/babel-types/src/definitions/experimental.ts
@@ -1,13 +1,10 @@
import {
defineAliasedType,
import defineType, {
assertEach,
assertNodeType,
assertValueType,
chain,
} from "./utils";

const defineType = defineAliasedType("Proposal", "StandardizedOrProposal");

defineType("ArgumentPlaceholder", {});

defineType("BindExpression", {
Expand Down
48 changes: 0 additions & 48 deletions packages/babel-types/src/validators/generated/index.ts
Expand Up @@ -4388,21 +4388,6 @@ export function isStandardizedOrProposal(
"ClassPrivateProperty" === nodeType ||
"ClassPrivateMethod" === nodeType ||
"PrivateName" === nodeType ||
"ArgumentPlaceholder" === nodeType ||
"BindExpression" === nodeType ||
"ImportAttribute" === nodeType ||
"Decorator" === nodeType ||
"DoExpression" === nodeType ||
"ExportDefaultSpecifier" === nodeType ||
"RecordExpression" === nodeType ||
"TupleExpression" === nodeType ||
"DecimalLiteral" === nodeType ||
"StaticBlock" === nodeType ||
"ModuleExpression" === nodeType ||
"TopicReference" === nodeType ||
"PipelineTopicExpression" === nodeType ||
"PipelineBareFunction" === nodeType ||
"PipelinePrimaryTopicReference" === nodeType ||
(nodeType === "Placeholder" &&
("Identifier" === (node as t.Placeholder).expectedNode ||
"StringLiteral" === (node as t.Placeholder).expectedNode ||
Expand Down Expand Up @@ -5630,39 +5615,6 @@ export function isMiscellaneous(

return false;
}
export function isProposal(
node: object | null | undefined,
opts?: object | null,
): node is t.Proposal {
if (!node) return false;

const nodeType = (node as t.Node).type;
if (
"ArgumentPlaceholder" === nodeType ||
"BindExpression" === nodeType ||
"ImportAttribute" === nodeType ||
"Decorator" === nodeType ||
"DoExpression" === nodeType ||
"ExportDefaultSpecifier" === nodeType ||
"RecordExpression" === nodeType ||
"TupleExpression" === nodeType ||
"DecimalLiteral" === nodeType ||
"StaticBlock" === nodeType ||
"ModuleExpression" === nodeType ||
"TopicReference" === nodeType ||
"PipelineTopicExpression" === nodeType ||
"PipelineBareFunction" === nodeType ||
"PipelinePrimaryTopicReference" === nodeType
) {
if (typeof opts === "undefined") {
return true;
} else {
return shallowEqual(node, opts);
}
}

return false;
}
export function isTypeScript(
node: object | null | undefined,
opts?: object | null,
Expand Down

0 comments on commit e34cf48

Please sign in to comment.