Use full import specifier path in tests (#13938)

This commit is contained in:
Nicolò Ribaudo 2021-11-24 11:43:18 +01:00 committed by GitHub
parent a470f7b479
commit 75996cb62b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
107 changed files with 141 additions and 136 deletions

View File

@ -67,7 +67,10 @@ module.exports = {
"jest/no-standalone-expect": "off",
"jest/no-test-callback": "off",
"jest/valid-describe": "off",
"import/extensions": ["error", { json: "always", cjs: "always" }],
"import/extensions": [
"error",
{ json: "always", js: "always", cjs: "always", mjs: "always" },
],
},
},
{

View File

@ -1,6 +1,6 @@
import path from "path";
import rule from "../../src/rules/dry-error-messages";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/dry-error-messages.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
import { fileURLToPath } from "url";
const dirname = path.dirname(fileURLToPath(import.meta.url));

View File

@ -1,5 +1,5 @@
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../src/rules/report-error-message-format";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
import rule from "../../lib/rules/report-error-message-format.js";
const ruleTester = new RuleTester();

View File

@ -1,5 +1,5 @@
import rule from "../../src/rules/no-deprecated-clone";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/no-deprecated-clone.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
const cloneError = "t.clone() is deprecated. Use t.cloneNode() instead.";
const cloneDeepError =

View File

@ -1,5 +1,5 @@
import rule from "../../src/rules/no-undefined-identifier";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/no-undefined-identifier.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
const error =
"Use path.scope.buildUndefinedNode() to create an undefined identifier directly.";

View File

@ -1,5 +1,5 @@
import rule from "../../src/rules/plugin-name";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/plugin-name.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
const missingPluginError = "This file does not export a Babel plugin.";
const missingNameError = "This Babel plugin doesn't have a 'name' property.";

View File

@ -1,5 +1,5 @@
import rule from "../../src/rules/new-cap";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/new-cap.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
const ruleTester = new RuleTester();
ruleTester.run("@babel/new-cap", rule, {

View File

@ -1,6 +1,6 @@
import cloneDeep from "clone-deep";
import rule from "../../src/rules/no-invalid-this";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/no-invalid-this.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
/**
* A constant value for non strict mode environment.

View File

@ -1,5 +1,5 @@
import rule from "../../src/rules/no-unused-expressions";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/no-unused-expressions.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
const ruleTester = new RuleTester();
ruleTester.run("@babel/no-unused-expressions", rule, {

View File

@ -1,5 +1,5 @@
import rule from "../../src/rules/object-curly-spacing";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/object-curly-spacing.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
const ruleTester = new RuleTester();
ruleTester.run("@babel/object-curly-spacing", rule, {

View File

@ -1,5 +1,5 @@
import rule from "../../src/rules/semi";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester";
import rule from "../../lib/rules/semi.js";
import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester.js";
const ruleTester = new RuleTester();

View File

@ -1,4 +1,4 @@
import verifyAndAssertMessages from "../../helpers/verifyAndAssertMessages";
import verifyAndAssertMessages from "../../helpers/verifyAndAssertMessages.js";
import path from "path";
import { fileURLToPath } from "url";

View File

@ -7,7 +7,7 @@ import fs from "fs";
import { fileURLToPath } from "url";
import { createRequire } from "module";
import { chmod } from "../lib/babel/util";
import { chmod } from "../lib/babel/util.js";
const require = createRequire(import.meta.url);

View File

@ -1,6 +1,6 @@
import chalk from "chalk";
import stripAnsi from "strip-ansi";
import codeFrame, { codeFrameColumns } from "..";
import codeFrame, { codeFrameColumns } from "../lib/index.js";
describe("@babel/code-frame", function () {
test("basic usage", function () {

View File

@ -1,13 +1,13 @@
import * as babel from "../lib/index";
import * as babel from "../lib/index.js";
import sourceMap from "source-map";
import path from "path";
import Plugin from "../lib/config/plugin";
import Plugin from "../lib/config/plugin.js";
import generator from "@babel/generator";
import { fileURLToPath } from "url";
import presetEnv from "../../babel-preset-env";
import pluginSyntaxFlow from "../../babel-plugin-syntax-flow";
import pluginFlowStripTypes from "../../babel-plugin-transform-flow-strip-types";
import presetEnv from "../../babel-preset-env/lib/index.js";
import pluginSyntaxFlow from "../../babel-plugin-syntax-flow/lib/index.js";
import pluginFlowStripTypes from "../../babel-plugin-transform-flow-strip-types/lib/index.js";
const cwd = path.dirname(fileURLToPath(import.meta.url));

View File

@ -1,6 +1,6 @@
import path from "path";
import { fileURLToPath } from "url";
import { loadOptions as loadOptionsOrig, transformSync } from "../lib";
import { loadOptions as loadOptionsOrig, transformSync } from "../lib/index.js";
import pluginCommonJS from "@babel/plugin-transform-modules-commonjs";
const cwd = path.dirname(fileURLToPath(import.meta.url));

View File

@ -1,12 +1,12 @@
import path from "path";
import { fileURLToPath } from "url";
import * as babel from "..";
import * as babel from "../lib/index.js";
import {
spawnTransformAsync,
spawnTransformSync,
supportsESM,
} from "./helpers/esm";
} from "./helpers/esm.js";
const nodeGte8 = (...args) => {
// "minNodeVersion": "8.0.0" <-- For Ctrl+F when dropping node 6

View File

@ -1,6 +1,6 @@
import gensync from "gensync";
import { makeStrongCacheSync, makeStrongCache } from "../lib/config/caching";
import { waitFor } from "../lib/gensync-utils/async";
import { makeStrongCacheSync, makeStrongCache } from "../lib/config/caching.js";
import { waitFor } from "../lib/gensync-utils/async.js";
describe("caching API", () => {
it("should allow permacaching with .forever()", () => {

View File

@ -2,12 +2,12 @@ import fs from "fs";
import os from "os";
import path from "path";
import { fileURLToPath } from "url";
import * as babel from "../lib";
import * as babel from "../lib/index.js";
import getTargets from "@babel/helper-compilation-targets";
const dirname = path.dirname(fileURLToPath(import.meta.url));
import { isMJS, loadOptionsAsync, skipUnsupportedESM } from "./helpers/esm";
import { isMJS, loadOptionsAsync, skipUnsupportedESM } from "./helpers/esm.js";
// TODO: In Babel 8, we can directly uses fs.promises which is supported by
// node 8+

View File

@ -1,7 +1,7 @@
import loadConfigRunner, {
loadPartialConfig,
createConfigItem,
} from "../lib/config";
} from "../lib/config/index.js";
import path from "path";
import { fileURLToPath } from "url";
import { createRequire } from "module";
@ -38,10 +38,10 @@ describe("@babel/core config loading", () => {
filename: FILEPATH,
presets: skipProgrammatic
? null
: [[require("./fixtures/config-loading/preset3"), {}]],
: [[require("./fixtures/config-loading/preset3.js"), {}]],
plugins: skipProgrammatic
? null
: [[require("./fixtures/config-loading/plugin6"), {}]],
: [[require("./fixtures/config-loading/plugin6.js"), {}]],
};
}

View File

@ -4,7 +4,7 @@ import path from "path";
import { fileURLToPath } from "url";
import { createRequire } from "module";
import * as babel from "../../lib";
import * as babel from "../../lib/index.js";
const require = createRequire(import.meta.url);
const dirname = path.dirname(fileURLToPath(import.meta.url));

View File

@ -1,4 +1,4 @@
import { loadOptions as loadOptionsOrig } from "../lib";
import { loadOptions as loadOptionsOrig } from "../lib/index.js";
import path from "path";
import { fileURLToPath } from "url";

View File

@ -1,6 +1,6 @@
import fs from "fs";
import path from "path";
import { parse } from "../lib";
import { parse } from "../lib/index.js";
import { fileURLToPath } from "url";
import { createRequire } from "module";

View File

@ -1,5 +1,5 @@
import { transform } from "../lib/index";
import Plugin from "../lib/config/plugin";
import { transform } from "../lib/index.js";
import Plugin from "../lib/config/plugin.js";
import { fileURLToPath } from "url";
import path from "path";

View File

@ -1,4 +1,4 @@
import * as babel from "../lib/index";
import * as babel from "../lib/index.js";
import path from "path";
import { fileURLToPath } from "url";

View File

@ -1,4 +1,4 @@
import { loadOptions as loadOptionsOrig } from "../lib";
import { loadOptions as loadOptionsOrig } from "../lib/index.js";
import { join, dirname } from "path";
import { fileURLToPath } from "url";

View File

@ -1,4 +1,4 @@
import generate from "../lib";
import generate from "../lib/index.js";
import { parse } from "@babel/parser";
describe("parameter parentheses", () => {

View File

@ -1,5 +1,5 @@
import Printer from "../lib/printer";
import generate, { CodeGenerator } from "../lib";
import Printer from "../lib/printer.js";
import generate, { CodeGenerator } from "../lib/index.js";
import { parse } from "@babel/parser";
import * as t from "@babel/types";
import fs from "fs";

View File

@ -1,4 +1,4 @@
import annotateAsPure from "../";
import annotateAsPure from "../lib/index.js";
describe("@babel/helper-annotate-as-pure", () => {
it("will add leading comment", () => {

View File

@ -1,6 +1,6 @@
import { dirname, resolve } from "path";
import { fileURLToPath } from "url";
import getTargets from "../../lib";
import getTargets from "../../lib/index.js";
const currentDir = dirname(fileURLToPath(import.meta.url));

View File

@ -1,4 +1,4 @@
import getTargets from "../..";
import getTargets from "../../lib/index.js";
import { fileURLToPath } from "url";
import path from "path";

View File

@ -1,4 +1,4 @@
import getTargets from "../..";
import getTargets from "../../lib/index.js";
import { fileURLToPath } from "url";
import path from "path";

View File

@ -1,4 +1,4 @@
import getTargets from "../..";
import getTargets from "../../lib/index.js";
import { fileURLToPath } from "url";
import path from "path";

View File

@ -1,4 +1,4 @@
import { prettifyTargets, prettifyVersion } from "../lib/pretty";
import { prettifyTargets, prettifyVersion } from "../lib/pretty.js";
describe("pretty", () => {
describe("prettifyVersion", () => {

View File

@ -1,7 +1,7 @@
import browserslist from "browserslist";
import { join, dirname } from "path";
import { fileURLToPath } from "url";
import getTargets from "..";
import getTargets from "../lib/index.js";
describe("getTargets", () => {
it("parses", () => {

View File

@ -1,4 +1,4 @@
import { targetsSupported } from "../lib/filter-items";
import { targetsSupported } from "../lib/filter-items.js";
describe("targetsSupported", () => {
const MAX_VERSION = `${Number.MAX_SAFE_INTEGER}.0.0`;

View File

@ -1,4 +1,4 @@
import { semverify } from "../lib/utils";
import { semverify } from "../lib/utils.js";
describe("utils", () => {
describe("semverify", () => {

View File

@ -2,7 +2,7 @@ import * as babel from "@babel/core";
import { fileURLToPath } from "url";
import path from "path";
import { ImportInjector } from "../";
import { ImportInjector } from "../lib/index.js";
const cwd = path.dirname(fileURLToPath(import.meta.url));

View File

@ -1,7 +1,7 @@
import { parse } from "@babel/parser";
import generator from "@babel/generator";
import * as t from "@babel/types";
import optimizeCallExpression from "..";
import optimizeCallExpression from "../lib/index.js";
function transformInput(input, thisIdentifier) {
const ast = parse(input);

View File

@ -1,4 +1,4 @@
import { runCodeInTestContext } from "..";
import { runCodeInTestContext } from "../lib/index.js";
import { fileURLToPath } from "url";
const filename = fileURLToPath(import.meta.url);

View File

@ -1,4 +1,4 @@
import { isIdentifierName } from "..";
import { isIdentifierName } from "../lib/index.js";
describe("isIdentifierName", function () {
it("returns false if provided string is empty", function () {

View File

@ -1,4 +1,4 @@
import { findSuggestion } from "..";
import { findSuggestion } from "../lib/index.js";
describe("findSuggestion", function () {
test.each([

View File

@ -1,4 +1,4 @@
import { OptionValidator } from "..";
import { OptionValidator } from "../lib/index.js";
describe("OptionValidator", () => {
describe("validateTopLevelOptions", () => {

View File

@ -1,6 +1,6 @@
import path from "path";
import template from "@babel/template";
import helpers from "../../lib/helpers";
import helpers from "../../lib/helpers.js";
function getHelperId(dir, name) {
const testName = path.basename(dir);

View File

@ -1,6 +1,6 @@
import chalk from "chalk";
import stripAnsi from "strip-ansi";
import highlight, { shouldHighlight, getChalk } from "..";
import highlight, { shouldHighlight, getChalk } from "../lib/index.js";
describe("@babel/highlight", function () {
function stubColorSupport(supported) {

View File

@ -1,6 +1,6 @@
import path from "path";
import { runFixtureTestsWithoutExactASTMatch } from "./helpers/runFixtureTests";
import { parseExpression } from "../lib";
import { runFixtureTestsWithoutExactASTMatch } from "./helpers/runFixtureTests.js";
import { parseExpression } from "../lib/index.js";
import { fileURLToPath } from "url";
runFixtureTestsWithoutExactASTMatch(

View File

@ -1,4 +1,4 @@
import { parse } from "../lib";
import { parse } from "../lib/index.js";
describe("error codes", function () {
it("raises an error with BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED and reasonCode", function () {

View File

@ -1,6 +1,6 @@
import path from "path";
import { runFixtureTestsWithoutExactASTMatch } from "./helpers/runFixtureTests";
import { parse } from "../lib";
import { runFixtureTestsWithoutExactASTMatch } from "./helpers/runFixtureTests.js";
import { parse } from "../lib/index.js";
import { fileURLToPath } from "url";
runFixtureTestsWithoutExactASTMatch(

View File

@ -1,6 +1,6 @@
import path from "path";
import { runFixtureTests } from "./helpers/runFixtureTests";
import { parseExpression } from "../lib";
import { runFixtureTests } from "./helpers/runFixtureTests.js";
import { parseExpression } from "../lib/index.js";
import { fileURLToPath } from "url";
const fixtures = path.join(

View File

@ -1,6 +1,6 @@
import path from "path";
import { runFixtureTests } from "./helpers/runFixtureTests";
import { parse } from "../lib";
import { runFixtureTests } from "./helpers/runFixtureTests.js";
import { parse } from "../lib/index.js";
import { fileURLToPath } from "url";
const fixtures = path.join(

View File

@ -1,4 +1,4 @@
import { parse } from "../lib";
import { parse } from "../lib/index.js";
describe("options", () => {
describe("strictMode", () => {

View File

@ -1,4 +1,4 @@
import { parse } from "../lib";
import { parse } from "../lib/index.js";
function getParser(code, plugins) {
return () => parse(code, { plugins, sourceType: "module" });

View File

@ -1,4 +1,4 @@
import { tt, tokenOperatorPrecedence } from "../../../src/tokenizer/types";
import { tt, tokenOperatorPrecedence } from "../../../src/tokenizer/types.js";
describe("token types", () => {
it("should check if the binOp for relational === in", () => {

View File

@ -1,7 +1,7 @@
import {
isKeyword,
keywordRelationalOperator,
} from "../../../src/util/identifier";
} from "../../../src/util/identifier.js";
describe("identifier", () => {
describe("isKeyword", () => {

View File

@ -1,4 +1,4 @@
import { getLineInfo } from "../../../src/util/location";
import { getLineInfo } from "../../../src/util/location.js";
describe("getLineInfo", () => {
const input = "a\nb\nc\nd\ne\nf\ng\nh\ni";

View File

@ -1,5 +1,5 @@
import * as babel from "@babel/core";
import proposalClassStaticBlock from "..";
import proposalClassStaticBlock from "../lib/index.js";
describe("plugin ordering", () => {
it("should work when @babel/plugin-proposal-class-static-block is after class features plugin", () => {

View File

@ -1,5 +1,5 @@
import { parse } from "@babel/parser";
import shouldStoreRHSInTemporaryVariable from "../lib/shouldStoreRHSInTemporaryVariable";
import shouldStoreRHSInTemporaryVariable from "../lib/shouldStoreRHSInTemporaryVariable.js";
function getFistObjectPattern(program) {
return parse(program, { sourceType: "module" }).program.body[0]

View File

@ -1,4 +1,4 @@
import { willPathCastToBoolean } from "../src/util";
import { willPathCastToBoolean } from "../src/util.js";
import { parseSync, traverse } from "@babel/core";
function getPath(input, parserOpts) {

View File

@ -1,5 +1,5 @@
import { parse } from "@babel/core";
import syntaxDecorators from "../lib";
import syntaxDecorators from "../lib/index.js";
function makeParser(code, options) {
return () =>

View File

@ -1,5 +1,5 @@
import * as babel from "@babel/core";
import transformAmd from "../lib";
import transformAmd from "../lib/index.js";
import externalHelpers from "@babel/plugin-external-helpers";
it("'importInterop' accepts a function", function () {

View File

@ -2,7 +2,7 @@ import * as babel from "@babel/core";
import { fileURLToPath } from "url";
import path from "path";
import transformCommonJS from "..";
import transformCommonJS from "../lib/index.js";
test("Doesn't use the same object for two different nodes in the AST", function () {
const code = 'import Foo from "bar"; Foo; Foo;';

View File

@ -3,7 +3,7 @@ import vm from "vm";
import { fileURLToPath } from "url";
import path from "path";
import transformCommonJS from "..";
import transformCommonJS from "../lib/index.js";
test("Re-export doesn't overwrite __esModule flag", function () {
let code = 'export * from "./dep";';

View File

@ -1,5 +1,5 @@
import * as babel from "@babel/core";
import transformCommonjs from "../lib";
import transformCommonjs from "../lib/index.js";
import externalHelpers from "@babel/plugin-external-helpers";
it("'importInterop' accepts a function", function () {

View File

@ -1,5 +1,5 @@
import * as babel from "@babel/core";
import transformUmd from "../lib";
import transformUmd from "../lib/index.js";
import externalHelpers from "@babel/plugin-external-helpers";
it("'importInterop' accepts a function", function () {

View File

@ -3,6 +3,7 @@ import { createRequire } from "module";
const require = createRequire(import.meta.url);
it("module.exports.default is correctly updated", () => {
// eslint-disable-next-line import/extensions
const typeofHelper = require("@babel/runtime/helpers/typeof");
expect(typeof typeofHelper).toBe("function");

View File

@ -2,7 +2,7 @@ import * as babel from "@babel/core";
import fs from "fs";
import { createRequire } from "module";
import transformTypeofSymbol from "..";
import transformTypeofSymbol from "../lib/index.js";
const require = createRequire(import.meta.url);

View File

@ -1,4 +1,4 @@
import getOptionSpecificExcludesFor from "../lib/get-option-specific-excludes";
import getOptionSpecificExcludesFor from "../lib/get-option-specific-excludes.js";
describe("defaults", () => {
describe("getOptionSpecificExcludesFor", () => {

View File

@ -1,10 +1,11 @@
// eslint-disable-next-line import/extensions
import compatData from "@babel/compat-data/plugins";
import * as babelPresetEnv from "../lib/index";
import removeRegeneratorEntryPlugin from "../lib/polyfills/regenerator";
import pluginLegacyBabelPolyfill from "../lib/polyfills/babel-polyfill";
import transformations from "../lib/module-transformations";
import availablePlugins from "../lib/available-plugins";
import * as babelPresetEnv from "../lib/index.js";
import removeRegeneratorEntryPlugin from "../lib/polyfills/regenerator.js";
import pluginLegacyBabelPolyfill from "../lib/polyfills/babel-polyfill.js";
import transformations from "../lib/module-transformations.js";
import availablePlugins from "../lib/available-plugins.js";
import _pluginCoreJS2 from "babel-plugin-polyfill-corejs2";
import _pluginCoreJS3 from "babel-plugin-polyfill-corejs3";

View File

@ -3,7 +3,7 @@ import normalizeOptions, {
validateModulesOption,
validateUseBuiltInsOption,
normalizePluginName,
} from "../lib/normalize-options";
} from "../lib/normalize-options.js";
describe("normalize-options", () => {
describe("normalizeOptions", () => {

View File

@ -1,5 +1,5 @@
import * as babel7_12 from "@babel/core";
import env from "..";
import env from "../lib/index.js";
import path from "path";
import { fileURLToPath } from "url";

View File

@ -1,4 +1,4 @@
import env from "..";
import env from "../lib/index.js";
import * as babel from "@babel/core";
describe("supportsTopLevelAwait enables the parser plugin for old parser versions", () => {

View File

@ -1,4 +1,4 @@
import normalizeOptions from "../src/normalize-options";
import normalizeOptions from "../lib/normalize-options.js";
describe("normalize options", () => {
(process.env.BABEL_8_BREAKING ? describe : describe.skip)("Babel 8", () => {
it("should throw on unknown options", () => {

View File

@ -1,4 +1,4 @@
import react from "../lib";
import react from "../lib/index.js";
describe("react preset", () => {
it("does throw clear error when no options passed for Babel 6", () => {

View File

@ -1,4 +1,4 @@
import normalizeOptions from "../src/normalize-options";
import normalizeOptions from "../src/normalize-options.js";
describe("normalize options", () => {
(process.env.BABEL_8_BREAKING ? describe : describe.skip)("Babel 8", () => {
it("should throw on unknown options", () => {

View File

@ -1,4 +1,4 @@
import normalizeOptions from "../src/normalize-options";
import normalizeOptions from "../src/normalize-options.js";
describe("normalize options", () => {
(process.env.BABEL_8_BREAKING ? describe : describe.skip)("Babel 8", () => {
it("should throw on unknown options", () => {

View File

@ -40,7 +40,7 @@ describe("@babel/register - caching", () => {
beforeEach(() => {
// Since lib/cache is a singleton we need to fully reload it
jest.resetModules();
const cache = require("../lib/cache");
const cache = require("../lib/cache.js");
load = cache.load;
get = cache.get;

View File

@ -7,7 +7,7 @@ const require = createRequire(import.meta.url);
() => {
let Babel;
beforeAll(() => {
Babel = require("../babel");
Babel = require("../babel.js");
});
it("handles the es2015-no-commonjs preset", () => {

View File

@ -6,7 +6,7 @@ const require = createRequire(import.meta.url);
() => {
let Babel;
beforeAll(() => {
Babel = require("../babel");
Babel = require("../babel.js");
});
it("should parser decimal literal", () => {

View File

@ -1,5 +1,5 @@
import generator from "../../babel-generator";
import template from "../lib";
import generator from "../../babel-generator/lib/index.js";
import template from "../lib/index.js";
import * as t from "@babel/types";
const comments = "// Sum two numbers\nconst add = (a, b) => a + b;";

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
describe("path/ancestry", function () {

View File

@ -1,4 +1,4 @@
import { NodePath } from "../lib";
import { NodePath } from "../lib/index.js";
import { parse } from "@babel/parser";
import generate from "@babel/generator";
import * as t from "@babel/types";

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
import generate from "@babel/generator";
import * as t from "@babel/types";

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
function getPath(code) {

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
import * as t from "@babel/types";

View File

@ -1,5 +1,5 @@
import assert from "assert";
import { Hub } from "../lib";
import { Hub } from "../lib/index.js";
describe("hub", function () {
it("default buildError should return TypeError", function () {

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
import * as t from "@babel/types";

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
function getPath(code, options = { sourceType: "script" }) {

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
import generate from "@babel/generator";
import * as t from "@babel/types";

View File

@ -1,4 +1,4 @@
import { NodePath } from "../../lib";
import { NodePath } from "../../lib/index.js";
describe("NodePath", () => {
describe("setData/getData", () => {

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
import generate from "@babel/generator";

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
import generate from "@babel/generator";
import * as t from "@babel/types";

View File

@ -1,4 +1,4 @@
import traverse, { NodePath } from "../lib";
import traverse, { NodePath } from "../lib/index.js";
import { parse } from "@babel/parser";
import * as t from "@babel/types";

View File

@ -1,4 +1,4 @@
import traverse from "../lib";
import traverse from "../lib/index.js";
import { parse } from "@babel/parser";
import * as t from "@babel/types";

View File

@ -1,4 +1,4 @@
import * as t from "../lib";
import * as t from "../lib/index.js";
describe("asserts", () => {
const consoleTrace = console.trace;

View File

@ -1,4 +1,4 @@
import * as t from "../../..";
import * as t from "../../../lib/index.js";
describe("builders", function () {
describe("es2015", function () {

View File

@ -1,4 +1,4 @@
import * as t from "../../..";
import * as t from "../../../lib/index.js";
describe("builders", function () {
describe("experimental", function () {

View File

@ -1,4 +1,4 @@
import { createTypeAnnotationBasedOnTypeof } from "../../..";
import { createTypeAnnotationBasedOnTypeof } from "../../../lib/index.js";
describe("builders", function () {
describe("flow", function () {

View File

@ -1,4 +1,4 @@
import * as t from "../../..";
import * as t from "../../../lib/index.js";
describe("builders", function () {
describe("flow", function () {

View File

@ -1,4 +1,4 @@
import * as t from "../../..";
import * as t from "../../../lib/index.js";
describe("builders", function () {
describe("typescript", function () {

View File

@ -1,4 +1,4 @@
import * as t from "../../..";
import * as t from "../../../lib/index.js";
describe("builders", function () {
describe("typescript", function () {

Some files were not shown because too many files have changed in this diff Show More