tools: update eslint to 8.23.1

PR-URL: https://github.com/nodejs/node/pull/44639
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Node.js GitHub Bot authored and Juan José Arboleda committed 2022-10-11 14:45:25 -05:00
1 parent c9af43616c
commit b6c232f288
1194 files changed
+13428 -3834

No files matched your search

+4 -2
View File
@@ -122,7 +122,8 @@ function statSafeSync(filePath) {
try {
return fs.statSync(filePath);
} catch (error) {
/* istanbul ignore next */
/* c8 ignore next */
if (error.code !== "ENOENT") {
throw error;
}
@@ -141,7 +142,8 @@ function readdirSafeSync(directoryPath) {
try {
return fs.readdirSync(directoryPath, { withFileTypes: true });
} catch (error) {
/* istanbul ignore next */
/* c8 ignore next */
if (error.code !== "ENOENT") {
throw error;
}
+27 -5
View File
@@ -15,6 +15,7 @@ const fsp = fs.promises;
const isGlob = require("is-glob");
const globby = require("globby");
const hash = require("../cli-engine/hash");
const minimatch = require("minimatch");
//-----------------------------------------------------------------------------
// Errors
@@ -126,14 +127,14 @@ async function findFiles({
const filePaths = patterns.map(filePath => path.resolve(cwd, filePath));
const stats = await Promise.all(
filePaths.map(
filePath => fsp.stat(filePath).catch(() => {})
filePath => fsp.stat(filePath).catch(() => { })
)
);
stats.forEach((stat, index) => {
const filePath = filePaths[index];
const pattern = patterns[index];
const pattern = normalizeToPosix(patterns[index]);
if (stat) {
@@ -157,6 +158,11 @@ async function findFiles({
return false;
}
// patterns starting with ** always apply
if (filePattern.startsWith("**")) {
return true;
}
// patterns ending with * are not used for file search
if (filePattern.endsWith("*")) {
return false;
@@ -167,11 +173,27 @@ async function findFiles({
return false;
}
// check if the pattern would be inside the cwd or not
// check if the pattern would be inside the config base path or not
const fullFilePattern = path.join(cwd, filePattern);
const relativeFilePattern = path.relative(configs.basePath, fullFilePattern);
const patternRelativeToConfigBasePath = path.relative(configs.basePath, fullFilePattern);
return !relativeFilePattern.startsWith("..");
if (patternRelativeToConfigBasePath.startsWith("..")) {
return false;
}
// check if the pattern matches
if (minimatch(filePath, path.dirname(fullFilePattern), { partial: true })) {
return true;
}
// check if the pattern is inside the directory or not
const patternRelativeToFilePath = path.relative(filePath, fullFilePattern);
if (patternRelativeToFilePath.startsWith("..")) {
return false;
}
return true;
})
.map(filePattern => {
if (filePattern.startsWith("**")) {
@@ -88,10 +88,10 @@ class CodePathSegment {
}
});
/* istanbul ignore if */
/* c8 ignore start */
if (debug.enabled) {
this.internal.nodes = [];
}
}/* c8 ignore stop */
}
/**
@@ -59,7 +59,7 @@ function getContinueContext(state, label) {
context = context.upper;
}
/* istanbul ignore next: foolproof (syntax error) */
/* c8 ignore next */
return null;
}
@@ -79,7 +79,7 @@ function getBreakContext(state, label) {
context = context.upper;
}
/* istanbul ignore next: foolproof (syntax error) */
/* c8 ignore next */
return null;
}
@@ -433,7 +433,7 @@ class CodePathState {
*/
return context;
/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error("unreachable");
}
@@ -1030,7 +1030,7 @@ class CodePathState {
};
break;
/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error(`unknown type: "${type}"`);
}
@@ -1095,7 +1095,7 @@ class CodePathState {
);
break;
/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error("unreachable");
}
@@ -1392,11 +1392,12 @@ class CodePathState {
const context = getBreakContext(this, label);
/* istanbul ignore else: foolproof (syntax error) */
if (context) {
context.brokenForkContext.add(forkContext.head);
}
/* c8 ignore next */
forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
}
@@ -1417,7 +1418,6 @@ class CodePathState {
const context = getContinueContext(this, label);
/* istanbul ignore else: foolproof (syntax error) */
if (context) {
if (context.continueDestSegments) {
makeLooped(this, forkContext.head, context.continueDestSegments);
+3 -3
View File
@@ -20,7 +20,7 @@ const debug = require("debug")("eslint:code-path");
* @param {CodePathSegment} segment A segment to get.
* @returns {string} Id of the segment.
*/
/* istanbul ignore next */
/* c8 ignore next */
function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc -- Ignoring
return segment.id + (segment.reachable ? "" : "!");
}
@@ -67,7 +67,7 @@ module.exports = {
* @param {boolean} leaving A flag whether or not it's leaving
* @returns {void}
*/
dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) {
dumpState: !debug.enabled ? debug : /* c8 ignore next */ function(node, state, leaving) {
for (let i = 0; i < state.currentSegments.length; ++i) {
const segInternal = state.currentSegments[i].internal;
@@ -98,7 +98,7 @@ module.exports = {
* @see http://www.graphviz.org
* @see http://www.webgraphviz.com
*/
dumpDot: !debug.enabled ? debug : /* istanbul ignore next */ function(codePath) {
dumpDot: !debug.enabled ? debug : /* c8 ignore next */ function(codePath) {
let text =
"\n" +
"digraph {\n" +
+2 -2
View File
@@ -33,10 +33,10 @@ class IdGenerator {
next() {
this.n = 1 + this.n | 0;
/* istanbul ignore if */
/* c8 ignore start */
if (this.n < 0) {
this.n = 1;
}
}/* c8 ignore stop */
return this.prefix + this.n;
}
+4 -4
View File
@@ -9,7 +9,7 @@
// Helpers
//------------------------------------------------------------------------------
/* istanbul ignore next */
/* c8 ignore next */
/**
* Align the string to left
* @param {string} str string to evaluate
@@ -22,7 +22,7 @@ function alignLeft(str, len, ch) {
return str + new Array(len - str.length + 1).join(ch || " ");
}
/* istanbul ignore next */
/* c8 ignore next */
/**
* Align the string to right
* @param {string} str string to evaluate
@@ -64,7 +64,7 @@ function getListSize() {
return TIMING_ENV_VAR_AS_INTEGER > 10 ? TIMING_ENV_VAR_AS_INTEGER : MINIMUM_SIZE;
}
/* istanbul ignore next */
/* c8 ignore next */
/**
* display the data
* @param {Object} data Data object to be displayed
@@ -119,7 +119,7 @@ function display(data) {
console.log(table.join("\n")); // eslint-disable-line no-console -- Debugging function
}
/* istanbul ignore next */
/* c8 ignore next */
module.exports = (function() {
const data = Object.create(null);
+1 -1
View File
@@ -125,7 +125,7 @@ function getArrayMethodName(node) {
}
}
/* istanbul ignore next: unreachable */
/* c8 ignore next */
return null;
}
+2 -1
View File
@@ -28,10 +28,11 @@ function findReference(scope, node) {
const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] &&
reference.identifier.range[1] === node.range[1]);
/* istanbul ignore else: correctly returns null */
if (references.length === 1) {
return references[0];
}
/* c8 ignore next */
return null;
}
+4 -4
View File
@@ -18,8 +18,8 @@ const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/* istanbul ignore next: this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. */
// this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway.
/* c8 ignore next */
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
@@ -212,10 +212,10 @@ module.exports = {
if (context.options[0] === "tab") {
indentSize = 1;
indentType = "tab";
} else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") {
} else /* c8 ignore start */ if (typeof context.options[0] === "number") {
indentSize = context.options[0];
indentType = "space";
}
}/* c8 ignore stop */
if (context.options[1]) {
const opts = context.options[1];
+23 -15
View File
@@ -12,7 +12,7 @@
// Requirements
//------------------------------------------------------------------------------
const createTree = require("functional-red-black-tree");
const { OrderedMap } = require("js-sdsl");
const astUtils = require("./utils/ast-utils");
@@ -135,7 +135,8 @@ class BinarySearchTree {
* Creates an empty tree
*/
constructor() {
this._rbTree = createTree();
this._orderedMap = new OrderedMap();
this._orderedMapEnd = this._orderedMap.end();
}
/**
@@ -145,13 +146,7 @@ class BinarySearchTree {
* @returns {void}
*/
insert(key, value) {
const iterator = this._rbTree.find(key);
if (iterator.valid) {
this._rbTree = iterator.update(value);
} else {
this._rbTree = this._rbTree.insert(key, value);
}
this._orderedMap.setElement(key, value);
}
/**
@@ -160,9 +155,13 @@ class BinarySearchTree {
* @returns {{key: number, value: *}|null} The found entry, or null if no such entry exists.
*/
findLe(key) {
const iterator = this._rbTree.le(key);
const iterator = this._orderedMap.reverseLowerBound(key);
return iterator && { key: iterator.key, value: iterator.value };
if (iterator.equals(this._orderedMapEnd)) {
return {};
}
return { key: iterator.pointer[0], value: iterator.pointer[1] };
}
/**
@@ -177,11 +176,20 @@ class BinarySearchTree {
if (start === end) {
return;
}
const iterator = this._rbTree.ge(start);
const iterator = this._orderedMap.lowerBound(start);
while (iterator.valid && iterator.key < end) {
this._rbTree = this._rbTree.remove(iterator.key);
iterator.next();
if (iterator.equals(this._orderedMapEnd)) {
return;
}
if (end > this._orderedMap.back()[0]) {
while (!iterator.equals(this._orderedMapEnd)) {
this._orderedMap.eraseElementByIterator(iterator);
}
} else {
while (iterator.pointer[0] < end) {
this._orderedMap.eraseElementByIterator(iterator);
}
}
}
}
+2 -2
View File
@@ -39,10 +39,10 @@ const CAPS_ALLOWED = [
*/
function checkArray(obj, key, fallback) {
/* istanbul ignore if */
/* c8 ignore start */
if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) {
throw new TypeError(`${key}, if provided, must be an Array`);
}
}/* c8 ignore stop */
return obj[key] || fallback;
}
+1 -1
View File
@@ -188,7 +188,7 @@ module.exports = {
}
return precedence(node) <= precedence(parent);
/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error(`Unexpected parent type: ${parent.type}`);
}
+2 -2
View File
@@ -634,10 +634,10 @@ module.exports = {
currentNode = currentNode.parent;
/* istanbul ignore if */
/* c8 ignore start */
if (currentNode === null) {
throw new Error("Nodes are not in the ancestor-descendant relationship.");
}
}/* c8 ignore stop */
path.push(currentNode);
}
+1 -1
View File
@@ -98,7 +98,7 @@ module.exports = {
info = info.upper;
}
/* istanbul ignore next: syntax error */
/* c8 ignore next */
return "other";
}
+1 -1
View File
@@ -74,7 +74,7 @@ function hasUselessComputedKey(node) {
return value !== "constructor";
/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error(`Unexpected node type: ${node.type}`);
}
+1 -1
View File
@@ -90,7 +90,7 @@ function getScopeNode(node) {
}
}
/* istanbul ignore next : unreachable */
/* c8 ignore next */
return null;
}
+1 -1
View File
@@ -186,7 +186,7 @@ module.exports = {
case "ClassBody":
return options.classes;
/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error("unreachable");
}
+2 -2
View File
@@ -53,7 +53,7 @@ function getVariableOfArguments(scope) {
}
}
/* istanbul ignore next */
/* c8 ignore next */
return null;
}
@@ -126,7 +126,7 @@ function getCallbackInfo(node) {
parent = parent.parent;
}
/* istanbul ignore next */
/* c8 ignore next */
throw new Error("unreachable");
}
+13 -1
View File
@@ -446,7 +446,19 @@ module.exports = {
reportCount += nodesToReport.length;
shouldFix = shouldFix && (reportCount === varDeclParent.declarations.length);
let totalDeclarationsCount = 0;
varDeclParent.declarations.forEach(declaration => {
if (declaration.id.type === "ObjectPattern") {
totalDeclarationsCount += declaration.id.properties.length;
} else if (declaration.id.type === "ArrayPattern") {
totalDeclarationsCount += declaration.id.elements.length;
} else {
totalDeclarationsCount += 1;
}
});
shouldFix = shouldFix && (reportCount === totalDeclarationsCount);
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ function getVariableOfArguments(scope) {
}
}
/* istanbul ignore next : unreachable */
/* c8 ignore next */
return null;
}
-1
View File
@@ -68,7 +68,6 @@ module.exports = {
// Increases the count of `yield` keyword.
YieldExpression() {
/* istanbul ignore else */
if (stack.length > 0) {
stack[stack.length - 1] += 1;
}
+1 -1
View File
@@ -1350,7 +1350,7 @@ module.exports = {
}
}
/* istanbul ignore next */
/* c8 ignore next */
return true;
},
+1 -1
View File
@@ -7,7 +7,7 @@
/* eslint no-console: "off" -- Logging util */
/* istanbul ignore next */
/* c8 ignore next */
module.exports = {
/**
+1 -1
View File
@@ -69,7 +69,7 @@ module.exports = class Cursor {
* @returns {boolean} `true` if the next token exists.
* @abstract
*/
/* istanbul ignore next */
/* c8 ignore next */
moveNext() { // eslint-disable-line class-methods-use-this -- Unused
throw new Error("Not implemented.");
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@babel/compat-data",
"version": "7.18.13",
"version": "7.19.1",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
"description": "",
@@ -30,8 +30,8 @@
],
"devDependencies": {
"@mdn/browser-compat-data": "^4.0.10",
"core-js-compat": "^3.22.1",
"electron-to-chromium": "^1.4.113"
"core-js-compat": "^3.25.1",
"electron-to-chromium": "^1.4.248"
},
"engines": {
"node": ">=6.9.0"
@@ -1 +1,3 @@
0 && 0;
0 && 0;
//# sourceMappingURL=cache-contexts.js.map
+3 -1
View File
@@ -323,4 +323,6 @@ class Lock {
}
0 && 0;
0 && 0;
//# sourceMappingURL=caching.js.map
@@ -33,6 +33,10 @@ var _patternToRegex = require("./pattern-to-regex");
var _printer = require("./printer");
var _rewriteStackTrace = require("../errors/rewrite-stack-trace");
var _configError = require("../errors/config-error");
var _files = require("./files");
var _caching = require("./caching");
@@ -201,17 +205,17 @@ function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirector
const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({
filepath: file.filepath,
dirname: file.dirname,
options: (0, _options.validate)("configfile", file.options)
options: (0, _options.validate)("configfile", file.options, file.filepath)
}));
const validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({
filepath: file.filepath,
dirname: file.dirname,
options: (0, _options.validate)("babelrcfile", file.options)
options: (0, _options.validate)("babelrcfile", file.options, file.filepath)
}));
const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({
filepath: file.filepath,
dirname: file.dirname,
options: (0, _options.validate)("extendsfile", file.options)
options: (0, _options.validate)("extendsfile", file.options, file.filepath)
}));
const loadProgrammaticChain = makeChainWalker({
root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),
@@ -306,14 +310,14 @@ function makeChainWalker({
overridesEnv,
createLogger
}) {
return function* (input, context, files = new Set(), baseLogger) {
return function* chainWalker(input, context, files = new Set(), baseLogger) {
const {
dirname
} = input;
const flattenedConfigs = [];
const rootOpts = root(input);
if (configIsApplicable(rootOpts, dirname, context)) {
if (configIsApplicable(rootOpts, dirname, context, input.filepath)) {
flattenedConfigs.push({
config: rootOpts,
envName: undefined,
@@ -321,7 +325,7 @@ function makeChainWalker({
});
const envOpts = env(input, context.envName);
if (envOpts && configIsApplicable(envOpts, dirname, context)) {
if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) {
flattenedConfigs.push({
config: envOpts,
envName: context.envName,
@@ -332,7 +336,7 @@ function makeChainWalker({
(rootOpts.options.overrides || []).forEach((_, index) => {
const overrideOps = overrides(input, index);
if (configIsApplicable(overrideOps, dirname, context)) {
if (configIsApplicable(overrideOps, dirname, context, input.filepath)) {
flattenedConfigs.push({
config: overrideOps,
index,
@@ -340,7 +344,7 @@ function makeChainWalker({
});
const overrideEnvOpts = overridesEnv(input, index, context.envName);
if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context)) {
if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) {
flattenedConfigs.push({
config: overrideEnvOpts,
index,
@@ -492,13 +496,13 @@ function dedupDescriptors(items) {
function configIsApplicable({
options
}, dirname, context) {
return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname));
}, dirname, context, configName) {
return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname, configName)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname, configName)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname, configName));
}
function configFieldIsApplicable(context, test, dirname) {
function configFieldIsApplicable(context, test, dirname, configName) {
const patterns = Array.isArray(test) ? test : [test];
return matchesPatterns(context, patterns, dirname);
return matchesPatterns(context, patterns, dirname, configName);
}
function ignoreListReplacer(_key, value) {
@@ -539,13 +543,13 @@ function shouldIgnore(context, ignore, only, dirname) {
return false;
}
function matchesPatterns(context, patterns, dirname) {
return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context));
function matchesPatterns(context, patterns, dirname, configName) {
return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName));
}
function matchPattern(pattern, dirname, pathToTest, context) {
function matchPattern(pattern, dirname, pathToTest, context, configName) {
if (typeof pattern === "function") {
return !!pattern(pathToTest, {
return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, {
dirname,
envName: context.envName,
caller: context.caller
@@ -553,7 +557,7 @@ function matchPattern(pattern, dirname, pathToTest, context) {
}
if (typeof pathToTest !== "string") {
throw new Error(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`);
throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName);
}
if (typeof pattern === "string") {
@@ -563,4 +567,6 @@ function matchPattern(pattern, dirname, pathToTest, context) {
return pattern.test(pathToTest);
}
0 && 0;
0 && 0;
//# sourceMappingURL=config-chain.js.map
@@ -228,4 +228,6 @@ function assertNoDuplicates(items) {
}
}
0 && 0;
0 && 0;
//# sourceMappingURL=config-descriptors.js.map
@@ -70,6 +70,8 @@ var _moduleTypes = require("./module-types");
var _patternToRegex = require("../pattern-to-regex");
var _configError = require("../../errors/config-error");
var fs = require("../../gensync-utils/fs");
function _module() {
@@ -82,6 +84,8 @@ function _module() {
return data;
}
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace");
const debug = _debug()("babel:config:loading:files:configuration");
const ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json"];
@@ -146,7 +150,7 @@ 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}`);
throw new _configError.default(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`);
}
return config || previousConfig;
@@ -175,7 +179,7 @@ function* loadConfig(name, dirname, envName, caller) {
const conf = yield* readConfig(filepath, envName, caller);
if (!conf) {
throw new Error(`Config file ${filepath} contains no configuration data`);
throw new _configError.default(`Config file contains no configuration data`, filepath);
}
debug("Loaded config %o from %o.", name, dirname);
@@ -213,9 +217,6 @@ const readConfigJS = (0, _caching.makeStrongCache)(function* readConfigJS(filepa
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);
}
@@ -224,19 +225,19 @@ const readConfigJS = (0, _caching.makeStrongCache)(function* readConfigJS(filepa
if (typeof options === "function") {
yield* [];
options = options((0, _configApi.makeConfigAPI)(cache));
options = (0, _rewriteStackTrace.endHiddenCallStack)(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.`);
throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath);
}
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.`);
throw new _configError.default(`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.`, filepath);
}
if (assertCache && !cache.configured()) throwConfigError();
if (assertCache && !cache.configured()) throwConfigError(filepath);
return {
filepath,
dirname: _path().dirname(filepath),
@@ -248,7 +249,7 @@ const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => {
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`);
throw new _configError.default(`.babel property must be an object`, file.filepath);
}
return {
@@ -263,18 +264,17 @@ const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => {
try {
options = _json().parse(content);
} catch (err) {
err.message = `${filepath}: Error while parsing config - ${err.message}`;
throw err;
throw new _configError.default(`Error while parsing config - ${err.message}`, filepath);
}
if (!options) throw new Error(`${filepath}: No config detected`);
if (!options) throw new _configError.default(`No config detected`, filepath);
if (typeof options !== "object") {
throw new Error(`${filepath}: Config returned typeof ${typeof options}`);
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
}
if (Array.isArray(options)) {
throw new Error(`${filepath}: Expected config object but found array`);
throw new _configError.default(`Expected config object but found array`, filepath);
}
delete options["$schema"];
@@ -291,7 +291,7 @@ const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) =>
for (const pattern of ignorePatterns) {
if (pattern[0] === "!") {
throw new Error(`Negation of file paths is not supported.`);
throw new _configError.default(`Negation of file paths is not supported.`, filepath);
}
}
@@ -320,8 +320,8 @@ function* resolveShowConfigPath(dirname) {
return null;
}
function throwConfigError() {
throw new Error(`\
function throwConfigError(filepath) {
throw new _configError.default(`\
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:
@@ -354,7 +354,9 @@ module.exports = function(api) {
// Return the value that will be cached.
return { };
};`);
};`, filepath);
}
0 && 0;
0 && 0;
//# sourceMappingURL=configuration.js.map
@@ -40,4 +40,6 @@ function _resolve() {
return _resolve.apply(this, arguments);
}
0 && 0;
0 && 0;
//# sourceMappingURL=import-meta-resolve.js.map
@@ -2,4 +2,6 @@ module.exports = function import_(filepath) {
return import(filepath);
};
0 && 0;
0 && 0;
//# sourceMappingURL=import.cjs.map
@@ -66,4 +66,6 @@ function loadPreset(name, dirname) {
throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`);
}
0 && 0;
0 && 0;
//# sourceMappingURL=index-browser.js.map
@@ -84,4 +84,6 @@ exports.resolvePlugin = resolvePlugin;
const resolvePreset = _gensync()(plugins.resolvePreset).sync;
exports.resolvePreset = resolvePreset;
0 && 0;
0 && 0;
//# sourceMappingURL=index.js.map
@@ -48,6 +48,10 @@ function _semver() {
return data;
}
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace");
var _configError = require("../../errors/config-error");
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); }); }; }
@@ -79,7 +83,7 @@ function* loadCjsOrMjsDefault(filepath, asyncError, fallbackToTranspiledModule =
return yield* (0, _async.waitFor)(loadMjsDefault(filepath));
}
throw new Error(asyncError);
throw new _configError.default(asyncError, filepath);
}
}
@@ -97,8 +101,7 @@ function guessJSModuleType(filename) {
}
function loadCjsDefault(filepath, fallbackToTranspiledModule) {
const module = require(filepath);
const module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath);
return module != null && module.__esModule ? module.default || (fallbackToTranspiledModule ? module : undefined) : module;
}
@@ -109,13 +112,15 @@ function loadMjsDefault(_x) {
function _loadMjsDefault() {
_loadMjsDefault = _asyncToGenerator(function* (filepath) {
if (!import_) {
throw new Error("Internal error: Native ECMAScript modules aren't supported" + " by this platform.\n");
throw new _configError.default("Internal error: Native ECMAScript modules aren't supported" + " by this platform.\n", filepath);
}
const module = yield import_((0, _url().pathToFileURL)(filepath));
const module = yield (0, _rewriteStackTrace.endHiddenCallStack)(import_)((0, _url().pathToFileURL)(filepath));
return module.default;
});
return _loadMjsDefault.apply(this, arguments);
}
0 && 0;
0 && 0;
//# sourceMappingURL=module-types.js.map
@@ -17,6 +17,8 @@ function _path() {
var _utils = require("./utils");
var _configError = require("../../errors/config-error");
const PACKAGE_FILENAME = "package.json";
function* findPackageData(filepath) {
@@ -54,18 +56,17 @@ const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) =>
try {
options = JSON.parse(content);
} catch (err) {
err.message = `${filepath}: Error while parsing JSON - ${err.message}`;
throw err;
throw new _configError.default(`Error while parsing JSON - ${err.message}`, filepath);
}
if (!options) throw new Error(`${filepath}: No config detected`);
if (typeof options !== "object") {
throw new Error(`${filepath}: Config returned typeof ${typeof options}`);
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
}
if (Array.isArray(options)) {
throw new Error(`${filepath}: Expected config object but found array`);
throw new _configError.default(`Expected config object but found array`, filepath);
}
return {
@@ -74,4 +75,6 @@ const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) =>
options
};
});
0 && 0;
0 && 0;
//# sourceMappingURL=package.js.map
@@ -272,4 +272,6 @@ function* requireModule(type, name) {
}
}
0 && 0;
0 && 0;
//# sourceMappingURL=plugins.js.map
@@ -1 +1,3 @@
0 && 0;
0 && 0;
//# sourceMappingURL=types.js.map
@@ -43,4 +43,6 @@ function fileMtime(filepath) {
return null;
}
0 && 0;
0 && 0;
//# sourceMappingURL=utils.js.map
+8 -4
View File
@@ -49,7 +49,7 @@ var _configApi = require("./helpers/config-api");
var _partial = require("./partial");
var Context = require("./cache-contexts");
var _configError = require("../errors/config-error");
var _default = _gensync()(function* loadFullConfig(inputOpts) {
var _opts$assumptions;
@@ -202,7 +202,9 @@ function enhanceError(context, fn) {
return yield* fn(arg1, arg2);
} catch (e) {
if (!/^\[BABEL\]/.test(e.message)) {
e.message = `[BABEL] ${context.filename || "unknown"}: ${e.message}`;
var _context$filename;
e.message = `[BABEL] ${(_context$filename = context.filename) != null ? _context$filename : "unknown file"}: ${e.message}`;
}
throw e;
@@ -327,7 +329,7 @@ const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({
const validateIfOptionNeedsFilename = (options, descriptor) => {
if (options.test || options.include || options.exclude) {
const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */";
throw new Error([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n"));
throw new _configError.default([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n"));
}
};
@@ -377,4 +379,6 @@ function chain(a, b) {
};
}
0 && 0;
0 && 0;
//# sourceMappingURL=full.js.map
@@ -21,8 +21,6 @@ var _ = require("../../");
var _caching = require("../caching");
var Context = require("../cache-contexts");
function makeConfigAPI(cache) {
const env = value => cache.using(data => {
if (typeof value === "undefined") return data.envName;
@@ -106,4 +104,6 @@ function assertVersion(range) {
});
}
0 && 0;
0 && 0;
//# sourceMappingURL=config-api.js.map
@@ -23,4 +23,6 @@ function flattenToSet(arr) {
return result;
}
0 && 0;
0 && 0;
//# sourceMappingURL=deep-array.js.map
@@ -9,4 +9,6 @@ function getEnv(defaultValue = "development") {
return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;
}
0 && 0;
0 && 0;
//# sourceMappingURL=environment.js.map
+3 -1
View File
@@ -80,4 +80,6 @@ function createConfigItem(target, options, callback) {
}
}
0 && 0;
0 && 0;
//# sourceMappingURL=index.js.map
+3 -1
View File
@@ -74,4 +74,6 @@ class ConfigItem {
}
Object.freeze(ConfigItem.prototype);
0 && 0;
0 && 0;
//# sourceMappingURL=item.js.map
+3 -1
View File
@@ -195,4 +195,6 @@ class PartialConfig {
}
Object.freeze(PartialConfig.prototype);
0 && 0;
0 && 0;
//# sourceMappingURL=partial.js.map
@@ -43,4 +43,6 @@ function pathToPattern(pattern, dirname) {
})].join(""));
}
0 && 0;
0 && 0;
//# sourceMappingURL=pattern-to-regex.js.map
+3 -1
View File
@@ -32,4 +32,6 @@ class Plugin {
}
exports.default = Plugin;
0 && 0;
0 && 0;
//# sourceMappingURL=plugin.js.map
+3 -1
View File
@@ -137,4 +137,6 @@ class ConfigPrinter {
}
exports.ConfigPrinter = ConfigPrinter;
0 && 0;
0 && 0;
//# sourceMappingURL=printer.js.map
@@ -44,4 +44,6 @@ function resolveTargets(options, root) {
});
}
0 && 0;
0 && 0;
//# sourceMappingURL=resolve-targets-browser.js.map
@@ -70,4 +70,6 @@ function resolveTargets(options, root) {
});
}
0 && 0;
0 && 0;
//# sourceMappingURL=resolve-targets.js.map
+3 -1
View File
@@ -30,4 +30,6 @@ function isIterableIterator(value) {
return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function";
}
0 && 0;
0 && 0;
//# sourceMappingURL=util.js.map
@@ -351,4 +351,6 @@ function assertAssumptions(loc, value) {
return value;
}
0 && 0;
0 && 0;
//# sourceMappingURL=option-assertions.js.map
@@ -7,12 +7,12 @@ exports.assumptionsNames = void 0;
exports.checkNoUnwrappedItemOptionPairs = checkNoUnwrappedItemOptionPairs;
exports.validate = validate;
var _plugin = require("../plugin");
var _removed = require("./removed");
var _optionAssertions = require("./option-assertions");
var _configError = require("../../errors/config-error");
const ROOT_VALIDATORS = {
cwd: _optionAssertions.assertString,
root: _optionAssertions.assertString,
@@ -82,11 +82,17 @@ function getSource(loc) {
return loc.type === "root" ? loc.source : getSource(loc.parent);
}
function validate(type, opts) {
return validateNested({
type: "root",
source: type
}, opts);
function validate(type, opts, filename) {
try {
return validateNested({
type: "root",
source: type
}, opts);
} catch (error) {
const configError = new _configError.default(error.message, filename);
if (error.code) configError.code = error.code;
throw configError;
}
}
function validateNested(loc, opts) {
@@ -210,4 +216,6 @@ function checkNoUnwrappedItemOptionPairs(items, index, type, e) {
}
}
0 && 0;
0 && 0;
//# sourceMappingURL=options.js.map
@@ -70,4 +70,6 @@ function validatePluginObject(obj) {
return obj;
}
0 && 0;
0 && 0;
//# sourceMappingURL=plugins.js.map
@@ -64,4 +64,6 @@ var _default = {
}
};
exports.default = _default;
0 && 0;
0 && 0;
//# sourceMappingURL=removed.js.map
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _rewriteStackTrace = require("./rewrite-stack-trace");
class ConfigError extends Error {
constructor(message, filename) {
super(message);
(0, _rewriteStackTrace.expectedError)(this);
if (filename) (0, _rewriteStackTrace.injcectVirtualStackFrame)(this, filename);
}
}
exports.default = ConfigError;
0 && 0;
//# sourceMappingURL=config-error.js.map
@@ -0,0 +1,111 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.beginHiddenCallStack = beginHiddenCallStack;
exports.endHiddenCallStack = endHiddenCallStack;
exports.expectedError = expectedError;
exports.injcectVirtualStackFrame = injcectVirtualStackFrame;
const ErrorToString = Function.call.bind(Error.prototype.toString);
const SUPPORTED = !!Error.captureStackTrace;
const START_HIDNG = "startHiding - secret - don't use this - v1";
const STOP_HIDNG = "stopHiding - secret - don't use this - v1";
const expectedErrors = new WeakSet();
const virtualFrames = new WeakMap();
function CallSite(filename) {
return Object.create({
isNative: () => false,
isConstructor: () => false,
isToplevel: () => true,
getFileName: () => filename,
getLineNumber: () => undefined,
getColumnNumber: () => undefined,
getFunctionName: () => undefined,
getMethodName: () => undefined,
getTypeName: () => undefined,
toString: () => filename
});
}
function injcectVirtualStackFrame(error, filename) {
if (!SUPPORTED) return;
let frames = virtualFrames.get(error);
if (!frames) virtualFrames.set(error, frames = []);
frames.push(CallSite(filename));
return error;
}
function expectedError(error) {
if (!SUPPORTED) return;
expectedErrors.add(error);
return error;
}
function beginHiddenCallStack(fn) {
if (!SUPPORTED) return fn;
return Object.defineProperty(function (...args) {
setupPrepareStackTrace();
return fn(...args);
}, "name", {
value: STOP_HIDNG
});
}
function endHiddenCallStack(fn) {
if (!SUPPORTED) return fn;
return Object.defineProperty(function (...args) {
return fn(...args);
}, "name", {
value: START_HIDNG
});
}
function setupPrepareStackTrace() {
setupPrepareStackTrace = () => {};
const {
prepareStackTrace = defaultPrepareStackTrace
} = Error;
const MIN_STACK_TRACE_LIMIT = 50;
Error.stackTraceLimit && (Error.stackTraceLimit = Math.max(Error.stackTraceLimit, MIN_STACK_TRACE_LIMIT));
Error.prepareStackTrace = function stackTraceRewriter(err, trace) {
let newTrace = [];
const isExpected = expectedErrors.has(err);
let status = isExpected ? "hiding" : "unknown";
for (let i = 0; i < trace.length; i++) {
const name = trace[i].getFunctionName();
if (name === START_HIDNG) {
status = "hiding";
} else if (name === STOP_HIDNG) {
if (status === "hiding") {
status = "showing";
if (virtualFrames.has(err)) {
newTrace.unshift(...virtualFrames.get(err));
}
} else if (status === "unknown") {
newTrace = trace;
break;
}
} else if (status !== "hiding") {
newTrace.push(trace[i]);
}
}
return prepareStackTrace(err, newTrace);
};
}
function defaultPrepareStackTrace(err, trace) {
if (trace.length === 0) return ErrorToString(err);
return `${ErrorToString(err)}\n at ${trace.join("\n at ")}`;
}
0 && 0;
//# sourceMappingURL=rewrite-stack-trace.js.map
@@ -111,4 +111,6 @@ function isThenable(val) {
return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
}
0 && 0;
0 && 0;
//# sourceMappingURL=async.js.map
@@ -38,4 +38,6 @@ const stat = _gensync()({
});
exports.stat = stat;
0 && 0;
0 && 0;
//# sourceMappingURL=fs.js.map
@@ -32,4 +32,6 @@ function once(fn) {
};
}
0 && 0;
0 && 0;
//# sourceMappingURL=functional.js.map
+4 -2
View File
@@ -247,7 +247,7 @@ var _transformAst = require("./transform-ast");
var _parse = require("./parse");
const version = "7.18.13";
const version = "7.19.1";
exports.version = version;
const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
@@ -265,4 +265,6 @@ function Plugin(alias) {
throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);
}
0 && (exports.types = exports.traverse = exports.tokTypes = exports.template = 0);
0 && (exports.types = exports.traverse = exports.tokTypes = exports.template = 0);
//# sourceMappingURL=index.js.map
+19 -8
View File
@@ -3,7 +3,9 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parseSync = exports.parseAsync = exports.parse = void 0;
exports.parse = void 0;
exports.parseAsync = parseAsync;
exports.parseSync = parseSync;
function _gensync() {
const data = require("gensync");
@@ -21,6 +23,8 @@ var _parser = require("./parser");
var _normalizeOpts = require("./transformation/normalize-opts");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace");
const parseRunner = _gensync()(function* parse(code, opts) {
const config = yield* (0, _config.default)(opts);
@@ -39,16 +43,23 @@ const parse = function parse(code, opts, callback) {
if (callback === undefined) {
{
return parseRunner.sync(code, opts);
return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(code, opts);
}
}
parseRunner.errback(code, opts, callback);
(0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.errback)(code, opts, callback);
};
exports.parse = parse;
const parseSync = parseRunner.sync;
exports.parseSync = parseSync;
const parseAsync = parseRunner.async;
exports.parseAsync = parseAsync;
0 && 0;
function parseSync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(...args);
}
function parseAsync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.async)(...args);
}
0 && 0;
//# sourceMappingURL=parse.js.map
+3 -1
View File
@@ -94,4 +94,6 @@ function* parser(pluginPasses, {
}
}
0 && 0;
0 && 0;
//# sourceMappingURL=index.js.map
@@ -322,4 +322,6 @@ If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section
return helpMessage;
}
0 && 0;
0 && 0;
//# sourceMappingURL=missing-plugin-helper.js.map
@@ -163,4 +163,6 @@ function _default(allowlist, outputType = "global") {
return (0, _generator().default)(tree).code;
}
0 && 0;
0 && 0;
//# sourceMappingURL=build-external-helpers.js.map
+19 -8
View File
@@ -3,7 +3,9 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.transformFromAstSync = exports.transformFromAstAsync = exports.transformFromAst = void 0;
exports.transformFromAst = void 0;
exports.transformFromAstAsync = transformFromAstAsync;
exports.transformFromAstSync = transformFromAstSync;
function _gensync() {
const data = require("gensync");
@@ -19,6 +21,8 @@ var _config = require("./config");
var _transformation = require("./transformation");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace");
const transformFromAstRunner = _gensync()(function* (ast, code, opts) {
const config = yield* (0, _config.default)(opts);
if (config === null) return null;
@@ -40,16 +44,23 @@ const transformFromAst = function transformFromAst(ast, code, optsOrCallback, ma
if (callback === undefined) {
{
return transformFromAstRunner.sync(ast, code, opts);
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast, code, opts);
}
}
transformFromAstRunner.errback(ast, code, opts, callback);
(0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast, code, opts, callback);
};
exports.transformFromAst = transformFromAst;
const transformFromAstSync = transformFromAstRunner.sync;
exports.transformFromAstSync = transformFromAstSync;
const transformFromAstAsync = transformFromAstRunner.async;
exports.transformFromAstAsync = transformFromAstAsync;
0 && 0;
function transformFromAstSync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args);
}
function transformFromAstAsync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.async)(...args);
}
0 && 0;
//# sourceMappingURL=transform-ast.js.map
@@ -25,4 +25,6 @@ function transformFileAsync() {
return Promise.reject(new Error("Transforming files is not supported in browsers"));
}
0 && 0;
0 && 0;
//# sourceMappingURL=transform-file-browser.js.map
+18 -8
View File
@@ -3,7 +3,9 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.transformFileSync = exports.transformFileAsync = exports.transformFile = void 0;
exports.transformFile = transformFile;
exports.transformFileAsync = transformFileAsync;
exports.transformFileSync = transformFileSync;
function _gensync() {
const data = require("gensync");
@@ -33,10 +35,18 @@ const transformFileRunner = _gensync()(function* (filename, opts) {
return yield* (0, _transformation.run)(config, code);
});
const transformFile = transformFileRunner.errback;
exports.transformFile = transformFile;
const transformFileSync = transformFileRunner.sync;
exports.transformFileSync = transformFileSync;
const transformFileAsync = transformFileRunner.async;
exports.transformFileAsync = transformFileAsync;
0 && 0;
function transformFile(...args) {
return transformFileRunner.errback(...args);
}
function transformFileSync(...args) {
return transformFileRunner.sync(...args);
}
function transformFileAsync(...args) {
return transformFileRunner.async(...args);
}
0 && 0;
//# sourceMappingURL=transform-file.js.map
+19 -8
View File
@@ -3,7 +3,9 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.transformSync = exports.transformAsync = exports.transform = void 0;
exports.transform = void 0;
exports.transformAsync = transformAsync;
exports.transformSync = transformSync;
function _gensync() {
const data = require("gensync");
@@ -19,6 +21,8 @@ var _config = require("./config");
var _transformation = require("./transformation");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace");
const transformRunner = _gensync()(function* transform(code, opts) {
const config = yield* (0, _config.default)(opts);
if (config === null) return null;
@@ -39,16 +43,23 @@ const transform = function transform(code, optsOrCallback, maybeCallback) {
if (callback === undefined) {
{
return transformRunner.sync(code, opts);
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(code, opts);
}
}
transformRunner.errback(code, opts, callback);
(0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.errback)(code, opts, callback);
};
exports.transform = transform;
const transformSync = transformRunner.sync;
exports.transformSync = transformSync;
const transformAsync = transformRunner.async;
exports.transformAsync = transformAsync;
0 && 0;
function transformSync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(...args);
}
function transformAsync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.async)(...args);
}
0 && 0;
//# sourceMappingURL=transform.js.map
@@ -92,4 +92,6 @@ const blockHoistPlugin = {
}
}
};
0 && 0;
0 && 0;
//# sourceMappingURL=block-hoist-plugin.js.map
@@ -252,4 +252,6 @@ class File {
}
exports.default = File;
0 && 0;
0 && 0;
//# sourceMappingURL=file.js.map
@@ -93,4 +93,6 @@ function generateCode(pluginPasses, file) {
};
}
0 && 0;
0 && 0;
//# sourceMappingURL=generate.js.map
@@ -42,4 +42,6 @@ function rootless(map) {
});
}
0 && 0;
0 && 0;
//# sourceMappingURL=merge-map.js.map
@@ -36,7 +36,7 @@ function* run(config, code, ast) {
} catch (e) {
var _opts$filename;
e.message = `${(_opts$filename = opts.filename) != null ? _opts$filename : "unknown"}: ${e.message}`;
e.message = `${(_opts$filename = opts.filename) != null ? _opts$filename : "unknown file"}: ${e.message}`;
if (!e.code) {
e.code = "BABEL_TRANSFORM_ERROR";
@@ -57,7 +57,7 @@ function* run(config, code, ast) {
} catch (e) {
var _opts$filename2;
e.message = `${(_opts$filename2 = opts.filename) != null ? _opts$filename2 : "unknown"}: ${e.message}`;
e.message = `${(_opts$filename2 = opts.filename) != null ? _opts$filename2 : "unknown file"}: ${e.message}`;
if (!e.code) {
e.code = "BABEL_GENERATE_ERROR";
@@ -126,4 +126,6 @@ function isThenable(val) {
return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
}
0 && 0;
0 && 0;
//# sourceMappingURL=index.js.map
@@ -166,4 +166,6 @@ function extractComments(regex, ast) {
return lastComment;
}
0 && 0;
0 && 0;
//# sourceMappingURL=normalize-file.js.map
@@ -61,4 +61,6 @@ function normalizeOptions(config) {
return options;
}
0 && 0;
0 && 0;
//# sourceMappingURL=normalize-opts.js.map
@@ -52,4 +52,6 @@ exports.default = PluginPass;
return this.file.getModuleName();
};
}
0 && 0;
0 && 0;
//# sourceMappingURL=plugin-pass.js.map
@@ -38,4 +38,6 @@ function _default(value) {
return deepClone(value, new Map());
}
0 && 0;
0 && 0;
//# sourceMappingURL=clone-deep.js.map
@@ -3554,4 +3554,6 @@ function _resolve() {
return _resolve.apply(this, arguments);
}
0 && 0;
0 && 0;
//# sourceMappingURL=import-meta-resolve.js.map
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@babel/core",
"version": "7.18.13",
"version": "7.19.1",
"description": "Babel compiler core.",
"main": "./lib/index.js",
"author": "The Babel Team (https://babel.dev/team)",
@@ -48,14 +48,14 @@
"dependencies": {
"@ampproject/remapping": "^2.1.0",
"@babel/code-frame": "^7.18.6",
"@babel/generator": "^7.18.13",
"@babel/helper-compilation-targets": "^7.18.9",
"@babel/helper-module-transforms": "^7.18.9",
"@babel/helpers": "^7.18.9",
"@babel/parser": "^7.18.13",
"@babel/generator": "^7.19.0",
"@babel/helper-compilation-targets": "^7.19.1",
"@babel/helper-module-transforms": "^7.19.0",
"@babel/helpers": "^7.19.0",
"@babel/parser": "^7.19.1",
"@babel/template": "^7.18.10",
"@babel/traverse": "^7.18.13",
"@babel/types": "^7.18.13",
"@babel/traverse": "^7.19.1",
"@babel/types": "^7.19.0",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
@@ -65,9 +65,9 @@
"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "^7.18.10",
"@babel/plugin-syntax-flow": "^7.18.6",
"@babel/plugin-transform-flow-strip-types": "^7.18.9",
"@babel/plugin-transform-flow-strip-types": "^7.19.0",
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
"@babel/preset-env": "^7.18.10",
"@babel/preset-env": "^7.19.1",
"@jridgewell/trace-mapping": "^0.3.8",
"@types/convert-source-map": "^1.5.1",
"@types/debug": "^4.1.0",
@@ -12,15 +12,13 @@ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!priva
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
const escope = require("eslint-scope");
const {
Definition
} = require("eslint-scope/lib/definition");
const OriginalPatternVisitor = require("eslint-scope/lib/pattern-visitor");
const OriginalReferencer = require("eslint-scope/lib/referencer");
Definition,
PatternVisitor: OriginalPatternVisitor,
Referencer: OriginalReferencer,
Scope,
ScopeManager
} = require("@nicolo-ribaudo/eslint-scope-5-internals");
const {
getKeys: fallback
@@ -271,7 +269,7 @@ class Referencer extends OriginalReferencer {
}
const parentScope = this.scopeManager.__currentScope;
const scope = new escope.Scope(this.scopeManager, "type-parameters", parentScope, node, false);
const scope = new Scope(this.scopeManager, "type-parameters", parentScope, node, false);
this.scopeManager.__nestScope(scope);
@@ -383,8 +381,10 @@ module.exports = function analyzeScope(ast, parserOptions, client) {
fallback
};
options.childVisitorKeys = client.getVisitorKeys();
const scopeManager = new escope.ScopeManager(options);
const scopeManager = new ScopeManager(options);
const referencer = new Referencer(options, scopeManager, client);
referencer.visit(ast);
return scopeManager;
};
};
//# sourceMappingURL=analyze-scope.cjs.map
@@ -169,4 +169,6 @@ function _get_worker_threads() {
writable: true,
value: void 0
}, _class2);
}
}
//# sourceMappingURL=client.cjs.map
@@ -19,4 +19,6 @@ exports.normalizeESLintConfig = function (options) {
sourceType,
requireConfigFile
}, otherOptions);
};
};
//# sourceMappingURL=configuration.cjs.map
@@ -154,4 +154,6 @@ function convertProgramNode(ast) {
module.exports = function convertAST(ast, visitorKeys) {
convertNodes(ast, visitorKeys);
convertProgramNode(ast);
};
};
//# sourceMappingURL=convertAST.cjs.map
@@ -10,4 +10,6 @@ module.exports = function convertComments(comments) {
comment.range = [comment.start, comment.end];
}
}
};
};
//# sourceMappingURL=convertComments.cjs.map
@@ -178,4 +178,6 @@ module.exports = function convertTokens(tokens, code, tl) {
}
return result;
};
};
//# sourceMappingURL=convertTokens.cjs.map
@@ -18,4 +18,6 @@ exports.error = function convertError(err) {
}
return err;
};
};
//# sourceMappingURL=index.cjs.map
@@ -27,4 +27,6 @@ exports.parseForESLint = function (code, options = {}) {
scopeManager,
visitorKeys: client.getVisitorKeys()
};
};
};
//# sourceMappingURL=experimental-worker.cjs.map
+3 -1
View File
@@ -26,4 +26,6 @@ exports.parseForESLint = function (code, options = {}) {
scopeManager,
visitorKeys: client.getVisitorKeys()
};
};
};
//# sourceMappingURL=index.cjs.map
+4 -2
View File
@@ -27,7 +27,7 @@ module.exports = function parse(code, options, client) {
}
if (!isRunningMinSupportedCoreVersion) {
throw new Error(`@babel/eslint-parser@${"7.18.9"} does not support @babel/core@${client.getVersion()}. Please upgrade to @babel/core@${minSupportedCoreVersion}.`);
throw new Error(`@babel/eslint-parser@${"7.19.1"} does not support @babel/core@${client.getVersion()}. Please upgrade to @babel/core@${minSupportedCoreVersion}.`);
}
const {
@@ -41,4 +41,6 @@ module.exports = function parse(code, options, client) {
} catch (err) {
throw convert.error(err);
}
};
};
//# sourceMappingURL=parse.cjs.map
@@ -1 +1,3 @@
module.exports = parseInt(require("eslint/package.json").version, 10);
module.exports = parseInt(require("eslint/package.json").version, 10);
//# sourceMappingURL=eslint-version.cjs.map
@@ -30,4 +30,6 @@ exports.getTokLabels = function getTokLabels() {
return tokLabels || (tokLabels = (p => p.reduce((o, [k, v]) => Object.assign({}, o, {
[k]: v
}), {}))(Object.entries(babel.tokTypes).map(([key, tok]) => [key, tok.label])));
};
};
//# sourceMappingURL=ast-info.cjs.map
@@ -12,4 +12,6 @@ function initialize(babel) {
{
initialize(require("@babel/core"));
}
}
//# sourceMappingURL=babel-core.cjs.map
@@ -90,4 +90,6 @@ exports.normalizeBabelParseConfigSync = function (options) {
const parseOptions = normalizeParserOptions(options);
const config = babel.loadPartialConfigSync(parseOptions);
return validateResolvedConfig(config, options, parseOptions);
};
};
//# sourceMappingURL=configuration.cjs.map
@@ -5,4 +5,6 @@ module.exports = function extractParserOptionsPlugin() {
}
};
};
};
//# sourceMappingURL=extract-parser-options-plugin.cjs.map
@@ -39,4 +39,6 @@ module.exports = function handleMessage(action, payload) {
}
throw new Error(`Unknown internal parser worker action: ${action}`);
};
};
//# sourceMappingURL=handle-message.cjs.map
@@ -41,4 +41,6 @@ parentPort.addListener("message", _asyncToGenerator(function* ({
Atomics.store(signal, 0, 1);
Atomics.notify(signal, 0);
}
}));
}));
//# sourceMappingURL=index.cjs.map
@@ -50,4 +50,6 @@ module.exports = function maybeParse(code, options) {
ast: convert.ast(ast, code, getTokLabels(), getVisitorKeys()),
parserOptions: null
};
};
};
//# sourceMappingURL=maybeParse.cjs.map
Loaded 100 of 1194 files, more files were not shown because too many files have changed in this diff. Show more