summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/@babel/core/lib/config/files')
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/configuration.js357
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/import.js10
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/index-browser.js67
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/index.js79
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/module-types.js104
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/package.js76
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/plugins.js206
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/types.js0
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/utils.js44
9 files changed, 943 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/configuration.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/configuration.js
new file mode 100644
index 0000000000..3834b38163
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/configuration.js
@@ -0,0 +1,357 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ROOT_CONFIG_FILENAMES = void 0;
+exports.findConfigUpwards = findConfigUpwards;
+exports.findRelativeConfig = findRelativeConfig;
+exports.findRootConfig = findRootConfig;
+exports.loadConfig = loadConfig;
+exports.resolveShowConfigPath = resolveShowConfigPath;
+
+function _debug() {
+ const data = require("debug");
+
+ _debug = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _fs() {
+ const data = require("fs");
+
+ _fs = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _path() {
+ const data = require("path");
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _json() {
+ const data = require("json5");
+
+ _json = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _gensync() {
+ const data = require("gensync");
+
+ _gensync = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _caching = require("../caching");
+
+var _configApi = require("../helpers/config-api");
+
+var _utils = require("./utils");
+
+var _moduleTypes = require("./module-types");
+
+var _patternToRegex = require("../pattern-to-regex");
+
+var fs = require("../../gensync-utils/fs");
+
+function _module() {
+ const data = require("module");
+
+ _module = function () {
+ return data;
+ };
+
+ return data;
+}
+
+const debug = _debug()("babel:config:loading:files:configuration");
+
+const ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json"];
+exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;
+const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json"];
+const BABELIGNORE_FILENAME = ".babelignore";
+
+function findConfigUpwards(rootDir) {
+ let dirname = rootDir;
+
+ for (;;) {
+ for (const filename of ROOT_CONFIG_FILENAMES) {
+ if (_fs().existsSync(_path().join(dirname, filename))) {
+ return dirname;
+ }
+ }
+
+ const nextDir = _path().dirname(dirname);
+
+ if (dirname === nextDir) break;
+ dirname = nextDir;
+ }
+
+ return null;
+}
+
+function* findRelativeConfig(packageData, envName, caller) {
+ let config = null;
+ let ignore = null;
+
+ const dirname = _path().dirname(packageData.filepath);
+
+ for (const loc of packageData.directories) {
+ if (!config) {
+ var _packageData$pkg;
+
+ config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null);
+ }
+
+ if (!ignore) {
+ const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME);
+
+ ignore = yield* readIgnoreConfig(ignoreLoc);
+
+ if (ignore) {
+ debug("Found ignore %o from %o.", ignore.filepath, dirname);
+ }
+ }
+ }
+
+ return {
+ config,
+ ignore
+ };
+}
+
+function findRootConfig(dirname, envName, caller) {
+ return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);
+}
+
+function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) {
+ const configs = yield* _gensync().all(names.map(filename => readConfig(_path().join(dirname, filename), envName, caller)));
+ const config = configs.reduce((previousConfig, config) => {
+ if (config && previousConfig) {
+ throw new Error(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`);
+ }
+
+ return config || previousConfig;
+ }, previousConfig);
+
+ if (config) {
+ debug("Found configuration %o from %o.", config.filepath, dirname);
+ }
+
+ return config;
+}
+
+function* loadConfig(name, dirname, envName, caller) {
+ const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
+ paths: [b]
+ }, M = require("module")) => {
+ let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
+
+ if (f) return f;
+ f = new Error(`Cannot resolve module '${r}'`);
+ f.code = "MODULE_NOT_FOUND";
+ throw f;
+ })(name, {
+ paths: [dirname]
+ });
+ const conf = yield* readConfig(filepath, envName, caller);
+
+ if (!conf) {
+ throw new Error(`Config file ${filepath} contains no configuration data`);
+ }
+
+ debug("Loaded config %o from %o.", name, dirname);
+ return conf;
+}
+
+function readConfig(filepath, envName, caller) {
+ const ext = _path().extname(filepath);
+
+ return ext === ".js" || ext === ".cjs" || ext === ".mjs" ? readConfigJS(filepath, {
+ envName,
+ caller
+ }) : readConfigJSON5(filepath);
+}
+
+const LOADING_CONFIGS = new Set();
+const readConfigJS = (0, _caching.makeStrongCache)(function* readConfigJS(filepath, cache) {
+ if (!_fs().existsSync(filepath)) {
+ cache.never();
+ return null;
+ }
+
+ if (LOADING_CONFIGS.has(filepath)) {
+ cache.never();
+ debug("Auto-ignoring usage of config %o.", filepath);
+ return {
+ filepath,
+ dirname: _path().dirname(filepath),
+ options: {}
+ };
+ }
+
+ let options;
+
+ try {
+ LOADING_CONFIGS.add(filepath);
+ options = yield* (0, _moduleTypes.default)(filepath, "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously.");
+ } catch (err) {
+ err.message = `${filepath}: Error while loading config - ${err.message}`;
+ throw err;
+ } finally {
+ LOADING_CONFIGS.delete(filepath);
+ }
+
+ let assertCache = false;
+
+ if (typeof options === "function") {
+ yield* [];
+ options = options((0, _configApi.makeConfigAPI)(cache));
+ assertCache = true;
+ }
+
+ if (!options || typeof options !== "object" || Array.isArray(options)) {
+ throw new Error(`${filepath}: Configuration should be an exported JavaScript object.`);
+ }
+
+ if (typeof options.then === "function") {
+ throw new Error(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`);
+ }
+
+ if (assertCache && !cache.configured()) throwConfigError();
+ return {
+ filepath,
+ dirname: _path().dirname(filepath),
+ options
+ };
+});
+const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => {
+ const babel = file.options["babel"];
+ if (typeof babel === "undefined") return null;
+
+ if (typeof babel !== "object" || Array.isArray(babel) || babel === null) {
+ throw new Error(`${file.filepath}: .babel property must be an object`);
+ }
+
+ return {
+ filepath: file.filepath,
+ dirname: file.dirname,
+ options: babel
+ };
+});
+const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => {
+ let options;
+
+ try {
+ options = _json().parse(content);
+ } catch (err) {
+ err.message = `${filepath}: Error while parsing config - ${err.message}`;
+ throw err;
+ }
+
+ if (!options) throw new Error(`${filepath}: No config detected`);
+
+ if (typeof options !== "object") {
+ throw new Error(`${filepath}: Config returned typeof ${typeof options}`);
+ }
+
+ if (Array.isArray(options)) {
+ throw new Error(`${filepath}: Expected config object but found array`);
+ }
+
+ return {
+ filepath,
+ dirname: _path().dirname(filepath),
+ options
+ };
+});
+const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => {
+ const ignoreDir = _path().dirname(filepath);
+
+ const ignorePatterns = content.split("\n").map(line => line.replace(/#(.*?)$/, "").trim()).filter(line => !!line);
+
+ for (const pattern of ignorePatterns) {
+ if (pattern[0] === "!") {
+ throw new Error(`Negation of file paths is not supported.`);
+ }
+ }
+
+ return {
+ filepath,
+ dirname: _path().dirname(filepath),
+ ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir))
+ };
+});
+
+function* resolveShowConfigPath(dirname) {
+ const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;
+
+ if (targetPath != null) {
+ const absolutePath = _path().resolve(dirname, targetPath);
+
+ const stats = yield* fs.stat(absolutePath);
+
+ if (!stats.isFile()) {
+ throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);
+ }
+
+ return absolutePath;
+ }
+
+ return null;
+}
+
+function throwConfigError() {
+ throw new Error(`\
+Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured
+for various types of caching, using the first param of their handler functions:
+
+module.exports = function(api) {
+ // The API exposes the following:
+
+ // Cache the returned value forever and don't call this function again.
+ api.cache(true);
+
+ // Don't cache at all. Not recommended because it will be very slow.
+ api.cache(false);
+
+ // Cached based on the value of some function. If this function returns a value different from
+ // a previously-encountered value, the plugins will re-evaluate.
+ var env = api.cache(() => process.env.NODE_ENV);
+
+ // If testing for a specific env, we recommend specifics to avoid instantiating a plugin for
+ // any possible NODE_ENV value that might come up during plugin execution.
+ var isProd = api.cache(() => process.env.NODE_ENV === "production");
+
+ // .cache(fn) will perform a linear search though instances to find the matching plugin based
+ // based on previous instantiated plugins. If you want to recreate the plugin and discard the
+ // previous instance whenever something changes, you may use:
+ var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production");
+
+ // Note, we also expose the following more-verbose versions of the above examples:
+ api.cache.forever(); // api.cache(true)
+ api.cache.never(); // api.cache(false)
+ api.cache.using(fn); // api.cache(fn)
+
+ // Return the value that will be cached.
+ return { };
+};`);
+} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/import.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/import.js
new file mode 100644
index 0000000000..c0acc2b666
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/import.js
@@ -0,0 +1,10 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = import_;
+
+function import_(filepath) {
+ return import(filepath);
+} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/index-browser.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/index-browser.js
new file mode 100644
index 0000000000..c73168bfbd
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/index-browser.js
@@ -0,0 +1,67 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ROOT_CONFIG_FILENAMES = void 0;
+exports.findConfigUpwards = findConfigUpwards;
+exports.findPackageData = findPackageData;
+exports.findRelativeConfig = findRelativeConfig;
+exports.findRootConfig = findRootConfig;
+exports.loadConfig = loadConfig;
+exports.loadPlugin = loadPlugin;
+exports.loadPreset = loadPreset;
+exports.resolvePlugin = resolvePlugin;
+exports.resolvePreset = resolvePreset;
+exports.resolveShowConfigPath = resolveShowConfigPath;
+
+function findConfigUpwards(rootDir) {
+ return null;
+}
+
+function* findPackageData(filepath) {
+ return {
+ filepath,
+ directories: [],
+ pkg: null,
+ isPackage: false
+ };
+}
+
+function* findRelativeConfig(pkgData, envName, caller) {
+ return {
+ config: null,
+ ignore: null
+ };
+}
+
+function* findRootConfig(dirname, envName, caller) {
+ return null;
+}
+
+function* loadConfig(name, dirname, envName, caller) {
+ throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);
+}
+
+function* resolveShowConfigPath(dirname) {
+ return null;
+}
+
+const ROOT_CONFIG_FILENAMES = [];
+exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;
+
+function resolvePlugin(name, dirname) {
+ return null;
+}
+
+function resolvePreset(name, dirname) {
+ return null;
+}
+
+function loadPlugin(name, dirname) {
+ throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`);
+}
+
+function loadPreset(name, dirname) {
+ throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`);
+} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/index.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/index.js
new file mode 100644
index 0000000000..a5d976b306
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/index.js
@@ -0,0 +1,79 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "ROOT_CONFIG_FILENAMES", {
+ enumerable: true,
+ get: function () {
+ return _configuration.ROOT_CONFIG_FILENAMES;
+ }
+});
+Object.defineProperty(exports, "findConfigUpwards", {
+ enumerable: true,
+ get: function () {
+ return _configuration.findConfigUpwards;
+ }
+});
+Object.defineProperty(exports, "findPackageData", {
+ enumerable: true,
+ get: function () {
+ return _package.findPackageData;
+ }
+});
+Object.defineProperty(exports, "findRelativeConfig", {
+ enumerable: true,
+ get: function () {
+ return _configuration.findRelativeConfig;
+ }
+});
+Object.defineProperty(exports, "findRootConfig", {
+ enumerable: true,
+ get: function () {
+ return _configuration.findRootConfig;
+ }
+});
+Object.defineProperty(exports, "loadConfig", {
+ enumerable: true,
+ get: function () {
+ return _configuration.loadConfig;
+ }
+});
+Object.defineProperty(exports, "loadPlugin", {
+ enumerable: true,
+ get: function () {
+ return _plugins.loadPlugin;
+ }
+});
+Object.defineProperty(exports, "loadPreset", {
+ enumerable: true,
+ get: function () {
+ return _plugins.loadPreset;
+ }
+});
+Object.defineProperty(exports, "resolvePlugin", {
+ enumerable: true,
+ get: function () {
+ return _plugins.resolvePlugin;
+ }
+});
+Object.defineProperty(exports, "resolvePreset", {
+ enumerable: true,
+ get: function () {
+ return _plugins.resolvePreset;
+ }
+});
+Object.defineProperty(exports, "resolveShowConfigPath", {
+ enumerable: true,
+ get: function () {
+ return _configuration.resolveShowConfigPath;
+ }
+});
+
+var _package = require("./package");
+
+var _configuration = require("./configuration");
+
+var _plugins = require("./plugins");
+
+({}); \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/module-types.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/module-types.js
new file mode 100644
index 0000000000..9a37973642
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/module-types.js
@@ -0,0 +1,104 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = loadCjsOrMjsDefault;
+
+var _async = require("../../gensync-utils/async");
+
+function _path() {
+ const data = require("path");
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _url() {
+ const data = require("url");
+
+ _url = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _module() {
+ const data = require("module");
+
+ _module = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
+
+function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
+
+let import_;
+
+try {
+ import_ = require("./import").default;
+} catch (_unused) {}
+
+function* loadCjsOrMjsDefault(filepath, asyncError, fallbackToTranspiledModule = false) {
+ switch (guessJSModuleType(filepath)) {
+ case "cjs":
+ return loadCjsDefault(filepath, fallbackToTranspiledModule);
+
+ case "unknown":
+ try {
+ return loadCjsDefault(filepath, fallbackToTranspiledModule);
+ } catch (e) {
+ if (e.code !== "ERR_REQUIRE_ESM") throw e;
+ }
+
+ case "mjs":
+ if (yield* (0, _async.isAsync)()) {
+ return yield* (0, _async.waitFor)(loadMjsDefault(filepath));
+ }
+
+ throw new Error(asyncError);
+ }
+}
+
+function guessJSModuleType(filename) {
+ switch (_path().extname(filename)) {
+ case ".cjs":
+ return "cjs";
+
+ case ".mjs":
+ return "mjs";
+
+ default:
+ return "unknown";
+ }
+}
+
+function loadCjsDefault(filepath, fallbackToTranspiledModule) {
+ const module = require(filepath);
+
+ return module != null && module.__esModule ? module.default || (fallbackToTranspiledModule ? module : undefined) : module;
+}
+
+function loadMjsDefault(_x) {
+ return _loadMjsDefault.apply(this, arguments);
+}
+
+function _loadMjsDefault() {
+ _loadMjsDefault = _asyncToGenerator(function* (filepath) {
+ if (!import_) {
+ throw new Error("Internal error: Native ECMAScript modules aren't supported" + " by this platform.\n");
+ }
+
+ const module = yield import_((0, _url().pathToFileURL)(filepath));
+ return module.default;
+ });
+ return _loadMjsDefault.apply(this, arguments);
+} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/package.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/package.js
new file mode 100644
index 0000000000..0e08bfe331
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/package.js
@@ -0,0 +1,76 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.findPackageData = findPackageData;
+
+function _path() {
+ const data = require("path");
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _utils = require("./utils");
+
+const PACKAGE_FILENAME = "package.json";
+
+function* findPackageData(filepath) {
+ let pkg = null;
+ const directories = [];
+ let isPackage = true;
+
+ let dirname = _path().dirname(filepath);
+
+ while (!pkg && _path().basename(dirname) !== "node_modules") {
+ directories.push(dirname);
+ pkg = yield* readConfigPackage(_path().join(dirname, PACKAGE_FILENAME));
+
+ const nextLoc = _path().dirname(dirname);
+
+ if (dirname === nextLoc) {
+ isPackage = false;
+ break;
+ }
+
+ dirname = nextLoc;
+ }
+
+ return {
+ filepath,
+ directories,
+ pkg,
+ isPackage
+ };
+}
+
+const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {
+ let options;
+
+ try {
+ options = JSON.parse(content);
+ } catch (err) {
+ err.message = `${filepath}: Error while parsing JSON - ${err.message}`;
+ throw err;
+ }
+
+ if (!options) throw new Error(`${filepath}: No config detected`);
+
+ if (typeof options !== "object") {
+ throw new Error(`${filepath}: Config returned typeof ${typeof options}`);
+ }
+
+ if (Array.isArray(options)) {
+ throw new Error(`${filepath}: Expected config object but found array`);
+ }
+
+ return {
+ filepath,
+ dirname: _path().dirname(filepath),
+ options
+ };
+}); \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/plugins.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/plugins.js
new file mode 100644
index 0000000000..4c1a001fb1
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/plugins.js
@@ -0,0 +1,206 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.loadPlugin = loadPlugin;
+exports.loadPreset = loadPreset;
+exports.resolvePlugin = resolvePlugin;
+exports.resolvePreset = resolvePreset;
+
+function _debug() {
+ const data = require("debug");
+
+ _debug = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _path() {
+ const data = require("path");
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _moduleTypes = require("./module-types");
+
+function _module() {
+ const data = require("module");
+
+ _module = function () {
+ return data;
+ };
+
+ return data;
+}
+
+const debug = _debug()("babel:config:loading:files:plugins");
+
+const EXACT_RE = /^module:/;
+const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/;
+const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/;
+const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/;
+const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/;
+const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
+const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
+
+function resolvePlugin(name, dirname) {
+ return resolveStandardizedName("plugin", name, dirname);
+}
+
+function resolvePreset(name, dirname) {
+ return resolveStandardizedName("preset", name, dirname);
+}
+
+function* loadPlugin(name, dirname) {
+ const filepath = resolvePlugin(name, dirname);
+
+ if (!filepath) {
+ throw new Error(`Plugin ${name} not found relative to ${dirname}`);
+ }
+
+ const value = yield* requireModule("plugin", filepath);
+ debug("Loaded plugin %o from %o.", name, dirname);
+ return {
+ filepath,
+ value
+ };
+}
+
+function* loadPreset(name, dirname) {
+ const filepath = resolvePreset(name, dirname);
+
+ if (!filepath) {
+ throw new Error(`Preset ${name} not found relative to ${dirname}`);
+ }
+
+ const value = yield* requireModule("preset", filepath);
+ debug("Loaded preset %o from %o.", name, dirname);
+ return {
+ filepath,
+ value
+ };
+}
+
+function standardizeName(type, name) {
+ if (_path().isAbsolute(name)) return name;
+ const isPreset = type === "preset";
+ return name.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`).replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`).replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`).replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`).replace(EXACT_RE, "");
+}
+
+function resolveStandardizedName(type, name, dirname = process.cwd()) {
+ const standardizedName = standardizeName(type, name);
+
+ try {
+ return (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
+ paths: [b]
+ }, M = require("module")) => {
+ let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
+
+ if (f) return f;
+ f = new Error(`Cannot resolve module '${r}'`);
+ f.code = "MODULE_NOT_FOUND";
+ throw f;
+ })(standardizedName, {
+ paths: [dirname]
+ });
+ } catch (e) {
+ if (e.code !== "MODULE_NOT_FOUND") throw e;
+
+ if (standardizedName !== name) {
+ let resolvedOriginal = false;
+
+ try {
+ (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
+ paths: [b]
+ }, M = require("module")) => {
+ let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
+
+ if (f) return f;
+ f = new Error(`Cannot resolve module '${r}'`);
+ f.code = "MODULE_NOT_FOUND";
+ throw f;
+ })(name, {
+ paths: [dirname]
+ });
+ resolvedOriginal = true;
+ } catch (_unused) {}
+
+ if (resolvedOriginal) {
+ e.message += `\n- If you want to resolve "${name}", use "module:${name}"`;
+ }
+ }
+
+ let resolvedBabel = false;
+
+ try {
+ (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
+ paths: [b]
+ }, M = require("module")) => {
+ let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
+
+ if (f) return f;
+ f = new Error(`Cannot resolve module '${r}'`);
+ f.code = "MODULE_NOT_FOUND";
+ throw f;
+ })(standardizeName(type, "@babel/" + name), {
+ paths: [dirname]
+ });
+ resolvedBabel = true;
+ } catch (_unused2) {}
+
+ if (resolvedBabel) {
+ e.message += `\n- Did you mean "@babel/${name}"?`;
+ }
+
+ let resolvedOppositeType = false;
+ const oppositeType = type === "preset" ? "plugin" : "preset";
+
+ try {
+ (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
+ paths: [b]
+ }, M = require("module")) => {
+ let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
+
+ if (f) return f;
+ f = new Error(`Cannot resolve module '${r}'`);
+ f.code = "MODULE_NOT_FOUND";
+ throw f;
+ })(standardizeName(oppositeType, name), {
+ paths: [dirname]
+ });
+ resolvedOppositeType = true;
+ } catch (_unused3) {}
+
+ if (resolvedOppositeType) {
+ e.message += `\n- Did you accidentally pass a ${oppositeType} as a ${type}?`;
+ }
+
+ throw e;
+ }
+}
+
+const LOADING_MODULES = new Set();
+
+function* requireModule(type, name) {
+ if (LOADING_MODULES.has(name)) {
+ throw new Error(`Reentrant ${type} detected trying to load "${name}". This module is not ignored ` + "and is trying to load itself while compiling itself, leading to a dependency cycle. " + 'We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.');
+ }
+
+ try {
+ LOADING_MODULES.add(name);
+ return yield* (0, _moduleTypes.default)(name, `You appear to be using a native ECMAScript module ${type}, ` + "which is only supported when running Babel asynchronously.", true);
+ } catch (err) {
+ err.message = `[BABEL]: ${err.message} (While processing: ${name})`;
+ throw err;
+ } finally {
+ LOADING_MODULES.delete(name);
+ }
+} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/types.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/types.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/types.js
diff --git a/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/utils.js b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/utils.js
new file mode 100644
index 0000000000..6da68c0a73
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@babel/core/lib/config/files/utils.js
@@ -0,0 +1,44 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.makeStaticFileCache = makeStaticFileCache;
+
+var _caching = require("../caching");
+
+var fs = require("../../gensync-utils/fs");
+
+function _fs2() {
+ const data = require("fs");
+
+ _fs2 = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function makeStaticFileCache(fn) {
+ return (0, _caching.makeStrongCache)(function* (filepath, cache) {
+ const cached = cache.invalidate(() => fileMtime(filepath));
+
+ if (cached === null) {
+ return null;
+ }
+
+ return fn(filepath, yield* fs.readFile(filepath, "utf8"));
+ });
+}
+
+function fileMtime(filepath) {
+ if (!_fs2().existsSync(filepath)) return null;
+
+ try {
+ return +_fs2().statSync(filepath).mtime;
+ } catch (e) {
+ if (e.code !== "ENOENT" && e.code !== "ENOTDIR") throw e;
+ }
+
+ return null;
+} \ No newline at end of file