Compare f7964a9 ... +1 ... c41d3a0

Coverage Reach
packages/babel-parser/src/plugins/flow.js packages/babel-parser/src/plugins/typescript/index.js packages/babel-parser/src/plugins/typescript/scope.js packages/babel-parser/src/plugins/jsx/index.js packages/babel-parser/src/plugins/jsx/xhtml.js packages/babel-parser/src/plugins/estree.js packages/babel-parser/src/plugins/placeholders.js packages/babel-parser/src/plugins/v8intrinsic.js packages/babel-parser/src/parser/expression.js packages/babel-parser/src/parser/statement.js packages/babel-parser/src/parser/lval.js packages/babel-parser/src/parser/comments.js packages/babel-parser/src/parser/util.js packages/babel-parser/src/parser/node.js packages/babel-parser/src/parser/index.js packages/babel-parser/src/parser/error.js packages/babel-parser/src/parser/base.js packages/babel-parser/src/parser/error-message.js packages/babel-parser/src/tokenizer/index.js packages/babel-parser/src/tokenizer/context.js packages/babel-parser/src/tokenizer/state.js packages/babel-parser/src/tokenizer/types.js packages/babel-parser/src/util/scope.js packages/babel-parser/src/util/scopeflags.js packages/babel-parser/src/util/class-scope.js packages/babel-parser/src/util/whitespace.js packages/babel-parser/src/util/production-parameter.js packages/babel-parser/src/util/location.js packages/babel-parser/src/util/identifier.js packages/babel-parser/src/plugin-utils.js packages/babel-parser/src/index.js packages/babel-parser/src/options.js packages/babel-traverse/src/path/inference/inferers.js packages/babel-traverse/src/path/inference/inferer-reference.js packages/babel-traverse/src/path/inference/index.js packages/babel-traverse/src/path/conversion.js packages/babel-traverse/src/path/evaluation.js packages/babel-traverse/src/path/introspection.js packages/babel-traverse/src/path/lib/hoister.js packages/babel-traverse/src/path/lib/virtual-types.js packages/babel-traverse/src/path/lib/removal-hooks.js packages/babel-traverse/src/path/family.js packages/babel-traverse/src/path/context.js packages/babel-traverse/src/path/replacement.js packages/babel-traverse/src/path/modification.js packages/babel-traverse/src/path/index.js packages/babel-traverse/src/path/ancestry.js packages/babel-traverse/src/path/removal.js packages/babel-traverse/src/path/comments.js packages/babel-traverse/src/scope/index.js packages/babel-traverse/src/scope/lib/renamer.js packages/babel-traverse/src/scope/binding.js packages/babel-traverse/src/visitors.js packages/babel-traverse/src/context.js packages/babel-traverse/src/index.js packages/babel-traverse/src/cache.js packages/babel-traverse/src/hub.js packages/babel-generator/src/generators/flow.js packages/babel-generator/src/generators/typescript.js packages/babel-generator/src/generators/statements.js packages/babel-generator/src/generators/expressions.js packages/babel-generator/src/generators/modules.js packages/babel-generator/src/generators/types.js packages/babel-generator/src/generators/methods.js packages/babel-generator/src/generators/classes.js packages/babel-generator/src/generators/jsx.js packages/babel-generator/src/generators/base.js packages/babel-generator/src/generators/template-literals.js packages/babel-generator/src/node/parentheses.js packages/babel-generator/src/node/whitespace.js packages/babel-generator/src/node/index.js packages/babel-generator/src/printer.js packages/babel-generator/src/buffer.js packages/babel-generator/src/source-map.js packages/babel-generator/src/index.js packages/babel-core/src/config/validation/option-assertions.js packages/babel-core/src/config/validation/options.js packages/babel-core/src/config/validation/plugins.js packages/babel-core/src/config/files/configuration.js packages/babel-core/src/config/files/plugins.js packages/babel-core/src/config/files/module-types.js packages/babel-core/src/config/files/package.js packages/babel-core/src/config/files/index-browser.js packages/babel-core/src/config/files/utils.js packages/babel-core/src/config/files/import.js packages/babel-core/src/config/files/index.js packages/babel-core/src/config/config-chain.js packages/babel-core/src/config/caching.js packages/babel-core/src/config/full.js packages/babel-core/src/config/config-descriptors.js packages/babel-core/src/config/partial.js packages/babel-core/src/config/helpers/config-api.js packages/babel-core/src/config/helpers/environment.js packages/babel-core/src/config/item.js packages/babel-core/src/config/util.js packages/babel-core/src/config/pattern-to-regex.js packages/babel-core/src/config/index.js packages/babel-core/src/config/plugin.js packages/babel-core/src/transformation/file/file.js packages/babel-core/src/transformation/file/merge-map.js packages/babel-core/src/transformation/file/generate.js packages/babel-core/src/transformation/normalize-file.js packages/babel-core/src/transformation/index.js packages/babel-core/src/transformation/plugin-pass.js packages/babel-core/src/transformation/block-hoist-plugin.js packages/babel-core/src/transformation/normalize-opts.js packages/babel-core/src/tools/build-external-helpers.js packages/babel-core/src/gensync-utils/async.js packages/babel-core/src/gensync-utils/fs.js packages/babel-core/src/parser/index.js packages/babel-core/src/parser/util/missing-plugin-helper.js packages/babel-core/src/transform-ast.js packages/babel-core/src/parse.js packages/babel-core/src/transform.js packages/babel-core/src/transform-file.js packages/babel-core/src/transform-file-browser.js packages/babel-core/src/index.js packages/babel-types/src/definitions/core.js packages/babel-types/src/definitions/utils.js packages/babel-types/src/definitions/flow.js packages/babel-types/src/definitions/typescript.js packages/babel-types/src/definitions/experimental.js packages/babel-types/src/definitions/jsx.js packages/babel-types/src/definitions/placeholders.js packages/babel-types/src/definitions/index.js packages/babel-types/src/definitions/misc.js packages/babel-types/src/validators/isReferenced.js packages/babel-types/src/validators/isNodesEquivalent.js packages/babel-types/src/validators/matchesPattern.js packages/babel-types/src/validators/validate.js packages/babel-types/src/validators/isBinding.js packages/babel-types/src/validators/is.js packages/babel-types/src/validators/isValidIdentifier.js packages/babel-types/src/validators/isType.js packages/babel-types/src/validators/isScope.js packages/babel-types/src/validators/isImmutable.js packages/babel-types/src/validators/isPlaceholderType.js packages/babel-types/src/validators/isLet.js packages/babel-types/src/validators/buildMatchMemberExpression.js packages/babel-types/src/validators/isSpecifierDefault.js packages/babel-types/src/validators/react/isCompatTag.js packages/babel-types/src/validators/react/isReactComponent.js packages/babel-types/src/validators/isValidES3Identifier.js packages/babel-types/src/validators/isVar.js packages/babel-types/src/validators/isNode.js packages/babel-types/src/validators/isBlockScoped.js packages/babel-types/src/converters/gatherSequenceExpressions.js packages/babel-types/src/converters/valueToNode.js packages/babel-types/src/converters/toStatement.js packages/babel-types/src/converters/toKeyAlias.js packages/babel-types/src/converters/toExpression.js packages/babel-types/src/converters/toBlock.js packages/babel-types/src/converters/toIdentifier.js packages/babel-types/src/converters/toSequenceExpression.js packages/babel-types/src/converters/toBindingIdentifierName.js packages/babel-types/src/converters/toComputedKey.js packages/babel-types/src/converters/ensureBlock.js packages/babel-types/src/modifications/flow/removeTypeDuplicates.js packages/babel-types/src/modifications/typescript/removeTypeDuplicates.js packages/babel-types/src/modifications/removeProperties.js packages/babel-types/src/modifications/inherits.js packages/babel-types/src/modifications/appendToMemberExpression.js packages/babel-types/src/modifications/removePropertiesDeep.js packages/babel-types/src/modifications/prependToMemberExpression.js packages/babel-types/src/clone/cloneNode.js packages/babel-types/src/clone/cloneWithoutLoc.js packages/babel-types/src/clone/cloneDeep.js packages/babel-types/src/clone/cloneDeepWithoutLoc.js packages/babel-types/src/clone/clone.js packages/babel-types/src/builders/flow/createTypeAnnotationBasedOnTypeof.js packages/babel-types/src/builders/flow/createFlowUnionType.js packages/babel-types/src/builders/builder.js packages/babel-types/src/builders/react/buildChildren.js packages/babel-types/src/builders/typescript/createTSUnionType.js packages/babel-types/src/traverse/traverse.js packages/babel-types/src/traverse/traverseFast.js packages/babel-types/src/retrievers/getBindingIdentifiers.js packages/babel-types/src/retrievers/getOuterBindingIdentifiers.js packages/babel-types/src/utils/react/cleanJSXElementLiteralChild.js packages/babel-types/src/utils/shallowEqual.js packages/babel-types/src/utils/inherit.js packages/babel-types/src/comments/addComments.js packages/babel-types/src/comments/inheritsComments.js packages/babel-types/src/comments/removeComments.js packages/babel-types/src/comments/addComment.js packages/babel-types/src/comments/inheritLeadingComments.js packages/babel-types/src/comments/inheritInnerComments.js packages/babel-types/src/comments/inheritTrailingComments.js packages/babel-types/src/constants/index.js packages/babel-types/src/asserts/assertNode.js packages/babel-types/src/index.js packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js packages/babel-preset-env/src/polyfills/corejs2/entry-plugin.js packages/babel-preset-env/src/polyfills/corejs2/get-platform-specific-default.js packages/babel-preset-env/src/polyfills/corejs2/built-in-definitions.js packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js packages/babel-preset-env/src/index.js packages/babel-preset-env/src/normalize-options.js packages/babel-preset-env/src/utils.js packages/babel-preset-env/src/debug.js packages/babel-preset-env/src/plugins-compat-data.js packages/babel-preset-env/src/get-option-specific-excludes.js packages/babel-preset-env/src/options.js packages/babel-preset-env/src/filter-items.js packages/babel-helper-create-class-features-plugin/src/fields.js packages/babel-helper-create-class-features-plugin/src/index.js packages/babel-helper-create-class-features-plugin/src/decorators.js packages/babel-helper-create-class-features-plugin/src/misc.js packages/babel-helper-create-class-features-plugin/src/features.js packages/babel-helper-create-class-features-plugin/src/typescript.js packages/babel-helper-module-transforms/src/normalize-and-load-metadata.js packages/babel-helper-module-transforms/src/rewrite-live-references.js packages/babel-helper-module-transforms/src/index.js packages/babel-helper-module-transforms/src/get-module-name.js packages/babel-helper-module-transforms/src/rewrite-this.js packages/babel-plugin-transform-block-scoping/src/index.js packages/babel-plugin-transform-block-scoping/src/tdz.js packages/babel-plugin-transform-typescript/src/index.js packages/babel-plugin-transform-typescript/src/enum.js packages/babel-plugin-transform-typescript/src/namespace.js packages/babel-helper-builder-react-jsx-experimental/src/index.js packages/babel-cli/src/babel/options.js packages/babel-cli/src/babel/file.js packages/babel-cli/src/babel/dir.js packages/babel-cli/src/babel/util.js packages/babel-cli/src/babel/index.js packages/babel-cli/src/babel-external-helpers.js packages/babel-template/src/parse.js packages/babel-template/src/populate.js packages/babel-template/src/options.js packages/babel-template/src/builder.js packages/babel-template/src/literal.js packages/babel-template/src/formatters.js packages/babel-template/src/string.js packages/babel-template/src/index.js packages/babel-plugin-transform-classes/src/transformClass.js packages/babel-plugin-transform-classes/src/index.js packages/babel-plugin-transform-classes/src/inline-createSuper-helpers.js packages/babel-plugin-transform-destructuring/src/index.js packages/babel-plugin-proposal-object-rest-spread/src/index.js packages/babel-plugin-transform-parameters/src/rest.js packages/babel-plugin-transform-parameters/src/params.js packages/babel-plugin-transform-parameters/src/index.js packages/babel-helper-module-imports/src/import-injector.js packages/babel-helper-module-imports/src/import-builder.js packages/babel-helper-module-imports/src/index.js packages/babel-helper-module-imports/src/is-module.js packages/babel-helpers/src/index.js packages/babel-helpers/src/helpers.js packages/babel-plugin-transform-modules-systemjs/src/index.js packages/babel-plugin-transform-runtime/src/index.js packages/babel-plugin-transform-runtime/src/helpers.js packages/babel-plugin-transform-runtime/src/get-runtime-path/index.js packages/babel-plugin-transform-runtime/src/get-runtime-path/browser.js packages/babel-plugin-transform-runtime/src/runtime-corejs2-definitions.js packages/babel-plugin-transform-runtime/src/runtime-corejs3-definitions.js packages/babel-helper-compilation-targets/src/index.js packages/babel-helper-compilation-targets/src/filter-items.js packages/babel-helper-compilation-targets/src/utils.js packages/babel-helper-compilation-targets/src/pretty.js packages/babel-helper-compilation-targets/src/debug.js packages/babel-helper-compilation-targets/src/targets.js packages/babel-helper-compilation-targets/src/options.js packages/babel-standalone/src/transformScriptTags.js packages/babel-standalone/src/index.js packages/babel-standalone/src/preset-es2015.js packages/babel-standalone/src/preset-stage-1.js packages/babel-standalone/src/preset-stage-0.js packages/babel-standalone/src/preset-stage-2.js packages/babel-standalone/src/preset-stage-3.js packages/babel-standalone/src/generated/plugins.js packages/babel-standalone/src/babel-package-shim.js packages/babel-helper-member-expression-to-functions/src/index.js packages/babel-helper-transform-fixture-test-runner/src/index.js packages/babel-helper-transform-fixture-test-runner/src/helpers.js packages/babel-plugin-transform-for-of/src/index.js packages/babel-plugin-transform-for-of/src/no-helper-implementation.js packages/babel-plugin-transform-flow-comments/src/index.js packages/babel-node/src/_babel-node.js packages/babel-node/src/babel-node.js packages/babel-helper-fixtures/src/index.js packages/babel-plugin-proposal-decorators/src/transformer-legacy.js packages/babel-plugin-proposal-decorators/src/index.js packages/babel-helper-builder-react-jsx/src/index.js packages/babel-register/src/node.js packages/babel-register/src/cache.js packages/babel-register/src/index.js packages/babel-register/src/browser.js packages/babel-helper-replace-supers/src/index.js packages/babel-plugin-transform-modules-commonjs/src/index.js packages/babel-helper-create-regexp-features-plugin/src/index.js packages/babel-helper-create-regexp-features-plugin/src/util.js packages/babel-helper-create-regexp-features-plugin/src/features.js packages/babel-code-frame/src/index.js packages/babel-plugin-transform-react-jsx/src/transform-classic.js packages/babel-plugin-transform-react-jsx/src/transform-automatic.js packages/babel-plugin-transform-react-jsx/src/index.js packages/babel-plugin-proposal-optional-chaining/src/index.js packages/babel-helper-define-map/src/index.js packages/babel-helper-function-name/src/index.js packages/babel-plugin-transform-spread/src/index.js packages/babel-plugin-transform-flow-strip-types/src/index.js packages/babel-plugin-transform-computed-properties/src/index.js packages/babel-plugin-proposal-pipeline-operator/src/buildOptimizedSequenceExpression.js packages/babel-plugin-proposal-pipeline-operator/src/smartVisitor.js packages/babel-plugin-proposal-pipeline-operator/src/fsharpVisitor.js packages/babel-plugin-proposal-pipeline-operator/src/minimalVisitor.js packages/babel-plugin-proposal-pipeline-operator/src/index.js packages/babel-plugin-transform-modules-umd/src/index.js packages/babel-helper-validator-identifier/src/identifier.js packages/babel-helper-validator-identifier/src/keyword.js packages/babel-plugin-transform-modules-amd/src/index.js packages/babel-plugin-transform-template-literals/src/index.js packages/babel-plugin-transform-unicode-escapes/src/index.js packages/babel-plugin-proposal-async-generator-functions/src/index.js packages/babel-plugin-proposal-async-generator-functions/src/for-await.js packages/babel-plugin-transform-react-constant-elements/src/index.js packages/babel-plugin-transform-react-display-name/src/index.js packages/babel-helper-wrap-function/src/index.js packages/babel-highlight/src/index.js packages/babel-plugin-proposal-partial-application/src/index.js packages/babel-helper-split-export-declaration/src/index.js packages/babel-plugin-transform-typeof-symbol/src/index.js packages/babel-plugin-transform-react-inline-elements/src/index.js packages/babel-helper-plugin-utils/src/index.js packages/babel-helper-remap-async-to-generator/src/index.js packages/babel-plugin-transform-proto-to-assign/src/index.js packages/babel-plugin-transform-duplicate-keys/src/index.js packages/babel-helper-simple-access/src/index.js packages/babel-helper-explode-assignable-expression/src/index.js packages/babel-plugin-transform-react-jsx-source/src/index.js packages/babel-helper-call-delegate/src/index.js packages/babel-plugin-transform-new-target/src/index.js packages/babel-plugin-proposal-function-bind/src/index.js packages/babel-plugin-proposal-function-sent/src/index.js packages/babel-helper-explode-class/src/index.js packages/babel-plugin-proposal-logical-assignment-operators/src/index.js packages/babel-plugin-transform-react-jsx-development/src/index.js packages/babel-plugin-transform-react-pure-annotations/src/index.js packages/babel-preset-react/src/index.js packages/babel-plugin-transform-block-scoped-functions/src/index.js packages/babel-plugin-proposal-export-namespace-from/src/index.js packages/babel-helper-hoist-variables/src/index.js packages/babel-plugin-syntax-decorators/src/index.js packages/babel-plugin-syntax-typescript/src/index.js packages/babel-plugin-transform-property-mutators/src/index.js packages/babel-plugin-external-helpers/src/index.js packages/babel-plugin-transform-instanceof/src/index.js packages/babel-plugin-transform-async-to-generator/src/index.js packages/babel-plugin-transform-object-super/src/index.js packages/babel-plugin-proposal-export-default-from/src/index.js packages/babel-helper-bindify-decorators/src/index.js packages/babel-helper-builder-binary-assignment-operator-visitor/src/index.js packages/babel-plugin-proposal-nullish-coalescing-operator/src/index.js packages/babel-plugin-syntax-flow/src/index.js packages/babel-plugin-transform-shorthand-properties/src/index.js packages/babel-preset-typescript/src/index.js packages/babel-plugin-transform-function-name/src/index.js packages/babel-plugin-proposal-json-strings/src/index.js packages/babel-plugin-proposal-dynamic-import/src/index.js packages/babel-plugin-transform-react-jsx-self/src/index.js packages/babel-plugin-transform-member-expression-literals/src/index.js packages/babel-plugin-transform-react-jsx-compat/src/index.js packages/babel-plugin-transform-property-literals/src/index.js packages/babel-plugin-transform-literals/src/index.js packages/babel-helper-annotate-as-pure/src/index.js packages/babel-helper-optimise-call-expression/src/index.js packages/babel-plugin-syntax-jsx/src/index.js packages/babel-plugin-proposal-do-expressions/src/index.js packages/babel-plugin-proposal-throw-expressions/src/index.js packages/babel-plugin-proposal-optional-catch-binding/src/index.js packages/babel-plugin-syntax-pipeline-operator/src/index.js packages/babel-helper-regex/src/index.js packages/babel-plugin-transform-sticky-regex/src/index.js packages/babel-plugin-syntax-module-attributes/src/index.js packages/babel-plugin-transform-strict-mode/src/index.js packages/babel-plugin-proposal-numeric-separator/src/index.js packages/babel-plugin-transform-jscript/src/index.js packages/babel-plugin-transform-arrow-functions/src/index.js packages/babel-plugin-syntax-record-and-tuple/src/index.js packages/babel-helper-get-function-arity/src/index.js packages/babel-plugin-transform-reserved-words/src/index.js packages/babel-plugin-proposal-unicode-property-regex/src/index.js packages/babel-plugin-transform-object-assign/src/index.js packages/babel-plugin-transform-object-set-prototype-of-to-assign/src/index.js packages/babel-plugin-syntax-partial-application/src/index.js packages/babel-plugin-transform-named-capturing-groups-regex/src/index.js packages/babel-plugin-syntax-numeric-separator/src/index.js packages/babel-plugin-syntax-function-sent/src/index.js packages/babel-plugin-proposal-class-properties/src/index.js packages/babel-plugin-transform-exponentiation-operator/src/index.js packages/babel-plugin-syntax-throw-expressions/src/index.js packages/babel-plugin-syntax-do-expressions/src/index.js packages/babel-plugin-proposal-private-property-in-object/src/index.js packages/babel-plugin-syntax-export-default-from/src/index.js packages/babel-plugin-syntax-function-bind/src/index.js packages/babel-plugin-syntax-class-properties/src/index.js packages/babel-plugin-syntax-top-level-await/src/index.js packages/babel-plugin-proposal-private-methods/src/index.js packages/babel-plugin-syntax-logical-assignment-operators/src/index.js packages/babel-plugin-syntax-import-meta/src/index.js packages/babel-plugin-transform-unicode-regex/src/index.js packages/babel-polyfill/src/index.js packages/babel-helper-plugin-test-runner/src/index.js packages/babel-preset-flow/src/index.js packages/babel-plugin-transform-dotall-regex/src/index.js eslint/babel-eslint-parser/src/convert/convertTokens.js eslint/babel-eslint-parser/src/convert/convertAST.js eslint/babel-eslint-parser/src/convert/convertComments.js eslint/babel-eslint-parser/src/convert/index.js eslint/babel-eslint-parser/src/analyze-scope.js eslint/babel-eslint-parser/src/index.js eslint/babel-eslint-parser/src/configuration.js eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js eslint/babel-eslint-plugin-development/src/utils/get-export-name.js eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js eslint/babel-eslint-plugin-development/src/rules/plugin-name.js eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js eslint/babel-eslint-plugin-development/src/index.js eslint/babel-eslint-plugin/src/rules/semi.js eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js eslint/babel-eslint-plugin/src/rules/no-invalid-this.js eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js eslint/babel-eslint-plugin/src/rules/new-cap.js eslint/babel-eslint-plugin/src/index.js eslint/babel-eslint-plugin-development-internal/src/rules/dry-error-messages.js eslint/babel-eslint-plugin-development-internal/src/index.js codemods/babel-plugin-codemod-object-assign-to-object-spread/src/index.js codemods/babel-plugin-codemod-optional-catch-binding/src/index.js

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -12,8 +12,10 @@
Loading
12 12
  validateOptionalType,
13 13
  validateType,
14 14
} from "./utils";
15 -
import { functionDeclarationCommon } from "./core";
16 -
import { classMethodOrDeclareMethodCommon } from "./es2015";
15 +
import {
16 +
  functionDeclarationCommon,
17 +
  classMethodOrDeclareMethodCommon,
18 +
} from "./core";
17 19
18 20
const bool = assertValueType("boolean");
19 21

@@ -1,6 +1,5 @@
Loading
1 1
// @flow
2 2
import defineType, {
3 -
  assertOptionalChainStart,
4 3
  assertEach,
5 4
  assertNodeType,
6 5
  assertValueType,
@@ -9,22 +8,11 @@
Loading
9 8
import {
10 9
  classMethodOrPropertyCommon,
11 10
  classMethodOrDeclareMethodCommon,
12 -
} from "./es2015";
13 -
import { functionTypeAnnotationCommon } from "./core";
11 +
  functionTypeAnnotationCommon,
12 +
} from "./core";
14 13
15 14
defineType("ArgumentPlaceholder", {});
16 15
17 -
defineType("AwaitExpression", {
18 -
  builder: ["argument"],
19 -
  visitor: ["argument"],
20 -
  aliases: ["Expression", "Terminatorless"],
21 -
  fields: {
22 -
    argument: {
23 -
      validate: assertNodeType("Expression"),
24 -
    },
25 -
  },
26 -
});
27 -
28 16
defineType("BindExpression", {
29 17
  visitor: ["object", "callee"],
30 18
  aliases: ["Expression"],
@@ -94,39 +82,6 @@
Loading
94 82
  },
95 83
});
96 84
97 -
defineType("OptionalMemberExpression", {
98 -
  builder: ["object", "property", "computed", "optional"],
99 -
  visitor: ["object", "property"],
100 -
  aliases: ["Expression"],
101 -
  fields: {
102 -
    object: {
103 -
      validate: assertNodeType("Expression"),
104 -
    },
105 -
    property: {
106 -
      validate: (function () {
107 -
        const normal = assertNodeType("Identifier");
108 -
        const computed = assertNodeType("Expression");
109 -
110 -
        const validator = function (node, key, val) {
111 -
          const validator = node.computed ? computed : normal;
112 -
          validator(node, key, val);
113 -
        };
114 -
        // todo(ts): can be discriminated union by `computed` property
115 -
        validator.oneOfNodeTypes = ["Expression", "Identifier"];
116 -
        return validator;
117 -
      })(),
118 -
    },
119 -
    computed: {
120 -
      default: false,
121 -
    },
122 -
    optional: {
123 -
      validate: !process.env.BABEL_TYPES_8_BREAKING
124 -
        ? assertValueType("boolean")
125 -
        : chain(assertValueType("boolean"), assertOptionalChainStart()),
126 -
    },
127 -
  },
128 -
});
129 -
130 85
defineType("PipelineTopicExpression", {
131 86
  builder: ["expression"],
132 87
  visitor: ["expression"],
@@ -151,38 +106,6 @@
Loading
151 106
  aliases: ["Expression"],
152 107
});
153 108
154 -
defineType("OptionalCallExpression", {
155 -
  visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
156 -
  builder: ["callee", "arguments", "optional"],
157 -
  aliases: ["Expression"],
158 -
  fields: {
159 -
    callee: {
160 -
      validate: assertNodeType("Expression"),
161 -
    },
162 -
    arguments: {
163 -
      validate: chain(
164 -
        assertValueType("array"),
165 -
        assertEach(
166 -
          assertNodeType("Expression", "SpreadElement", "JSXNamespacedName"),
167 -
        ),
168 -
      ),
169 -
    },
170 -
    optional: {
171 -
      validate: !process.env.BABEL_TYPES_8_BREAKING
172 -
        ? assertValueType("boolean")
173 -
        : chain(assertValueType("boolean"), assertOptionalChainStart()),
174 -
    },
175 -
    typeArguments: {
176 -
      validate: assertNodeType("TypeParameterInstantiation"),
177 -
      optional: true,
178 -
    },
179 -
    typeParameters: {
180 -
      validate: assertNodeType("TSTypeParameterInstantiation"),
181 -
      optional: true,
182 -
    },
183 -
  },
184 -
});
185 -
186 109
defineType("ClassPrivateProperty", {
187 110
  visitor: ["key", "value", "decorators"],
188 111
  builder: ["key", "value", "decorators"],
@@ -235,10 +158,6 @@
Loading
235 158
  },
236 159
});
237 160
238 -
defineType("Import", {
239 -
  aliases: ["Expression"],
240 -
});
241 -
242 161
defineType("ImportAttribute", {
243 162
  visitor: ["key", "value"],
244 163
  fields: {
@@ -280,16 +199,6 @@
Loading
280 199
  },
281 200
});
282 201
283 -
defineType("ExportNamespaceSpecifier", {
284 -
  visitor: ["exported"],
285 -
  aliases: ["ModuleSpecifier"],
286 -
  fields: {
287 -
    exported: {
288 -
      validate: assertNodeType("Identifier"),
289 -
    },
290 -
  },
291 -
});
292 -
293 202
defineType("PrivateName", {
294 203
  visitor: ["id"],
295 204
  aliases: ["Private"],
@@ -300,16 +209,6 @@
Loading
300 209
  },
301 210
});
302 211
303 -
defineType("BigIntLiteral", {
304 -
  builder: ["value"],
305 -
  fields: {
306 -
    value: {
307 -
      validate: assertValueType("string"),
308 -
    },
309 -
  },
310 -
  aliases: ["Expression", "Pureish", "Literal", "Immutable"],
311 -
});
312 -
313 212
defineType("RecordExpression", {
314 213
  visitor: ["properties"],
315 214
  aliases: ["Expression"],

@@ -13,12 +13,15 @@
Loading
13 13
} from "../constants";
14 14
15 15
import defineType, {
16 +
  assertShape,
17 +
  assertOptionalChainStart,
16 18
  assertValueType,
17 19
  assertNodeType,
18 20
  assertNodeOrValueType,
19 21
  assertEach,
20 22
  chain,
21 23
  assertOneOf,
24 +
  validateOptional,
22 25
} from "./utils";
23 26
24 27
defineType("ArrayExpression", {
@@ -1152,3 +1155,838 @@
Loading
1152 1155
    },
1153 1156
  },
1154 1157
});
1158 +
1159 +
// --- ES2015 ---
1160 +
defineType("AssignmentPattern", {
1161 +
  visitor: ["left", "right", "decorators" /* for legacy param decorators */],
1162 +
  builder: ["left", "right"],
1163 +
  aliases: ["Pattern", "PatternLike", "LVal"],
1164 +
  fields: {
1165 +
    ...patternLikeCommon,
1166 +
    left: {
1167 +
      validate: assertNodeType(
1168 +
        "Identifier",
1169 +
        "ObjectPattern",
1170 +
        "ArrayPattern",
1171 +
        "MemberExpression",
1172 +
      ),
1173 +
    },
1174 +
    right: {
1175 +
      validate: assertNodeType("Expression"),
1176 +
    },
1177 +
    // For TypeScript
1178 +
    decorators: {
1179 +
      validate: chain(
1180 +
        assertValueType("array"),
1181 +
        assertEach(assertNodeType("Decorator")),
1182 +
      ),
1183 +
      optional: true,
1184 +
    },
1185 +
  },
1186 +
});
1187 +
1188 +
defineType("ArrayPattern", {
1189 +
  visitor: ["elements", "typeAnnotation"],
1190 +
  builder: ["elements"],
1191 +
  aliases: ["Pattern", "PatternLike", "LVal"],
1192 +
  fields: {
1193 +
    ...patternLikeCommon,
1194 +
    elements: {
1195 +
      validate: chain(
1196 +
        assertValueType("array"),
1197 +
        assertEach(assertNodeOrValueType("null", "PatternLike")),
1198 +
      ),
1199 +
    },
1200 +
    // For TypeScript
1201 +
    decorators: {
1202 +
      validate: chain(
1203 +
        assertValueType("array"),
1204 +
        assertEach(assertNodeType("Decorator")),
1205 +
      ),
1206 +
      optional: true,
1207 +
    },
1208 +
  },
1209 +
});
1210 +
1211 +
defineType("ArrowFunctionExpression", {
1212 +
  builder: ["params", "body", "async"],
1213 +
  visitor: ["params", "body", "returnType", "typeParameters"],
1214 +
  aliases: [
1215 +
    "Scopable",
1216 +
    "Function",
1217 +
    "BlockParent",
1218 +
    "FunctionParent",
1219 +
    "Expression",
1220 +
    "Pureish",
1221 +
  ],
1222 +
  fields: {
1223 +
    ...functionCommon,
1224 +
    ...functionTypeAnnotationCommon,
1225 +
    expression: {
1226 +
      // https://github.com/babel/babylon/issues/505
1227 +
      validate: assertValueType("boolean"),
1228 +
    },
1229 +
    body: {
1230 +
      validate: assertNodeType("BlockStatement", "Expression"),
1231 +
    },
1232 +
  },
1233 +
});
1234 +
1235 +
defineType("ClassBody", {
1236 +
  visitor: ["body"],
1237 +
  fields: {
1238 +
    body: {
1239 +
      validate: chain(
1240 +
        assertValueType("array"),
1241 +
        assertEach(
1242 +
          assertNodeType(
1243 +
            "ClassMethod",
1244 +
            "ClassPrivateMethod",
1245 +
            "ClassProperty",
1246 +
            "ClassPrivateProperty",
1247 +
            "TSDeclareMethod",
1248 +
            "TSIndexSignature",
1249 +
          ),
1250 +
        ),
1251 +
      ),
1252 +
    },
1253 +
  },
1254 +
});
1255 +
1256 +
defineType("ClassExpression", {
1257 +
  builder: ["id", "superClass", "body", "decorators"],
1258 +
  visitor: [
1259 +
    "id",
1260 +
    "body",
1261 +
    "superClass",
1262 +
    "mixins",
1263 +
    "typeParameters",
1264 +
    "superTypeParameters",
1265 +
    "implements",
1266 +
    "decorators",
1267 +
  ],
1268 +
  aliases: ["Scopable", "Class", "Expression"],
1269 +
  fields: {
1270 +
    id: {
1271 +
      validate: assertNodeType("Identifier"),
1272 +
      // In declarations, this is missing if this is the
1273 +
      // child of an ExportDefaultDeclaration.
1274 +
      optional: true,
1275 +
    },
1276 +
    typeParameters: {
1277 +
      validate: assertNodeType(
1278 +
        "TypeParameterDeclaration",
1279 +
        "TSTypeParameterDeclaration",
1280 +
        "Noop",
1281 +
      ),
1282 +
      optional: true,
1283 +
    },
1284 +
    body: {
1285 +
      validate: assertNodeType("ClassBody"),
1286 +
    },
1287 +
    superClass: {
1288 +
      optional: true,
1289 +
      validate: assertNodeType("Expression"),
1290 +
    },
1291 +
    superTypeParameters: {
1292 +
      validate: assertNodeType(
1293 +
        "TypeParameterInstantiation",
1294 +
        "TSTypeParameterInstantiation",
1295 +
      ),
1296 +
      optional: true,
1297 +
    },
1298 +
    implements: {
1299 +
      validate: chain(
1300 +
        assertValueType("array"),
1301 +
        assertEach(
1302 +
          assertNodeType("TSExpressionWithTypeArguments", "ClassImplements"),
1303 +
        ),
1304 +
      ),
1305 +
      optional: true,
1306 +
    },
1307 +
    decorators: {
1308 +
      validate: chain(
1309 +
        assertValueType("array"),
1310 +
        assertEach(assertNodeType("Decorator")),
1311 +
      ),
1312 +
      optional: true,
1313 +
    },
1314 +
    mixins: {
1315 +
      validate: assertNodeType("InterfaceExtends"),
1316 +
      optional: true,
1317 +
    },
1318 +
  },
1319 +
});
1320 +
1321 +
defineType("ClassDeclaration", {
1322 +
  inherits: "ClassExpression",
1323 +
  aliases: ["Scopable", "Class", "Statement", "Declaration"],
1324 +
  fields: {
1325 +
    id: {
1326 +
      validate: assertNodeType("Identifier"),
1327 +
    },
1328 +
    typeParameters: {
1329 +
      validate: assertNodeType(
1330 +
        "TypeParameterDeclaration",
1331 +
        "TSTypeParameterDeclaration",
1332 +
        "Noop",
1333 +
      ),
1334 +
      optional: true,
1335 +
    },
1336 +
    body: {
1337 +
      validate: assertNodeType("ClassBody"),
1338 +
    },
1339 +
    superClass: {
1340 +
      optional: true,
1341 +
      validate: assertNodeType("Expression"),
1342 +
    },
1343 +
    superTypeParameters: {
1344 +
      validate: assertNodeType(
1345 +
        "TypeParameterInstantiation",
1346 +
        "TSTypeParameterInstantiation",
1347 +
      ),
1348 +
      optional: true,
1349 +
    },
1350 +
    implements: {
1351 +
      validate: chain(
1352 +
        assertValueType("array"),
1353 +
        assertEach(
1354 +
          assertNodeType("TSExpressionWithTypeArguments", "ClassImplements"),
1355 +
        ),
1356 +
      ),
1357 +
      optional: true,
1358 +
    },
1359 +
    decorators: {
1360 +
      validate: chain(
1361 +
        assertValueType("array"),
1362 +
        assertEach(assertNodeType("Decorator")),
1363 +
      ),
1364 +
      optional: true,
1365 +
    },
1366 +
    mixins: {
1367 +
      validate: assertNodeType("InterfaceExtends"),
1368 +
      optional: true,
1369 +
    },
1370 +
    declare: {
1371 +
      validate: assertValueType("boolean"),
1372 +
      optional: true,
1373 +
    },
1374 +
    abstract: {
1375 +
      validate: assertValueType("boolean"),
1376 +
      optional: true,
1377 +
    },
1378 +
  },
1379 +
  validate: (function () {
1380 +
    const identifier = assertNodeType("Identifier");
1381 +
1382 +
    return function (parent, key, node) {
1383 +
      if (!process.env.BABEL_TYPES_8_BREAKING) return;
1384 +
1385 +
      if (!is("ExportDefaultDeclaration", parent)) {
1386 +
        identifier(node, "id", node.id);
1387 +
      }
1388 +
    };
1389 +
  })(),
1390 +
});
1391 +
1392 +
defineType("ExportAllDeclaration", {
1393 +
  visitor: ["source"],
1394 +
  aliases: [
1395 +
    "Statement",
1396 +
    "Declaration",
1397 +
    "ModuleDeclaration",
1398 +
    "ExportDeclaration",
1399 +
  ],
1400 +
  fields: {
1401 +
    source: {
1402 +
      validate: assertNodeType("StringLiteral"),
1403 +
    },
1404 +
  },
1405 +
});
1406 +
1407 +
defineType("ExportDefaultDeclaration", {
1408 +
  visitor: ["declaration"],
1409 +
  aliases: [
1410 +
    "Statement",
1411 +
    "Declaration",
1412 +
    "ModuleDeclaration",
1413 +
    "ExportDeclaration",
1414 +
  ],
1415 +
  fields: {
1416 +
    declaration: {
1417 +
      validate: assertNodeType(
1418 +
        "FunctionDeclaration",
1419 +
        "TSDeclareFunction",
1420 +
        "ClassDeclaration",
1421 +
        "Expression",
1422 +
      ),
1423 +
    },
1424 +
  },
1425 +
});
1426 +
1427 +
defineType("ExportNamedDeclaration", {
1428 +
  visitor: ["declaration", "specifiers", "source"],
1429 +
  aliases: [
1430 +
    "Statement",
1431 +
    "Declaration",
1432 +
    "ModuleDeclaration",
1433 +
    "ExportDeclaration",
1434 +
  ],
1435 +
  fields: {
1436 +
    declaration: {
1437 +
      optional: true,
1438 +
      validate: chain(
1439 +
        assertNodeType("Declaration"),
1440 +
        Object.assign(
1441 +
          function (node, key, val) {
1442 +
            if (!process.env.BABEL_TYPES_8_BREAKING) return;
1443 +
1444 +
            // This validator isn't put at the top level because we can run it
1445 +
            // even if this node doesn't have a parent.
1446 +
1447 +
            if (val && node.specifiers.length) {
1448 +
              throw new TypeError(
1449 +
                "Only declaration or specifiers is allowed on ExportNamedDeclaration",
1450 +
              );
1451 +
            }
1452 +
          },
1453 +
          { oneOfNodeTypes: ["Declaration"] },
1454 +
        ),
1455 +
        function (node, key, val) {
1456 +
          if (!process.env.BABEL_TYPES_8_BREAKING) return;
1457 +
1458 +
          // This validator isn't put at the top level because we can run it
1459 +
          // even if this node doesn't have a parent.
1460 +
1461 +
          if (val && node.source) {
1462 +
            throw new TypeError("Cannot export a declaration from a source");
1463 +
          }
1464 +
        },
1465 +
      ),
1466 +
    },
1467 +
    specifiers: {
1468 +
      default: [],
1469 +
      validate: chain(
1470 +
        assertValueType("array"),
1471 +
        assertEach(
1472 +
          (function () {
1473 +
            const sourced = assertNodeType(
1474 +
              "ExportSpecifier",
1475 +
              "ExportDefaultSpecifier",
1476 +
              "ExportNamespaceSpecifier",
1477 +
            );
1478 +
            const sourceless = assertNodeType("ExportSpecifier");
1479 +
1480 +
            if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;
1481 +
1482 +
            return function (node, key, val) {
1483 +
              const validator = node.source ? sourced : sourceless;
1484 +
              validator(node, key, val);
1485 +
            };
1486 +
          })(),
1487 +
        ),
1488 +
      ),
1489 +
    },
1490 +
    source: {
1491 +
      validate: assertNodeType("StringLiteral"),
1492 +
      optional: true,
1493 +
    },
1494 +
    exportKind: validateOptional(assertOneOf("type", "value")),
1495 +
  },
1496 +
});
1497 +
1498 +
defineType("ExportSpecifier", {
1499 +
  visitor: ["local", "exported"],
1500 +
  aliases: ["ModuleSpecifier"],
1501 +
  fields: {
1502 +
    local: {
1503 +
      validate: assertNodeType("Identifier"),
1504 +
    },
1505 +
    exported: {
1506 +
      validate: assertNodeType("Identifier"),
1507 +
    },
1508 +
  },
1509 +
});
1510 +
1511 +
defineType("ForOfStatement", {
1512 +
  visitor: ["left", "right", "body"],
1513 +
  builder: ["left", "right", "body", "await"],
1514 +
  aliases: [
1515 +
    "Scopable",
1516 +
    "Statement",
1517 +
    "For",
1518 +
    "BlockParent",
1519 +
    "Loop",
1520 +
    "ForXStatement",
1521 +
  ],
1522 +
  fields: {
1523 +
    left: {
1524 +
      validate: (function () {
1525 +
        if (!process.env.BABEL_TYPES_8_BREAKING) {
1526 +
          return assertNodeType("VariableDeclaration", "LVal");
1527 +
        }
1528 +
1529 +
        const declaration = assertNodeType("VariableDeclaration");
1530 +
        const lval = assertNodeType(
1531 +
          "Identifier",
1532 +
          "MemberExpression",
1533 +
          "ArrayPattern",
1534 +
          "ObjectPattern",
1535 +
        );
1536 +
1537 +
        return function (node, key, val) {
1538 +
          if (is("VariableDeclaration", val)) {
1539 +
            declaration(node, key, val);
1540 +
          } else {
1541 +
            lval(node, key, val);
1542 +
          }
1543 +
        };
1544 +
      })(),
1545 +
    },
1546 +
    right: {
1547 +
      validate: assertNodeType("Expression"),
1548 +
    },
1549 +
    body: {
1550 +
      validate: assertNodeType("Statement"),
1551 +
    },
1552 +
    await: {
1553 +
      default: false,
1554 +
    },
1555 +
  },
1556 +
});
1557 +
1558 +
defineType("ImportDeclaration", {
1559 +
  visitor: ["specifiers", "source"],
1560 +
  aliases: ["Statement", "Declaration", "ModuleDeclaration"],
1561 +
  fields: {
1562 +
    specifiers: {
1563 +
      validate: chain(
1564 +
        assertValueType("array"),
1565 +
        assertEach(
1566 +
          assertNodeType(
1567 +
            "ImportSpecifier",
1568 +
            "ImportDefaultSpecifier",
1569 +
            "ImportNamespaceSpecifier",
1570 +
          ),
1571 +
        ),
1572 +
      ),
1573 +
    },
1574 +
    source: {
1575 +
      validate: assertNodeType("StringLiteral"),
1576 +
    },
1577 +
    importKind: {
1578 +
      // Handle TypeScript/Flowtype's extension "import type foo from"
1579 +
      // TypeScript doesn't support typeof
1580 +
      validate: assertOneOf("type", "typeof", "value"),
1581 +
      optional: true,
1582 +
    },
1583 +
  },
1584 +
});
1585 +
1586 +
defineType("ImportDefaultSpecifier", {
1587 +
  visitor: ["local"],
1588 +
  aliases: ["ModuleSpecifier"],
1589 +
  fields: {
1590 +
    local: {
1591 +
      validate: assertNodeType("Identifier"),
1592 +
    },
1593 +
  },
1594 +
});
1595 +
1596 +
defineType("ImportNamespaceSpecifier", {
1597 +
  visitor: ["local"],
1598 +
  aliases: ["ModuleSpecifier"],
1599 +
  fields: {
1600 +
    local: {
1601 +
      validate: assertNodeType("Identifier"),
1602 +
    },
1603 +
  },
1604 +
});
1605 +
1606 +
defineType("ImportSpecifier", {
1607 +
  visitor: ["local", "imported"],
1608 +
  aliases: ["ModuleSpecifier"],
1609 +
  fields: {
1610 +
    local: {
1611 +
      validate: assertNodeType("Identifier"),
1612 +
    },
1613 +
    imported: {
1614 +
      validate: assertNodeType("Identifier"),
1615 +
    },
1616 +
    importKind: {
1617 +
      // Handle Flowtype's extension "import {typeof foo} from"
1618 +
      validate: assertOneOf("type", "typeof"),
1619 +
      optional: true,
1620 +
    },
1621 +
  },
1622 +
});
1623 +
1624 +
defineType("MetaProperty", {
1625 +
  visitor: ["meta", "property"],
1626 +
  aliases: ["Expression"],
1627 +
  fields: {
1628 +
    meta: {
1629 +
      validate: chain(
1630 +
        assertNodeType("Identifier"),
1631 +
        Object.assign(
1632 +
          function (node, key, val) {
1633 +
            if (!process.env.BABEL_TYPES_8_BREAKING) return;
1634 +
1635 +
            let property;
1636 +
            switch (val.name) {
1637 +
              case "function":
1638 +
                property = "sent";
1639 +
                break;
1640 +
              case "new":
1641 +
                property = "target";
1642 +
                break;
1643 +
              case "import":
1644 +
                property = "meta";
1645 +
                break;
1646 +
            }
1647 +
            if (!is("Identifier", node.property, { name: property })) {
1648 +
              throw new TypeError("Unrecognised MetaProperty");
1649 +
            }
1650 +
          },
1651 +
          { oneOfNodeTypes: ["Identifier"] },
1652 +
        ),
1653 +
      ),
1654 +
    },
1655 +
    property: {
1656 +
      validate: assertNodeType("Identifier"),
1657 +
    },
1658 +
  },
1659 +
});
1660 +
1661 +
export const classMethodOrPropertyCommon = {
1662 +
  abstract: {
1663 +
    validate: assertValueType("boolean"),
1664 +
    optional: true,
1665 +
  },
1666 +
  accessibility: {
1667 +
    validate: assertOneOf("public", "private", "protected"),
1668 +
    optional: true,
1669 +
  },
1670 +
  static: {
1671 +
    default: false,
1672 +
  },
1673 +
  computed: {
1674 +
    default: false,
1675 +
  },
1676 +
  optional: {
1677 +
    validate: assertValueType("boolean"),
1678 +
    optional: true,
1679 +
  },
1680 +
  key: {
1681 +
    validate: chain(
1682 +
      (function () {
1683 +
        const normal = assertNodeType(
1684 +
          "Identifier",
1685 +
          "StringLiteral",
1686 +
          "NumericLiteral",
1687 +
        );
1688 +
        const computed = assertNodeType("Expression");
1689 +
1690 +
        return function (node: Object, key: string, val: any) {
1691 +
          const validator = node.computed ? computed : normal;
1692 +
          validator(node, key, val);
1693 +
        };
1694 +
      })(),
1695 +
      assertNodeType(
1696 +
        "Identifier",
1697 +
        "StringLiteral",
1698 +
        "NumericLiteral",
1699 +
        "Expression",
1700 +
      ),
1701 +
    ),
1702 +
  },
1703 +
};
1704 +
1705 +
export const classMethodOrDeclareMethodCommon = {
1706 +
  ...functionCommon,
1707 +
  ...classMethodOrPropertyCommon,
1708 +
  kind: {
1709 +
    validate: assertOneOf("get", "set", "method", "constructor"),
1710 +
    default: "method",
1711 +
  },
1712 +
  access: {
1713 +
    validate: chain(
1714 +
      assertValueType("string"),
1715 +
      assertOneOf("public", "private", "protected"),
1716 +
    ),
1717 +
    optional: true,
1718 +
  },
1719 +
  decorators: {
1720 +
    validate: chain(
1721 +
      assertValueType("array"),
1722 +
      assertEach(assertNodeType("Decorator")),
1723 +
    ),
1724 +
    optional: true,
1725 +
  },
1726 +
};
1727 +
1728 +
defineType("ClassMethod", {
1729 +
  aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
1730 +
  builder: [
1731 +
    "kind",
1732 +
    "key",
1733 +
    "params",
1734 +
    "body",
1735 +
    "computed",
1736 +
    "static",
1737 +
    "generator",
1738 +
    "async",
1739 +
  ],
1740 +
  visitor: [
1741 +
    "key",
1742 +
    "params",
1743 +
    "body",
1744 +
    "decorators",
1745 +
    "returnType",
1746 +
    "typeParameters",
1747 +
  ],
1748 +
  fields: {
1749 +
    ...classMethodOrDeclareMethodCommon,
1750 +
    ...functionTypeAnnotationCommon,
1751 +
    body: {
1752 +
      validate: assertNodeType("BlockStatement"),
1753 +
    },
1754 +
  },
1755 +
});
1756 +
1757 +
defineType("ObjectPattern", {
1758 +
  visitor: [
1759 +
    "properties",
1760 +
    "typeAnnotation",
1761 +
    "decorators" /* for legacy param decorators */,
1762 +
  ],
1763 +
  builder: ["properties"],
1764 +
  aliases: ["Pattern", "PatternLike", "LVal"],
1765 +
  fields: {
1766 +
    ...patternLikeCommon,
1767 +
    properties: {
1768 +
      validate: chain(
1769 +
        assertValueType("array"),
1770 +
        assertEach(assertNodeType("RestElement", "ObjectProperty")),
1771 +
      ),
1772 +
    },
1773 +
  },
1774 +
});
1775 +
1776 +
defineType("SpreadElement", {
1777 +
  visitor: ["argument"],
1778 +
  aliases: ["UnaryLike"],
1779 +
  deprecatedAlias: "SpreadProperty",
1780 +
  fields: {
1781 +
    argument: {
1782 +
      validate: assertNodeType("Expression"),
1783 +
    },
1784 +
  },
1785 +
});
1786 +
1787 +
defineType("Super", {
1788 +
  aliases: ["Expression"],
1789 +
});
1790 +
1791 +
defineType("TaggedTemplateExpression", {
1792 +
  visitor: ["tag", "quasi"],
1793 +
  aliases: ["Expression"],
1794 +
  fields: {
1795 +
    tag: {
1796 +
      validate: assertNodeType("Expression"),
1797 +
    },
1798 +
    quasi: {
1799 +
      validate: assertNodeType("TemplateLiteral"),
1800 +
    },
1801 +
    typeParameters: {
1802 +
      validate: assertNodeType(
1803 +
        "TypeParameterInstantiation",
1804 +
        "TSTypeParameterInstantiation",
1805 +
      ),
1806 +
      optional: true,
1807 +
    },
1808 +
  },
1809 +
});
1810 +
1811 +
defineType("TemplateElement", {
1812 +
  builder: ["value", "tail"],
1813 +
  fields: {
1814 +
    value: {
1815 +
      validate: assertShape({
1816 +
        raw: {
1817 +
          validate: assertValueType("string"),
1818 +
        },
1819 +
        cooked: {
1820 +
          validate: assertValueType("string"),
1821 +
          optional: true,
1822 +
        },
1823 +
      }),
1824 +
    },
1825 +
    tail: {
1826 +
      default: false,
1827 +
    },
1828 +
  },
1829 +
});
1830 +
1831 +
defineType("TemplateLiteral", {
1832 +
  visitor: ["quasis", "expressions"],
1833 +
  aliases: ["Expression", "Literal"],
1834 +
  fields: {
1835 +
    quasis: {
1836 +
      validate: chain(
1837 +
        assertValueType("array"),
1838 +
        assertEach(assertNodeType("TemplateElement")),
1839 +
      ),
1840 +
    },
1841 +
    expressions: {
1842 +
      validate: chain(
1843 +
        assertValueType("array"),
1844 +
        assertEach(assertNodeType("Expression")),
1845 +
        function (node, key, val) {
1846 +
          if (node.quasis.length !== val.length + 1) {
1847 +
            throw new TypeError(
1848 +
              `Number of ${
1849 +
                node.type
1850 +
              } quasis should be exactly one more than the number of expressions.\nExpected ${
1851 +
                val.length + 1
1852 +
              } quasis but got ${node.quasis.length}`,
1853 +
            );
1854 +
          }
1855 +
        },
1856 +
      ),
1857 +
    },
1858 +
  },
1859 +
});
1860 +
1861 +
defineType("YieldExpression", {
1862 +
  builder: ["argument", "delegate"],
1863 +
  visitor: ["argument"],
1864 +
  aliases: ["Expression", "Terminatorless"],
1865 +
  fields: {
1866 +
    delegate: {
1867 +
      validate: chain(
1868 +
        assertValueType("boolean"),
1869 +
        Object.assign(
1870 +
          function (node, key, val) {
1871 +
            if (!process.env.BABEL_TYPES_8_BREAKING) return;
1872 +
1873 +
            if (val && !node.argument) {
1874 +
              throw new TypeError(
1875 +
                "Property delegate of YieldExpression cannot be true if there is no argument",
1876 +
              );
1877 +
            }
1878 +
          },
1879 +
          { type: "boolean" },
1880 +
        ),
1881 +
      ),
1882 +
      default: false,
1883 +
    },
1884 +
    argument: {
1885 +
      optional: true,
1886 +
      validate: assertNodeType("Expression"),
1887 +
    },
1888 +
  },
1889 +
});
1890 +
1891 +
// --- ES2017 ---
1892 +
defineType("AwaitExpression", {
1893 +
  builder: ["argument"],
1894 +
  visitor: ["argument"],
1895 +
  aliases: ["Expression", "Terminatorless"],
1896 +
  fields: {
1897 +
    argument: {
1898 +
      validate: assertNodeType("Expression"),
1899 +
    },
1900 +
  },
1901 +
});
1902 +
1903 +
// --- ES2019 ---
1904 +
defineType("Import", {
1905 +
  aliases: ["Expression"],
1906 +
});
1907 +
1908 +
// --- ES2020 ---
1909 +
defineType("BigIntLiteral", {
1910 +
  builder: ["value"],
1911 +
  fields: {
1912 +
    value: {
1913 +
      validate: assertValueType("string"),
1914 +
    },
1915 +
  },
1916 +
  aliases: ["Expression", "Pureish", "Literal", "Immutable"],
1917 +
});
1918 +
1919 +
defineType("ExportNamespaceSpecifier", {
1920 +
  visitor: ["exported"],
1921 +
  aliases: ["ModuleSpecifier"],
1922 +
  fields: {
1923 +
    exported: {
1924 +
      validate: assertNodeType("Identifier"),
1925 +
    },
1926 +
  },
1927 +
});
1928 +
1929 +
defineType("OptionalMemberExpression", {
1930 +
  builder: ["object", "property", "computed", "optional"],
1931 +
  visitor: ["object", "property"],
1932 +
  aliases: ["Expression"],
1933 +
  fields: {
1934 +
    object: {
1935 +
      validate: assertNodeType("Expression"),
1936 +
    },
1937 +
    property: {
1938 +
      validate: (function () {
1939 +
        const normal = assertNodeType("Identifier");
1940 +
        const computed = assertNodeType("Expression");
1941 +
1942 +
        const validator = function (node, key, val) {
1943 +
          const validator = node.computed ? computed : normal;
1944 +
          validator(node, key, val);
1945 +
        };
1946 +
        // todo(ts): can be discriminated union by `computed` property
1947 +
        validator.oneOfNodeTypes = ["Expression", "Identifier"];
1948 +
        return validator;
1949 +
      })(),
1950 +
    },
1951 +
    computed: {
1952 +
      default: false,
1953 +
    },
1954 +
    optional: {
1955 +
      validate: !process.env.BABEL_TYPES_8_BREAKING
1956 +
        ? assertValueType("boolean")
1957 +
        : chain(assertValueType("boolean"), assertOptionalChainStart()),
1958 +
    },
1959 +
  },
1960 +
});
1961 +
1962 +
defineType("OptionalCallExpression", {
1963 +
  visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
1964 +
  builder: ["callee", "arguments", "optional"],
1965 +
  aliases: ["Expression"],
1966 +
  fields: {
1967 +
    callee: {
1968 +
      validate: assertNodeType("Expression"),
1969 +
    },
1970 +
    arguments: {
1971 +
      validate: chain(
1972 +
        assertValueType("array"),
1973 +
        assertEach(
1974 +
          assertNodeType("Expression", "SpreadElement", "JSXNamespacedName"),
1975 +
        ),
1976 +
      ),
1977 +
    },
1978 +
    optional: {
1979 +
      validate: !process.env.BABEL_TYPES_8_BREAKING
1980 +
        ? assertValueType("boolean")
1981 +
        : chain(assertValueType("boolean"), assertOptionalChainStart()),
1982 +
    },
1983 +
    typeArguments: {
1984 +
      validate: assertNodeType("TypeParameterInstantiation"),
1985 +
      optional: true,
1986 +
    },
1987 +
    typeParameters: {
1988 +
      validate: assertNodeType("TSTypeParameterInstantiation"),
1989 +
      optional: true,
1990 +
    },
1991 +
  },
1992 +
});

@@ -1,7 +1,6 @@
Loading
1 1
// @flow
2 2
import toFastProperties from "to-fast-properties";
3 3
import "./core";
4 -
import "./es2015";
5 4
import "./flow";
6 5
import "./jsx";
7 6
import "./misc";

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
codemods 92.59%
eslint 93.49%
packages 88.19%
Project Totals (435 files) 88.33%
Loading