babel / babel

Compare 8936501 ... +0 ... 36a5ac4

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

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.


@@ -26,7 +26,9 @@
Loading
26 26
  unaryExpression,
27 27
} from "@babel/types";
28 28
import type * as t from "@babel/types";
29 +
import environmentVisitor from "@babel/helper-environment-visitor";
29 30
import nameFunction from "@babel/helper-function-name";
31 +
import { merge as mergeVisitors } from "../visitors";
30 32
import type NodePath from "./index";
31 33
32 34
export function toComputedKey(this: NodePath) {
@@ -190,6 +192,18 @@
Loading
190 192
  }
191 193
}
192 194
195 +
const getSuperCallsVisitor = mergeVisitors<{
196 +
  allSuperCalls: NodePath<t.CallExpression>[];
197 +
}>([
198 +
  {
199 +
    CallExpression(child, { allSuperCalls }) {
200 +
      if (!child.get("callee").isSuper()) return;
201 +
      allSuperCalls.push(child);
202 +
    },
203 +
  },
204 +
  environmentVisitor,
205 +
]);
206 +
193 207
/**
194 208
 * Given a function, traverse its contents, and if there are references to "this", "arguments", "super",
195 209
 * or "new.target", ensure that these references reference the parent environment around this function.
@@ -252,20 +266,8 @@
Loading
252 266
        "Unable to handle nested super() usage in arrow",
253 267
      );
254 268
    }
255 -
    const allSuperCalls = [];
256 -
    thisEnvFn.traverse({
257 -
      Function(child) {
258 -
        if (child.isArrowFunctionExpression()) return;
259 -
        child.skip();
260 -
      },
261 -
      ClassProperty(child) {
262 -
        child.skip();
263 -
      },
264 -
      CallExpression(child) {
265 -
        if (!child.get("callee").isSuper()) return;
266 -
        allSuperCalls.push(child);
267 -
      },
268 -
    });
269 +
    const allSuperCalls: NodePath<t.CallExpression>[] = [];
270 +
    thisEnvFn.traverse(getSuperCallsVisitor, { allSuperCalls });
269 271
    const superBinding = getSuperBinding(thisEnvFn);
270 272
    allSuperCalls.forEach(superCall => {
271 273
      const callee = identifier(superBinding);
@@ -508,34 +510,33 @@
Loading
508 510
  );
509 511
}
510 512
513 +
const assignSuperThisVisitor = mergeVisitors<{
514 +
  supers: WeakSet<t.CallExpression>;
515 +
  thisBinding: string;
516 +
}>([
517 +
  {
518 +
    CallExpression(child, { supers, thisBinding }) {
519 +
      if (!child.get("callee").isSuper()) return;
520 +
      if (supers.has(child.node)) return;
521 +
      supers.add(child.node);
522 +
523 +
      child.replaceWithMultiple([
524 +
        child.node,
525 +
        assignmentExpression("=", identifier(thisBinding), identifier("this")),
526 +
      ]);
527 +
    },
528 +
  },
529 +
  environmentVisitor,
530 +
]);
531 +
511 532
// Create a binding that evaluates to the "this" of the given function.
512 533
function getThisBinding(thisEnvFn, inConstructor) {
513 534
  return getBinding(thisEnvFn, "this", thisBinding => {
514 535
    if (!inConstructor || !hasSuperClass(thisEnvFn)) return thisExpression();
515 536
516 -
    const supers = new WeakSet();
517 -
    thisEnvFn.traverse({
518 -
      Function(child) {
519 -
        if (child.isArrowFunctionExpression()) return;
520 -
        child.skip();
521 -
      },
522 -
      ClassProperty(child) {
523 -
        child.skip();
524 -
      },
525 -
      CallExpression(child) {
526 -
        if (!child.get("callee").isSuper()) return;
527 -
        if (supers.has(child.node)) return;
528 -
        supers.add(child.node);
529 -
530 -
        child.replaceWithMultiple([
531 -
          child.node,
532 -
          assignmentExpression(
533 -
            "=",
534 -
            identifier(thisBinding),
535 -
            identifier("this"),
536 -
          ),
537 -
        ]);
538 -
      },
537 +
    thisEnvFn.traverse(assignSuperThisVisitor, {
538 +
      supers: new WeakSet(),
539 +
      thisBinding,
539 540
    });
540 541
  });
541 542
}
@@ -601,25 +602,18 @@
Loading
601 602
  return data;
602 603
}
603 604
604 -
function getScopeInformation(fnPath) {
605 -
  const thisPaths = [];
606 -
  const argumentsPaths = [];
607 -
  const newTargetPaths = [];
608 -
  const superProps = [];
609 -
  const superCalls = [];
610 -
611 -
  fnPath.traverse({
612 -
    ClassProperty(child) {
613 -
      child.skip();
614 -
    },
615 -
    Function(child) {
616 -
      if (child.isArrowFunctionExpression()) return;
617 -
      child.skip();
618 -
    },
619 -
    ThisExpression(child) {
605 +
const getScopeInformationVisitor = mergeVisitors<{
606 +
  thisPaths: NodePath<t.ThisExpression | t.JSXIdentifier>[];
607 +
  superCalls: NodePath<t.CallExpression>[];
608 +
  superProps: NodePath<t.MemberExpression>[];
609 +
  argumentsPaths: NodePath<t.Identifier | t.JSXIdentifier>[];
610 +
  newTargetPaths: NodePath<t.MetaProperty>[];
611 +
}>([
612 +
  {
613 +
    ThisExpression(child, { thisPaths }) {
620 614
      thisPaths.push(child);
621 615
    },
622 -
    JSXIdentifier(child) {
616 +
    JSXIdentifier(child, { thisPaths }) {
623 617
      if (child.node.name !== "this") return;
624 618
      if (
625 619
        !child.parentPath.isJSXMemberExpression({ object: child.node }) &&
@@ -630,14 +624,14 @@
Loading
630 624
631 625
      thisPaths.push(child);
632 626
    },
633 -
    CallExpression(child) {
627 +
    CallExpression(child, { superCalls }) {
634 628
      if (child.get("callee").isSuper()) superCalls.push(child);
635 629
    },
636 -
    MemberExpression(child) {
630 +
    MemberExpression(child, { superProps }) {
637 631
      if (child.get("object").isSuper()) superProps.push(child);
638 632
    },
639 -
    ReferencedIdentifier(child) {
640 -
      if (child.node.name !== "arguments") return;
633 +
    Identifier(child, { argumentsPaths }) {
634 +
      if (!child.isReferencedIdentifier({ name: "arguments" })) return;
641 635
642 636
      let curr = child.scope;
643 637
      do {
@@ -652,12 +646,29 @@
Loading
652 646
653 647
      argumentsPaths.push(child);
654 648
    },
655 -
    MetaProperty(child) {
649 +
    MetaProperty(child, { newTargetPaths }) {
656 650
      if (!child.get("meta").isIdentifier({ name: "new" })) return;
657 651
      if (!child.get("property").isIdentifier({ name: "target" })) return;
658 652
659 653
      newTargetPaths.push(child);
660 654
    },
655 +
  },
656 +
  environmentVisitor,
657 +
]);
658 +
659 +
function getScopeInformation(fnPath) {
660 +
  const thisPaths = [];
661 +
  const argumentsPaths = [];
662 +
  const newTargetPaths = [];
663 +
  const superProps = [];
664 +
  const superCalls = [];
665 +
666 +
  fnPath.traverse(getScopeInformationVisitor, {
667 +
    thisPaths,
668 +
    argumentsPaths,
669 +
    newTargetPaths,
670 +
    superProps,
671 +
    superCalls,
661 672
  });
662 673
663 674
  return {

@@ -1,5 +1,6 @@
Loading
1 1
import * as virtualTypes from "./path/lib/virtual-types";
2 2
import { DEPRECATED_KEYS, FLIPPED_ALIAS_KEYS, TYPES } from "@babel/types";
3 +
import type { Visitor } from "./types";
3 4
4 5
/**
5 6
 * explode() will take a visitor object with all of the various shorthands
@@ -175,6 +176,12 @@
Loading
175 176
  }
176 177
}
177 178
179 +
export function merge<State>(visitors: Visitor<State>[]): Visitor<State>;
180 +
export function merge(
181 +
  visitors: Visitor<unknown>[],
182 +
  states?: any[],
183 +
  wrapper?: Function | null,
184 +
): Visitor<unknown>;
178 185
export function merge(
179 186
  visitors: any[],
180 187
  states: any[] = [],

@@ -538,7 +538,7 @@
Loading
538 538
  handle(
539 539
    this: HandlerState<State> & State,
540 540
    member: Member,
541 -
    noDocumentAll: boolean,
541 +
    noDocumentAll?: boolean,
542 542
  ): void;
543 543
  memoiser: AssignmentMemoiser;
544 544
}

@@ -1,4 +1,4 @@
Loading
1 -
import { environmentVisitor } from "@babel/helper-replace-supers";
1 +
import environmentVisitor from "@babel/helper-environment-visitor";
2 2
import traverse from "@babel/traverse";
3 3
import { numericLiteral, unaryExpression } from "@babel/types";
4 4
import type * as t from "@babel/types";

@@ -0,0 +1,38 @@
Loading
1 +
import type { NodePath } from "@babel/traverse";
2 +
import { VISITOR_KEYS, staticBlock } from "@babel/types";
3 +
import type * as t from "@babel/types";
4 +
5 +
// TODO (Babel 8): Don't export this function.
6 +
export function skipAllButComputedKey(
7 +
  path: NodePath<t.Method | t.ClassProperty>,
8 +
) {
9 +
  // If the path isn't computed, just skip everything.
10 +
  if (!path.node.computed) {
11 +
    path.skip();
12 +
    return;
13 +
  }
14 +
15 +
  // So it's got a computed key. Make sure to skip every other key the
16 +
  // traversal would visit.
17 +
  const keys = VISITOR_KEYS[path.type];
18 +
  for (const key of keys) {
19 +
    if (key !== "key") path.skipKey(key);
20 +
  }
21 +
}
22 +
23 +
// Methods are handled by the Method visitor; arrows are not skipped because they inherit the context.
24 +
const skipKey = process.env.BABEL_8_BREAKING
25 +
  ? "StaticBlock|ClassPrivateProperty|TypeAnnotation|FunctionDeclaration|FunctionExpression"
26 +
  : (staticBlock ? "StaticBlock|" : "") +
27 +
    "ClassPrivateProperty|TypeAnnotation|FunctionDeclaration|FunctionExpression";
28 +
29 +
// environmentVisitor should be used when traversing the whole class and not for specific class elements/methods.
30 +
// For perf reasons, the environmentVisitor might be traversed with `{ noScope: true }`, which means `path.scope` is undefined.
31 +
// Avoid using `path.scope` here
32 +
export default {
33 +
  [skipKey]: path => path.skip(),
34 +
35 +
  "Method|ClassProperty"(path: NodePath<t.Method | t.ClassProperty>) {
36 +
    skipAllButComputedKey(path);
37 +
  },
38 +
};

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 1 files with coverage changes found.

New file packages/babel-helper-environment-visitor/src/index.ts
New
Loading file...
Files Coverage
codemods 100.00%
eslint 94.95%
packages 0.01% 90.89%
Project Totals (462 files) 91.02%
Loading