mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
build: don't store eslint locally
PR-URL: https://github.com/nodejs/node/pull/54231 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
parent
b77476d884
commit
437e168c06
13
.github/dependabot.yml
vendored
13
.github/dependabot.yml
vendored
|
|
@ -9,3 +9,16 @@ updates:
|
|||
commit-message:
|
||||
prefix: meta
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
- package-ecosystem: npm
|
||||
directory: /tools/eslint
|
||||
schedule:
|
||||
interval: monthly
|
||||
commit-message:
|
||||
prefix: tools
|
||||
open-pull-requests-limit: 10
|
||||
groups:
|
||||
eslint:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- '*'
|
||||
|
|
|
|||
9
.github/workflows/tools.yml
vendored
9
.github/workflows/tools.yml
vendored
|
|
@ -22,7 +22,6 @@ on:
|
|||
- cjs-module-lexer
|
||||
- corepack
|
||||
- doc
|
||||
- eslint
|
||||
- github_reporter
|
||||
- googletest
|
||||
- gyp-next
|
||||
|
|
@ -137,14 +136,6 @@ jobs:
|
|||
npm install --ignore-scripts $NEW_VERSION
|
||||
npm install --ignore-scripts
|
||||
fi
|
||||
- id: eslint
|
||||
subsystem: tools
|
||||
label: tools
|
||||
run: |
|
||||
./tools/dep_updaters/update-eslint.sh > temp-output
|
||||
cat temp-output
|
||||
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
||||
rm temp-output
|
||||
- id: github_reporter
|
||||
subsystem: tools
|
||||
label: tools
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -112,6 +112,7 @@ tools/*/*.i.tmp
|
|||
/node_modules
|
||||
/tools/doc/node_modules
|
||||
/tools/clang-format/node_modules
|
||||
/tools/eslint/node_modules
|
||||
|
||||
# === Rules for test artifacts ===
|
||||
/*.tap
|
||||
|
|
|
|||
23
LICENSE
23
LICENSE
|
|
@ -2233,29 +2233,6 @@ The externally maintained libraries used by Node.js are:
|
|||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"""
|
||||
|
||||
- ESLint, located at tools/eslint/node_modules/eslint, is licensed as follows:
|
||||
"""
|
||||
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
"""
|
||||
|
||||
- gtest, located at deps/googletest, is licensed as follows:
|
||||
"""
|
||||
Copyright 2008, Google Inc.
|
||||
|
|
|
|||
12
Makefile
12
Makefile
|
|
@ -1388,8 +1388,11 @@ run-lint-js = tools/eslint/node_modules/eslint/bin/eslint.js --cache \
|
|||
--max-warnings=0 --report-unused-disable-directives $(LINT_JS_TARGETS)
|
||||
run-lint-js-fix = $(run-lint-js) --fix
|
||||
|
||||
tools/eslint/node_modules: tools/eslint/package-lock.json
|
||||
-cd tools/eslint && $(call available-node,$(run-npm-ci))
|
||||
|
||||
.PHONY: lint-js-fix
|
||||
lint-js-fix:
|
||||
lint-js-fix: tools/eslint/node_modules
|
||||
@$(call available-node,$(run-lint-js-fix))
|
||||
|
||||
.PHONY: lint-js
|
||||
|
|
@ -1397,7 +1400,7 @@ lint-js-fix:
|
|||
# Note that on the CI `lint-js-ci` is run instead.
|
||||
# Lints the JavaScript code with eslint.
|
||||
lint-js-doc: LINT_JS_TARGETS=doc
|
||||
lint-js lint-js-doc:
|
||||
lint-js lint-js-doc: tools/eslint/node_modules
|
||||
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
|
||||
echo "Skipping $@ (no crypto)"; \
|
||||
else \
|
||||
|
|
@ -1414,7 +1417,7 @@ run-lint-js-ci = tools/eslint/node_modules/eslint/bin/eslint.js \
|
|||
|
||||
.PHONY: lint-js-ci
|
||||
# On the CI the output is emitted in the TAP format.
|
||||
lint-js-ci:
|
||||
lint-js-ci: tools/eslint/node_modules
|
||||
$(info Running JS linter...)
|
||||
@$(call available-node,$(run-lint-js-ci))
|
||||
|
||||
|
|
@ -1568,7 +1571,7 @@ lint-yaml:
|
|||
|
||||
.PHONY: lint
|
||||
.PHONY: lint-ci
|
||||
ifneq ("","$(wildcard tools/eslint/node_modules/eslint/)")
|
||||
ifneq ("","$(wildcard tools/eslint/)")
|
||||
lint: ## Run JS, C++, MD and doc linters.
|
||||
@EXIT_STATUS=0 ; \
|
||||
$(MAKE) lint-js || EXIT_STATUS=$$? ; \
|
||||
|
|
@ -1599,6 +1602,7 @@ endif
|
|||
lint-clean:
|
||||
$(RM) tools/.*lintstamp
|
||||
$(RM) .eslintcache
|
||||
$(RM) -r tools/eslint/node_modules
|
||||
|
||||
HAS_DOCKER ?= $(shell command -v docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Shell script to update ESLint in the source tree to the latest release.
|
||||
|
||||
# This script must be in the tools directory when it runs because it uses the
|
||||
# script source file path to determine directories to work in.
|
||||
|
||||
set -ex
|
||||
|
||||
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
|
||||
|
||||
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
|
||||
[ -x "$NODE" ] || NODE=$(command -v node)
|
||||
NPM="$ROOT/deps/npm/bin/npm-cli.js"
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. "$ROOT/tools/dep_updaters/utils.sh"
|
||||
|
||||
NEW_VERSION=$("$NODE" "$NPM" view eslint dist-tags.latest)
|
||||
CURRENT_VERSION=$("$NODE" -p "require('./tools/eslint/node_modules/eslint/package.json').version")
|
||||
|
||||
# This function exit with 0 if new version and current version are the same
|
||||
compare_dependency_version "eslint" "$NEW_VERSION" "$CURRENT_VERSION"
|
||||
|
||||
cd "$( dirname "$0" )" || exit
|
||||
rm -rf ../eslint/node_modules ../eslint/package-lock.json
|
||||
|
||||
cd ../eslint
|
||||
"$NODE" "$NPM" install \
|
||||
--ignore-scripts \
|
||||
--no-bin-links \
|
||||
"eslint@$NEW_VERSION" \
|
||||
eslint-formatter-tap \
|
||||
eslint-plugin-jsdoc \
|
||||
eslint-plugin-markdown \
|
||||
globals \
|
||||
@babel/core \
|
||||
@babel/eslint-parser \
|
||||
@babel/plugin-syntax-import-attributes \
|
||||
@stylistic/eslint-plugin-js
|
||||
|
||||
# Use dmn to remove some unneeded files.
|
||||
"$NODE" "$NPM" exec --package=dmn@3.0.1 --yes -- dmn -f clean
|
||||
# TODO: Get this into dmn.
|
||||
find node_modules \( -name .package-lock.json -or -name 'README*' \) -exec rm {} \;
|
||||
|
||||
# The last line of the script should always print the new version,
|
||||
# as we need to add it to $GITHUB_ENV variable.
|
||||
echo "NEW_VERSION=$NEW_VERSION"
|
||||
202
tools/eslint/node_modules/@ampproject/remapping/LICENSE
generated
vendored
202
tools/eslint/node_modules/@ampproject/remapping/LICENSE
generated
vendored
|
|
@ -1,202 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
197
tools/eslint/node_modules/@ampproject/remapping/dist/remapping.mjs
generated
vendored
197
tools/eslint/node_modules/@ampproject/remapping/dist/remapping.mjs
generated
vendored
|
|
@ -1,197 +0,0 @@
|
|||
import { decodedMappings, traceSegment, TraceMap } from '@jridgewell/trace-mapping';
|
||||
import { GenMapping, maybeAddSegment, setSourceContent, setIgnore, toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';
|
||||
|
||||
const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false);
|
||||
const EMPTY_SOURCES = [];
|
||||
function SegmentObject(source, line, column, name, content, ignore) {
|
||||
return { source, line, column, name, content, ignore };
|
||||
}
|
||||
function Source(map, sources, source, content, ignore) {
|
||||
return {
|
||||
map,
|
||||
sources,
|
||||
source,
|
||||
content,
|
||||
ignore,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
|
||||
* (which may themselves be SourceMapTrees).
|
||||
*/
|
||||
function MapSource(map, sources) {
|
||||
return Source(map, sources, '', null, false);
|
||||
}
|
||||
/**
|
||||
* A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
|
||||
* segment tracing ends at the `OriginalSource`.
|
||||
*/
|
||||
function OriginalSource(source, content, ignore) {
|
||||
return Source(null, EMPTY_SOURCES, source, content, ignore);
|
||||
}
|
||||
/**
|
||||
* traceMappings is only called on the root level SourceMapTree, and begins the process of
|
||||
* resolving each mapping in terms of the original source files.
|
||||
*/
|
||||
function traceMappings(tree) {
|
||||
// TODO: Eventually support sourceRoot, which has to be removed because the sources are already
|
||||
// fully resolved. We'll need to make sources relative to the sourceRoot before adding them.
|
||||
const gen = new GenMapping({ file: tree.map.file });
|
||||
const { sources: rootSources, map } = tree;
|
||||
const rootNames = map.names;
|
||||
const rootMappings = decodedMappings(map);
|
||||
for (let i = 0; i < rootMappings.length; i++) {
|
||||
const segments = rootMappings[i];
|
||||
for (let j = 0; j < segments.length; j++) {
|
||||
const segment = segments[j];
|
||||
const genCol = segment[0];
|
||||
let traced = SOURCELESS_MAPPING;
|
||||
// 1-length segments only move the current generated column, there's no source information
|
||||
// to gather from it.
|
||||
if (segment.length !== 1) {
|
||||
const source = rootSources[segment[1]];
|
||||
traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : '');
|
||||
// If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a
|
||||
// respective segment into an original source.
|
||||
if (traced == null)
|
||||
continue;
|
||||
}
|
||||
const { column, line, name, content, source, ignore } = traced;
|
||||
maybeAddSegment(gen, i, genCol, source, line, column, name);
|
||||
if (source && content != null)
|
||||
setSourceContent(gen, source, content);
|
||||
if (ignore)
|
||||
setIgnore(gen, source, true);
|
||||
}
|
||||
}
|
||||
return gen;
|
||||
}
|
||||
/**
|
||||
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
|
||||
* child SourceMapTrees, until we find the original source map.
|
||||
*/
|
||||
function originalPositionFor(source, line, column, name) {
|
||||
if (!source.map) {
|
||||
return SegmentObject(source.source, line, column, name, source.content, source.ignore);
|
||||
}
|
||||
const segment = traceSegment(source.map, line, column);
|
||||
// If we couldn't find a segment, then this doesn't exist in the sourcemap.
|
||||
if (segment == null)
|
||||
return null;
|
||||
// 1-length segments only move the current generated column, there's no source information
|
||||
// to gather from it.
|
||||
if (segment.length === 1)
|
||||
return SOURCELESS_MAPPING;
|
||||
return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
||||
}
|
||||
|
||||
function asArray(value) {
|
||||
if (Array.isArray(value))
|
||||
return value;
|
||||
return [value];
|
||||
}
|
||||
/**
|
||||
* Recursively builds a tree structure out of sourcemap files, with each node
|
||||
* being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of
|
||||
* `OriginalSource`s and `SourceMapTree`s.
|
||||
*
|
||||
* Every sourcemap is composed of a collection of source files and mappings
|
||||
* into locations of those source files. When we generate a `SourceMapTree` for
|
||||
* the sourcemap, we attempt to load each source file's own sourcemap. If it
|
||||
* does not have an associated sourcemap, it is considered an original,
|
||||
* unmodified source file.
|
||||
*/
|
||||
function buildSourceMapTree(input, loader) {
|
||||
const maps = asArray(input).map((m) => new TraceMap(m, ''));
|
||||
const map = maps.pop();
|
||||
for (let i = 0; i < maps.length; i++) {
|
||||
if (maps[i].sources.length > 1) {
|
||||
throw new Error(`Transformation map ${i} must have exactly one source file.\n` +
|
||||
'Did you specify these with the most recent transformation maps first?');
|
||||
}
|
||||
}
|
||||
let tree = build(map, loader, '', 0);
|
||||
for (let i = maps.length - 1; i >= 0; i--) {
|
||||
tree = MapSource(maps[i], [tree]);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
function build(map, loader, importer, importerDepth) {
|
||||
const { resolvedSources, sourcesContent, ignoreList } = map;
|
||||
const depth = importerDepth + 1;
|
||||
const children = resolvedSources.map((sourceFile, i) => {
|
||||
// The loading context gives the loader more information about why this file is being loaded
|
||||
// (eg, from which importer). It also allows the loader to override the location of the loaded
|
||||
// sourcemap/original source, or to override the content in the sourcesContent field if it's
|
||||
// an unmodified source file.
|
||||
const ctx = {
|
||||
importer,
|
||||
depth,
|
||||
source: sourceFile || '',
|
||||
content: undefined,
|
||||
ignore: undefined,
|
||||
};
|
||||
// Use the provided loader callback to retrieve the file's sourcemap.
|
||||
// TODO: We should eventually support async loading of sourcemap files.
|
||||
const sourceMap = loader(ctx.source, ctx);
|
||||
const { source, content, ignore } = ctx;
|
||||
// If there is a sourcemap, then we need to recurse into it to load its source files.
|
||||
if (sourceMap)
|
||||
return build(new TraceMap(sourceMap, source), loader, source, depth);
|
||||
// Else, it's an unmodified source file.
|
||||
// The contents of this unmodified source file can be overridden via the loader context,
|
||||
// allowing it to be explicitly null or a string. If it remains undefined, we fall back to
|
||||
// the importing sourcemap's `sourcesContent` field.
|
||||
const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;
|
||||
const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false;
|
||||
return OriginalSource(source, sourceContent, ignored);
|
||||
});
|
||||
return MapSource(map, children);
|
||||
}
|
||||
|
||||
/**
|
||||
* A SourceMap v3 compatible sourcemap, which only includes fields that were
|
||||
* provided to it.
|
||||
*/
|
||||
class SourceMap {
|
||||
constructor(map, options) {
|
||||
const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
|
||||
this.version = out.version; // SourceMap spec says this should be first.
|
||||
this.file = out.file;
|
||||
this.mappings = out.mappings;
|
||||
this.names = out.names;
|
||||
this.ignoreList = out.ignoreList;
|
||||
this.sourceRoot = out.sourceRoot;
|
||||
this.sources = out.sources;
|
||||
if (!options.excludeContent) {
|
||||
this.sourcesContent = out.sourcesContent;
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Traces through all the mappings in the root sourcemap, through the sources
|
||||
* (and their sourcemaps), all the way back to the original source location.
|
||||
*
|
||||
* `loader` will be called every time we encounter a source file. If it returns
|
||||
* a sourcemap, we will recurse into that sourcemap to continue the trace. If
|
||||
* it returns a falsey value, that source file is treated as an original,
|
||||
* unmodified source file.
|
||||
*
|
||||
* Pass `excludeContent` to exclude any self-containing source file content
|
||||
* from the output sourcemap.
|
||||
*
|
||||
* Pass `decodedMappings` to receive a SourceMap with decoded (instead of
|
||||
* VLQ encoded) mappings.
|
||||
*/
|
||||
function remapping(input, loader, options) {
|
||||
const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };
|
||||
const tree = buildSourceMapTree(input, loader);
|
||||
return new SourceMap(traceMappings(tree), opts);
|
||||
}
|
||||
|
||||
export { remapping as default };
|
||||
//# sourceMappingURL=remapping.mjs.map
|
||||
202
tools/eslint/node_modules/@ampproject/remapping/dist/remapping.umd.js
generated
vendored
202
tools/eslint/node_modules/@ampproject/remapping/dist/remapping.umd.js
generated
vendored
|
|
@ -1,202 +0,0 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@jridgewell/trace-mapping'), require('@jridgewell/gen-mapping')) :
|
||||
typeof define === 'function' && define.amd ? define(['@jridgewell/trace-mapping', '@jridgewell/gen-mapping'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.remapping = factory(global.traceMapping, global.genMapping));
|
||||
})(this, (function (traceMapping, genMapping) { 'use strict';
|
||||
|
||||
const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false);
|
||||
const EMPTY_SOURCES = [];
|
||||
function SegmentObject(source, line, column, name, content, ignore) {
|
||||
return { source, line, column, name, content, ignore };
|
||||
}
|
||||
function Source(map, sources, source, content, ignore) {
|
||||
return {
|
||||
map,
|
||||
sources,
|
||||
source,
|
||||
content,
|
||||
ignore,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
|
||||
* (which may themselves be SourceMapTrees).
|
||||
*/
|
||||
function MapSource(map, sources) {
|
||||
return Source(map, sources, '', null, false);
|
||||
}
|
||||
/**
|
||||
* A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
|
||||
* segment tracing ends at the `OriginalSource`.
|
||||
*/
|
||||
function OriginalSource(source, content, ignore) {
|
||||
return Source(null, EMPTY_SOURCES, source, content, ignore);
|
||||
}
|
||||
/**
|
||||
* traceMappings is only called on the root level SourceMapTree, and begins the process of
|
||||
* resolving each mapping in terms of the original source files.
|
||||
*/
|
||||
function traceMappings(tree) {
|
||||
// TODO: Eventually support sourceRoot, which has to be removed because the sources are already
|
||||
// fully resolved. We'll need to make sources relative to the sourceRoot before adding them.
|
||||
const gen = new genMapping.GenMapping({ file: tree.map.file });
|
||||
const { sources: rootSources, map } = tree;
|
||||
const rootNames = map.names;
|
||||
const rootMappings = traceMapping.decodedMappings(map);
|
||||
for (let i = 0; i < rootMappings.length; i++) {
|
||||
const segments = rootMappings[i];
|
||||
for (let j = 0; j < segments.length; j++) {
|
||||
const segment = segments[j];
|
||||
const genCol = segment[0];
|
||||
let traced = SOURCELESS_MAPPING;
|
||||
// 1-length segments only move the current generated column, there's no source information
|
||||
// to gather from it.
|
||||
if (segment.length !== 1) {
|
||||
const source = rootSources[segment[1]];
|
||||
traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : '');
|
||||
// If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a
|
||||
// respective segment into an original source.
|
||||
if (traced == null)
|
||||
continue;
|
||||
}
|
||||
const { column, line, name, content, source, ignore } = traced;
|
||||
genMapping.maybeAddSegment(gen, i, genCol, source, line, column, name);
|
||||
if (source && content != null)
|
||||
genMapping.setSourceContent(gen, source, content);
|
||||
if (ignore)
|
||||
genMapping.setIgnore(gen, source, true);
|
||||
}
|
||||
}
|
||||
return gen;
|
||||
}
|
||||
/**
|
||||
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
|
||||
* child SourceMapTrees, until we find the original source map.
|
||||
*/
|
||||
function originalPositionFor(source, line, column, name) {
|
||||
if (!source.map) {
|
||||
return SegmentObject(source.source, line, column, name, source.content, source.ignore);
|
||||
}
|
||||
const segment = traceMapping.traceSegment(source.map, line, column);
|
||||
// If we couldn't find a segment, then this doesn't exist in the sourcemap.
|
||||
if (segment == null)
|
||||
return null;
|
||||
// 1-length segments only move the current generated column, there's no source information
|
||||
// to gather from it.
|
||||
if (segment.length === 1)
|
||||
return SOURCELESS_MAPPING;
|
||||
return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
||||
}
|
||||
|
||||
function asArray(value) {
|
||||
if (Array.isArray(value))
|
||||
return value;
|
||||
return [value];
|
||||
}
|
||||
/**
|
||||
* Recursively builds a tree structure out of sourcemap files, with each node
|
||||
* being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of
|
||||
* `OriginalSource`s and `SourceMapTree`s.
|
||||
*
|
||||
* Every sourcemap is composed of a collection of source files and mappings
|
||||
* into locations of those source files. When we generate a `SourceMapTree` for
|
||||
* the sourcemap, we attempt to load each source file's own sourcemap. If it
|
||||
* does not have an associated sourcemap, it is considered an original,
|
||||
* unmodified source file.
|
||||
*/
|
||||
function buildSourceMapTree(input, loader) {
|
||||
const maps = asArray(input).map((m) => new traceMapping.TraceMap(m, ''));
|
||||
const map = maps.pop();
|
||||
for (let i = 0; i < maps.length; i++) {
|
||||
if (maps[i].sources.length > 1) {
|
||||
throw new Error(`Transformation map ${i} must have exactly one source file.\n` +
|
||||
'Did you specify these with the most recent transformation maps first?');
|
||||
}
|
||||
}
|
||||
let tree = build(map, loader, '', 0);
|
||||
for (let i = maps.length - 1; i >= 0; i--) {
|
||||
tree = MapSource(maps[i], [tree]);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
function build(map, loader, importer, importerDepth) {
|
||||
const { resolvedSources, sourcesContent, ignoreList } = map;
|
||||
const depth = importerDepth + 1;
|
||||
const children = resolvedSources.map((sourceFile, i) => {
|
||||
// The loading context gives the loader more information about why this file is being loaded
|
||||
// (eg, from which importer). It also allows the loader to override the location of the loaded
|
||||
// sourcemap/original source, or to override the content in the sourcesContent field if it's
|
||||
// an unmodified source file.
|
||||
const ctx = {
|
||||
importer,
|
||||
depth,
|
||||
source: sourceFile || '',
|
||||
content: undefined,
|
||||
ignore: undefined,
|
||||
};
|
||||
// Use the provided loader callback to retrieve the file's sourcemap.
|
||||
// TODO: We should eventually support async loading of sourcemap files.
|
||||
const sourceMap = loader(ctx.source, ctx);
|
||||
const { source, content, ignore } = ctx;
|
||||
// If there is a sourcemap, then we need to recurse into it to load its source files.
|
||||
if (sourceMap)
|
||||
return build(new traceMapping.TraceMap(sourceMap, source), loader, source, depth);
|
||||
// Else, it's an unmodified source file.
|
||||
// The contents of this unmodified source file can be overridden via the loader context,
|
||||
// allowing it to be explicitly null or a string. If it remains undefined, we fall back to
|
||||
// the importing sourcemap's `sourcesContent` field.
|
||||
const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;
|
||||
const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false;
|
||||
return OriginalSource(source, sourceContent, ignored);
|
||||
});
|
||||
return MapSource(map, children);
|
||||
}
|
||||
|
||||
/**
|
||||
* A SourceMap v3 compatible sourcemap, which only includes fields that were
|
||||
* provided to it.
|
||||
*/
|
||||
class SourceMap {
|
||||
constructor(map, options) {
|
||||
const out = options.decodedMappings ? genMapping.toDecodedMap(map) : genMapping.toEncodedMap(map);
|
||||
this.version = out.version; // SourceMap spec says this should be first.
|
||||
this.file = out.file;
|
||||
this.mappings = out.mappings;
|
||||
this.names = out.names;
|
||||
this.ignoreList = out.ignoreList;
|
||||
this.sourceRoot = out.sourceRoot;
|
||||
this.sources = out.sources;
|
||||
if (!options.excludeContent) {
|
||||
this.sourcesContent = out.sourcesContent;
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Traces through all the mappings in the root sourcemap, through the sources
|
||||
* (and their sourcemaps), all the way back to the original source location.
|
||||
*
|
||||
* `loader` will be called every time we encounter a source file. If it returns
|
||||
* a sourcemap, we will recurse into that sourcemap to continue the trace. If
|
||||
* it returns a falsey value, that source file is treated as an original,
|
||||
* unmodified source file.
|
||||
*
|
||||
* Pass `excludeContent` to exclude any self-containing source file content
|
||||
* from the output sourcemap.
|
||||
*
|
||||
* Pass `decodedMappings` to receive a SourceMap with decoded (instead of
|
||||
* VLQ encoded) mappings.
|
||||
*/
|
||||
function remapping(input, loader, options) {
|
||||
const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };
|
||||
const tree = buildSourceMapTree(input, loader);
|
||||
return new SourceMap(traceMappings(tree), opts);
|
||||
}
|
||||
|
||||
return remapping;
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=remapping.umd.js.map
|
||||
75
tools/eslint/node_modules/@ampproject/remapping/package.json
generated
vendored
75
tools/eslint/node_modules/@ampproject/remapping/package.json
generated
vendored
|
|
@ -1,75 +0,0 @@
|
|||
{
|
||||
"name": "@ampproject/remapping",
|
||||
"version": "2.3.0",
|
||||
"description": "Remap sequential sourcemaps through transformations to point at the original source code",
|
||||
"keywords": [
|
||||
"source",
|
||||
"map",
|
||||
"remap"
|
||||
],
|
||||
"main": "dist/remapping.umd.js",
|
||||
"module": "dist/remapping.mjs",
|
||||
"types": "dist/types/remapping.d.ts",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"types": "./dist/types/remapping.d.ts",
|
||||
"browser": "./dist/remapping.umd.js",
|
||||
"require": "./dist/remapping.umd.js",
|
||||
"import": "./dist/remapping.mjs"
|
||||
},
|
||||
"./dist/remapping.umd.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"author": "Justin Ridgewell <jridgewell@google.com>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ampproject/remapping.git"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "run-s -n build:*",
|
||||
"build:rollup": "rollup -c rollup.config.js",
|
||||
"build:ts": "tsc --project tsconfig.build.json",
|
||||
"lint": "run-s -n lint:*",
|
||||
"lint:prettier": "npm run test:lint:prettier -- --write",
|
||||
"lint:ts": "npm run test:lint:ts -- --fix",
|
||||
"prebuild": "rm -rf dist",
|
||||
"prepublishOnly": "npm run preversion",
|
||||
"preversion": "run-s test build",
|
||||
"test": "run-s -n test:lint test:only",
|
||||
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
||||
"test:lint": "run-s -n test:lint:*",
|
||||
"test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
|
||||
"test:lint:ts": "eslint '{src,test}/**/*.ts'",
|
||||
"test:only": "jest --coverage",
|
||||
"test:watch": "jest --coverage --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-typescript": "8.3.2",
|
||||
"@types/jest": "27.4.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.20.0",
|
||||
"@typescript-eslint/parser": "5.20.0",
|
||||
"eslint": "8.14.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"jest": "27.5.1",
|
||||
"jest-config": "27.5.1",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "2.6.2",
|
||||
"rollup": "2.70.2",
|
||||
"ts-jest": "27.1.4",
|
||||
"tslib": "2.4.0",
|
||||
"typescript": "4.6.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jridgewell/gen-mapping": "^0.3.5",
|
||||
"@jridgewell/trace-mapping": "^0.3.24"
|
||||
}
|
||||
}
|
||||
22
tools/eslint/node_modules/@babel/code-frame/LICENSE
generated
vendored
22
tools/eslint/node_modules/@babel/code-frame/LICENSE
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
156
tools/eslint/node_modules/@babel/code-frame/lib/index.js
generated
vendored
156
tools/eslint/node_modules/@babel/code-frame/lib/index.js
generated
vendored
|
|
@ -1,156 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.codeFrameColumns = codeFrameColumns;
|
||||
exports.default = _default;
|
||||
var _highlight = require("@babel/highlight");
|
||||
var _picocolors = _interopRequireWildcard(require("picocolors"), true);
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
const colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
|
||||
const compose = (f, g) => v => f(g(v));
|
||||
let pcWithForcedColor = undefined;
|
||||
function getColors(forceColor) {
|
||||
if (forceColor) {
|
||||
var _pcWithForcedColor;
|
||||
(_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);
|
||||
return pcWithForcedColor;
|
||||
}
|
||||
return colors;
|
||||
}
|
||||
let deprecationWarningShown = false;
|
||||
function getDefs(colors) {
|
||||
return {
|
||||
gutter: colors.gray,
|
||||
marker: compose(colors.red, colors.bold),
|
||||
message: compose(colors.red, colors.bold)
|
||||
};
|
||||
}
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
function getMarkerLines(loc, source, opts) {
|
||||
const startLoc = Object.assign({
|
||||
column: 0,
|
||||
line: -1
|
||||
}, loc.start);
|
||||
const endLoc = Object.assign({}, startLoc, loc.end);
|
||||
const {
|
||||
linesAbove = 2,
|
||||
linesBelow = 3
|
||||
} = opts || {};
|
||||
const startLine = startLoc.line;
|
||||
const startColumn = startLoc.column;
|
||||
const endLine = endLoc.line;
|
||||
const endColumn = endLoc.column;
|
||||
let start = Math.max(startLine - (linesAbove + 1), 0);
|
||||
let end = Math.min(source.length, endLine + linesBelow);
|
||||
if (startLine === -1) {
|
||||
start = 0;
|
||||
}
|
||||
if (endLine === -1) {
|
||||
end = source.length;
|
||||
}
|
||||
const lineDiff = endLine - startLine;
|
||||
const markerLines = {};
|
||||
if (lineDiff) {
|
||||
for (let i = 0; i <= lineDiff; i++) {
|
||||
const lineNumber = i + startLine;
|
||||
if (!startColumn) {
|
||||
markerLines[lineNumber] = true;
|
||||
} else if (i === 0) {
|
||||
const sourceLength = source[lineNumber - 1].length;
|
||||
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
||||
} else if (i === lineDiff) {
|
||||
markerLines[lineNumber] = [0, endColumn];
|
||||
} else {
|
||||
const sourceLength = source[lineNumber - i].length;
|
||||
markerLines[lineNumber] = [0, sourceLength];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (startColumn === endColumn) {
|
||||
if (startColumn) {
|
||||
markerLines[startLine] = [startColumn, 0];
|
||||
} else {
|
||||
markerLines[startLine] = true;
|
||||
}
|
||||
} else {
|
||||
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
||||
}
|
||||
}
|
||||
return {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
};
|
||||
}
|
||||
function codeFrameColumns(rawLines, loc, opts = {}) {
|
||||
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
||||
const colors = getColors(opts.forceColor);
|
||||
const defs = getDefs(colors);
|
||||
const maybeHighlight = (fmt, string) => {
|
||||
return highlighted ? fmt(string) : string;
|
||||
};
|
||||
const lines = rawLines.split(NEWLINE);
|
||||
const {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
} = getMarkerLines(loc, lines, opts);
|
||||
const hasColumns = loc.start && typeof loc.start.column === "number";
|
||||
const numberMaxWidth = String(end).length;
|
||||
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
|
||||
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
|
||||
const number = start + 1 + index;
|
||||
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
||||
const gutter = ` ${paddedNumber} |`;
|
||||
const hasMarker = markerLines[number];
|
||||
const lastMarkerLine = !markerLines[number + 1];
|
||||
if (hasMarker) {
|
||||
let markerLine = "";
|
||||
if (Array.isArray(hasMarker)) {
|
||||
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
||||
const numberOfMarkers = hasMarker[1] || 1;
|
||||
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
|
||||
if (lastMarkerLine && opts.message) {
|
||||
markerLine += " " + maybeHighlight(defs.message, opts.message);
|
||||
}
|
||||
}
|
||||
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
||||
} else {
|
||||
return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
||||
}
|
||||
}).join("\n");
|
||||
if (opts.message && !hasColumns) {
|
||||
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
||||
}
|
||||
if (highlighted) {
|
||||
return colors.reset(frame);
|
||||
} else {
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
function _default(rawLines, lineNumber, colNumber, opts = {}) {
|
||||
if (!deprecationWarningShown) {
|
||||
deprecationWarningShown = true;
|
||||
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
||||
if (process.emitWarning) {
|
||||
process.emitWarning(message, "DeprecationWarning");
|
||||
} else {
|
||||
const deprecationError = new Error(message);
|
||||
deprecationError.name = "DeprecationWarning";
|
||||
console.warn(new Error(message));
|
||||
}
|
||||
}
|
||||
colNumber = Math.max(colNumber, 0);
|
||||
const location = {
|
||||
start: {
|
||||
column: colNumber,
|
||||
line: lineNumber
|
||||
}
|
||||
};
|
||||
return codeFrameColumns(rawLines, location, opts);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
30
tools/eslint/node_modules/@babel/code-frame/package.json
generated
vendored
30
tools/eslint/node_modules/@babel/code-frame/package.json
generated
vendored
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
"name": "@babel/code-frame",
|
||||
"version": "7.24.7",
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-code-frame",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-code-frame"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/highlight": "^7.24.7",
|
||||
"picocolors": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"import-meta-resolve": "^4.1.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
22
tools/eslint/node_modules/@babel/compat-data/LICENSE
generated
vendored
22
tools/eslint/node_modules/@babel/compat-data/LICENSE
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
2
tools/eslint/node_modules/@babel/compat-data/corejs2-built-ins.js
generated
vendored
2
tools/eslint/node_modules/@babel/compat-data/corejs2-built-ins.js
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
// Todo (Babel 8): remove this file as Babel 8 drop support of core-js 2
|
||||
module.exports = require("./data/corejs2-built-ins.json");
|
||||
2
tools/eslint/node_modules/@babel/compat-data/corejs3-shipped-proposals.js
generated
vendored
2
tools/eslint/node_modules/@babel/compat-data/corejs3-shipped-proposals.js
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
// Todo (Babel 8): remove this file now that it is included in babel-plugin-polyfill-corejs3
|
||||
module.exports = require("./data/corejs3-shipped-proposals.json");
|
||||
2090
tools/eslint/node_modules/@babel/compat-data/data/corejs2-built-ins.json
generated
vendored
2090
tools/eslint/node_modules/@babel/compat-data/data/corejs2-built-ins.json
generated
vendored
File diff suppressed because it is too large
Load Diff
5
tools/eslint/node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json
generated
vendored
5
tools/eslint/node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
[
|
||||
"esnext.promise.all-settled",
|
||||
"esnext.string.match-all",
|
||||
"esnext.global-this"
|
||||
]
|
||||
18
tools/eslint/node_modules/@babel/compat-data/data/native-modules.json
generated
vendored
18
tools/eslint/node_modules/@babel/compat-data/data/native-modules.json
generated
vendored
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"es6.module": {
|
||||
"chrome": "61",
|
||||
"and_chr": "61",
|
||||
"edge": "16",
|
||||
"firefox": "60",
|
||||
"and_ff": "60",
|
||||
"node": "13.2.0",
|
||||
"opera": "48",
|
||||
"op_mob": "45",
|
||||
"safari": "10.1",
|
||||
"ios": "10.3",
|
||||
"samsung": "8.2",
|
||||
"android": "61",
|
||||
"electron": "2.0",
|
||||
"ios_saf": "10.3"
|
||||
}
|
||||
}
|
||||
35
tools/eslint/node_modules/@babel/compat-data/data/overlapping-plugins.json
generated
vendored
35
tools/eslint/node_modules/@babel/compat-data/data/overlapping-plugins.json
generated
vendored
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"transform-async-to-generator": [
|
||||
"bugfix/transform-async-arrows-in-class"
|
||||
],
|
||||
"transform-parameters": [
|
||||
"bugfix/transform-edge-default-parameters",
|
||||
"bugfix/transform-safari-id-destructuring-collision-in-function-expression"
|
||||
],
|
||||
"transform-function-name": [
|
||||
"bugfix/transform-edge-function-name"
|
||||
],
|
||||
"transform-block-scoping": [
|
||||
"bugfix/transform-safari-block-shadowing",
|
||||
"bugfix/transform-safari-for-shadowing"
|
||||
],
|
||||
"transform-template-literals": [
|
||||
"bugfix/transform-tagged-template-caching"
|
||||
],
|
||||
"transform-optional-chaining": [
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
|
||||
],
|
||||
"proposal-optional-chaining": [
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
|
||||
],
|
||||
"transform-class-properties": [
|
||||
"bugfix/transform-v8-static-class-fields-redefine-readonly",
|
||||
"bugfix/transform-firefox-class-in-computed-class-key",
|
||||
"bugfix/transform-safari-class-field-initializer-scope"
|
||||
],
|
||||
"proposal-class-properties": [
|
||||
"bugfix/transform-v8-static-class-fields-redefine-readonly",
|
||||
"bugfix/transform-firefox-class-in-computed-class-key",
|
||||
"bugfix/transform-safari-class-field-initializer-scope"
|
||||
]
|
||||
}
|
||||
213
tools/eslint/node_modules/@babel/compat-data/data/plugin-bugfixes.json
generated
vendored
213
tools/eslint/node_modules/@babel/compat-data/data/plugin-bugfixes.json
generated
vendored
|
|
@ -1,213 +0,0 @@
|
|||
{
|
||||
"bugfix/transform-async-arrows-in-class": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "11",
|
||||
"node": "7.6",
|
||||
"deno": "1",
|
||||
"ios": "11",
|
||||
"samsung": "6",
|
||||
"opera_mobile": "42",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"bugfix/transform-edge-default-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "18",
|
||||
"firefox": "52",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-edge-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "79",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"bugfix/transform-safari-block-shadowing": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "12",
|
||||
"firefox": "44",
|
||||
"safari": "11",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ie": "11",
|
||||
"ios": "11",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-safari-for-shadowing": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "12",
|
||||
"firefox": "4",
|
||||
"safari": "11",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ie": "11",
|
||||
"ios": "11",
|
||||
"samsung": "5",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-safari-id-destructuring-collision-in-function-expression": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "14",
|
||||
"firefox": "2",
|
||||
"safari": "16.3",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "16.3",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-tagged-template-caching": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "13",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "3.4",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "13.4",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"bugfix/transform-firefox-class-in-computed-class-key": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"safari": "16",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "16",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"transform-optional-chaining": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
"edge": "80",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "14",
|
||||
"deno": "1",
|
||||
"ios": "13.4",
|
||||
"samsung": "13",
|
||||
"opera_mobile": "57",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"proposal-optional-chaining": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
"edge": "80",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "14",
|
||||
"deno": "1",
|
||||
"ios": "13.4",
|
||||
"samsung": "13",
|
||||
"opera_mobile": "57",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"transform-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-async-to-generator": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "10.1",
|
||||
"node": "7.6",
|
||||
"deno": "1",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"opera_mobile": "42",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"transform-template-literals": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "13",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"transform-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "14",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
"edge": "14",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
}
|
||||
}
|
||||
814
tools/eslint/node_modules/@babel/compat-data/data/plugins.json
generated
vendored
814
tools/eslint/node_modules/@babel/compat-data/data/plugins.json
generated
vendored
|
|
@ -1,814 +0,0 @@
|
|||
{
|
||||
"transform-duplicate-named-capturing-groups-regex": {
|
||||
"chrome": "126",
|
||||
"edge": "126",
|
||||
"firefox": "129",
|
||||
"safari": "17.4",
|
||||
"electron": "31.0"
|
||||
},
|
||||
"transform-unicode-sets-regex": {
|
||||
"chrome": "112",
|
||||
"opera": "98",
|
||||
"edge": "112",
|
||||
"firefox": "116",
|
||||
"safari": "17",
|
||||
"node": "20",
|
||||
"deno": "1.32",
|
||||
"ios": "17",
|
||||
"opera_mobile": "75",
|
||||
"electron": "24.0"
|
||||
},
|
||||
"bugfix/transform-v8-static-class-fields-redefine-readonly": {
|
||||
"chrome": "98",
|
||||
"opera": "84",
|
||||
"edge": "98",
|
||||
"firefox": "95",
|
||||
"safari": "15",
|
||||
"node": "12",
|
||||
"deno": "1.18",
|
||||
"ios": "15",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "52",
|
||||
"electron": "17.0"
|
||||
},
|
||||
"bugfix/transform-firefox-class-in-computed-class-key": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"safari": "16",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "16",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"bugfix/transform-safari-class-field-initializer-scope": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "69",
|
||||
"safari": "16",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "16",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"transform-class-static-block": {
|
||||
"chrome": "94",
|
||||
"opera": "80",
|
||||
"edge": "94",
|
||||
"firefox": "93",
|
||||
"safari": "16.4",
|
||||
"node": "16.11",
|
||||
"deno": "1.14",
|
||||
"ios": "16.4",
|
||||
"samsung": "17",
|
||||
"opera_mobile": "66",
|
||||
"electron": "15.0"
|
||||
},
|
||||
"proposal-class-static-block": {
|
||||
"chrome": "94",
|
||||
"opera": "80",
|
||||
"edge": "94",
|
||||
"firefox": "93",
|
||||
"safari": "16.4",
|
||||
"node": "16.11",
|
||||
"deno": "1.14",
|
||||
"ios": "16.4",
|
||||
"samsung": "17",
|
||||
"opera_mobile": "66",
|
||||
"electron": "15.0"
|
||||
},
|
||||
"transform-private-property-in-object": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "90",
|
||||
"safari": "15",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "15",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"proposal-private-property-in-object": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "90",
|
||||
"safari": "15",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "15",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"transform-class-properties": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "90",
|
||||
"safari": "14.1",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "14.5",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"proposal-class-properties": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "90",
|
||||
"safari": "14.1",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "14.5",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"transform-private-methods": {
|
||||
"chrome": "84",
|
||||
"opera": "70",
|
||||
"edge": "84",
|
||||
"firefox": "90",
|
||||
"safari": "15",
|
||||
"node": "14.6",
|
||||
"deno": "1",
|
||||
"ios": "15",
|
||||
"samsung": "14",
|
||||
"opera_mobile": "60",
|
||||
"electron": "10.0"
|
||||
},
|
||||
"proposal-private-methods": {
|
||||
"chrome": "84",
|
||||
"opera": "70",
|
||||
"edge": "84",
|
||||
"firefox": "90",
|
||||
"safari": "15",
|
||||
"node": "14.6",
|
||||
"deno": "1",
|
||||
"ios": "15",
|
||||
"samsung": "14",
|
||||
"opera_mobile": "60",
|
||||
"electron": "10.0"
|
||||
},
|
||||
"transform-numeric-separator": {
|
||||
"chrome": "75",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "70",
|
||||
"safari": "13",
|
||||
"node": "12.5",
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "11",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "54",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"proposal-numeric-separator": {
|
||||
"chrome": "75",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "70",
|
||||
"safari": "13",
|
||||
"node": "12.5",
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "11",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "54",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"transform-logical-assignment-operators": {
|
||||
"chrome": "85",
|
||||
"opera": "71",
|
||||
"edge": "85",
|
||||
"firefox": "79",
|
||||
"safari": "14",
|
||||
"node": "15",
|
||||
"deno": "1.2",
|
||||
"ios": "14",
|
||||
"samsung": "14",
|
||||
"opera_mobile": "60",
|
||||
"electron": "10.0"
|
||||
},
|
||||
"proposal-logical-assignment-operators": {
|
||||
"chrome": "85",
|
||||
"opera": "71",
|
||||
"edge": "85",
|
||||
"firefox": "79",
|
||||
"safari": "14",
|
||||
"node": "15",
|
||||
"deno": "1.2",
|
||||
"ios": "14",
|
||||
"samsung": "14",
|
||||
"opera_mobile": "60",
|
||||
"electron": "10.0"
|
||||
},
|
||||
"transform-nullish-coalescing-operator": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
"edge": "80",
|
||||
"firefox": "72",
|
||||
"safari": "13.1",
|
||||
"node": "14",
|
||||
"deno": "1",
|
||||
"ios": "13.4",
|
||||
"samsung": "13",
|
||||
"opera_mobile": "57",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"proposal-nullish-coalescing-operator": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
"edge": "80",
|
||||
"firefox": "72",
|
||||
"safari": "13.1",
|
||||
"node": "14",
|
||||
"deno": "1",
|
||||
"ios": "13.4",
|
||||
"samsung": "13",
|
||||
"opera_mobile": "57",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"transform-optional-chaining": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "13.4",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"proposal-optional-chaining": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "13.4",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"transform-json-strings": {
|
||||
"chrome": "66",
|
||||
"opera": "53",
|
||||
"edge": "79",
|
||||
"firefox": "62",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "9",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-json-strings": {
|
||||
"chrome": "66",
|
||||
"opera": "53",
|
||||
"edge": "79",
|
||||
"firefox": "62",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "9",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-optional-catch-binding": {
|
||||
"chrome": "66",
|
||||
"opera": "53",
|
||||
"edge": "79",
|
||||
"firefox": "58",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-optional-catch-binding": {
|
||||
"chrome": "66",
|
||||
"opera": "53",
|
||||
"edge": "79",
|
||||
"firefox": "58",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "18",
|
||||
"firefox": "53",
|
||||
"safari": "16.3",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "16.3",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-async-generator-functions": {
|
||||
"chrome": "63",
|
||||
"opera": "50",
|
||||
"edge": "79",
|
||||
"firefox": "57",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "8",
|
||||
"opera_mobile": "46",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-async-generator-functions": {
|
||||
"chrome": "63",
|
||||
"opera": "50",
|
||||
"edge": "79",
|
||||
"firefox": "57",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "8",
|
||||
"opera_mobile": "46",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-object-rest-spread": {
|
||||
"chrome": "60",
|
||||
"opera": "47",
|
||||
"edge": "79",
|
||||
"firefox": "55",
|
||||
"safari": "11.1",
|
||||
"node": "8.3",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "8",
|
||||
"opera_mobile": "44",
|
||||
"electron": "2.0"
|
||||
},
|
||||
"proposal-object-rest-spread": {
|
||||
"chrome": "60",
|
||||
"opera": "47",
|
||||
"edge": "79",
|
||||
"firefox": "55",
|
||||
"safari": "11.1",
|
||||
"node": "8.3",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "8",
|
||||
"opera_mobile": "44",
|
||||
"electron": "2.0"
|
||||
},
|
||||
"transform-dotall-regex": {
|
||||
"chrome": "62",
|
||||
"opera": "49",
|
||||
"edge": "79",
|
||||
"firefox": "78",
|
||||
"safari": "11.1",
|
||||
"node": "8.10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "8",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "46",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-unicode-property-regex": {
|
||||
"chrome": "64",
|
||||
"opera": "51",
|
||||
"edge": "79",
|
||||
"firefox": "78",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-unicode-property-regex": {
|
||||
"chrome": "64",
|
||||
"opera": "51",
|
||||
"edge": "79",
|
||||
"firefox": "78",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-named-capturing-groups-regex": {
|
||||
"chrome": "64",
|
||||
"opera": "51",
|
||||
"edge": "79",
|
||||
"firefox": "78",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-async-to-generator": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "11",
|
||||
"node": "7.6",
|
||||
"deno": "1",
|
||||
"ios": "11",
|
||||
"samsung": "6",
|
||||
"opera_mobile": "42",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"transform-exponentiation-operator": {
|
||||
"chrome": "52",
|
||||
"opera": "39",
|
||||
"edge": "14",
|
||||
"firefox": "52",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"deno": "1",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.3"
|
||||
},
|
||||
"transform-template-literals": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "13",
|
||||
"firefox": "34",
|
||||
"safari": "13",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "3.4",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"transform-literals": {
|
||||
"chrome": "44",
|
||||
"opera": "31",
|
||||
"edge": "12",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "32",
|
||||
"electron": "0.30"
|
||||
},
|
||||
"transform-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "79",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-arrow-functions": {
|
||||
"chrome": "47",
|
||||
"opera": "34",
|
||||
"edge": "13",
|
||||
"firefox": "43",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "34",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-block-scoped-functions": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "12",
|
||||
"firefox": "46",
|
||||
"safari": "10",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ie": "11",
|
||||
"ios": "10",
|
||||
"samsung": "3.4",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"transform-classes": {
|
||||
"chrome": "46",
|
||||
"opera": "33",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-object-super": {
|
||||
"chrome": "46",
|
||||
"opera": "33",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-shorthand-properties": {
|
||||
"chrome": "43",
|
||||
"opera": "30",
|
||||
"edge": "12",
|
||||
"firefox": "33",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "30",
|
||||
"electron": "0.27"
|
||||
},
|
||||
"transform-duplicate-keys": {
|
||||
"chrome": "42",
|
||||
"opera": "29",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"opera_mobile": "29",
|
||||
"electron": "0.25"
|
||||
},
|
||||
"transform-computed-properties": {
|
||||
"chrome": "44",
|
||||
"opera": "31",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "8",
|
||||
"samsung": "4",
|
||||
"opera_mobile": "32",
|
||||
"electron": "0.30"
|
||||
},
|
||||
"transform-for-of": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-sticky-regex": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "13",
|
||||
"firefox": "3",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-unicode-escapes": {
|
||||
"chrome": "44",
|
||||
"opera": "31",
|
||||
"edge": "12",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "32",
|
||||
"electron": "0.30"
|
||||
},
|
||||
"transform-unicode-regex": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
"edge": "13",
|
||||
"firefox": "46",
|
||||
"safari": "12",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"transform-spread": {
|
||||
"chrome": "46",
|
||||
"opera": "33",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-destructuring": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
"edge": "14",
|
||||
"firefox": "53",
|
||||
"safari": "11",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "11",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"transform-typeof-symbol": {
|
||||
"chrome": "38",
|
||||
"opera": "25",
|
||||
"edge": "12",
|
||||
"firefox": "36",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "3",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "25",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"transform-new-target": {
|
||||
"chrome": "46",
|
||||
"opera": "33",
|
||||
"edge": "14",
|
||||
"firefox": "41",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-regenerator": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
"edge": "13",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"transform-member-expression-literals": {
|
||||
"chrome": "7",
|
||||
"opera": "12",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "5.1",
|
||||
"node": "0.4",
|
||||
"deno": "1",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "12",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"transform-property-literals": {
|
||||
"chrome": "7",
|
||||
"opera": "12",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "5.1",
|
||||
"node": "0.4",
|
||||
"deno": "1",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "12",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"transform-reserved-words": {
|
||||
"chrome": "13",
|
||||
"opera": "10.50",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.6",
|
||||
"deno": "1",
|
||||
"ie": "9",
|
||||
"android": "4.4",
|
||||
"ios": "6",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "10.1",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"transform-export-namespace-from": {
|
||||
"chrome": "72",
|
||||
"deno": "1.0",
|
||||
"edge": "79",
|
||||
"firefox": "80",
|
||||
"node": "13.2",
|
||||
"opera": "60",
|
||||
"opera_mobile": "51",
|
||||
"safari": "14.1",
|
||||
"ios": "14.5",
|
||||
"samsung": "11.0",
|
||||
"android": "72",
|
||||
"electron": "5.0"
|
||||
},
|
||||
"proposal-export-namespace-from": {
|
||||
"chrome": "72",
|
||||
"deno": "1.0",
|
||||
"edge": "79",
|
||||
"firefox": "80",
|
||||
"node": "13.2",
|
||||
"opera": "60",
|
||||
"opera_mobile": "51",
|
||||
"safari": "14.1",
|
||||
"ios": "14.5",
|
||||
"samsung": "11.0",
|
||||
"android": "72",
|
||||
"electron": "5.0"
|
||||
}
|
||||
}
|
||||
1
tools/eslint/node_modules/@babel/compat-data/native-modules.js
generated
vendored
1
tools/eslint/node_modules/@babel/compat-data/native-modules.js
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
module.exports = require("./data/native-modules.json");
|
||||
1
tools/eslint/node_modules/@babel/compat-data/overlapping-plugins.js
generated
vendored
1
tools/eslint/node_modules/@babel/compat-data/overlapping-plugins.js
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
module.exports = require("./data/overlapping-plugins.json");
|
||||
40
tools/eslint/node_modules/@babel/compat-data/package.json
generated
vendored
40
tools/eslint/node_modules/@babel/compat-data/package.json
generated
vendored
|
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
"name": "@babel/compat-data",
|
||||
"version": "7.25.0",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-compat-data"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"exports": {
|
||||
"./plugins": "./plugins.js",
|
||||
"./native-modules": "./native-modules.js",
|
||||
"./corejs2-built-ins": "./corejs2-built-ins.js",
|
||||
"./corejs3-shipped-proposals": "./corejs3-shipped-proposals.js",
|
||||
"./overlapping-plugins": "./overlapping-plugins.js",
|
||||
"./plugin-bugfixes": "./plugin-bugfixes.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build-data": "./scripts/download-compat-table.sh && node ./scripts/build-data.js && node ./scripts/build-modules-support.js && node ./scripts/build-bugfixes-targets.js"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
"compat-table",
|
||||
"compat-data"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@mdn/browser-compat-data": "^5.5.36",
|
||||
"core-js-compat": "^3.37.1",
|
||||
"electron-to-chromium": "^1.4.816"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
1
tools/eslint/node_modules/@babel/compat-data/plugin-bugfixes.js
generated
vendored
1
tools/eslint/node_modules/@babel/compat-data/plugin-bugfixes.js
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
module.exports = require("./data/plugin-bugfixes.json");
|
||||
1
tools/eslint/node_modules/@babel/compat-data/plugins.js
generated
vendored
1
tools/eslint/node_modules/@babel/compat-data/plugins.js
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
module.exports = require("./data/plugins.json");
|
||||
22
tools/eslint/node_modules/@babel/core/LICENSE
generated
vendored
22
tools/eslint/node_modules/@babel/core/LICENSE
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
59
tools/eslint/node_modules/@babel/core/cjs-proxy.cjs
generated
vendored
59
tools/eslint/node_modules/@babel/core/cjs-proxy.cjs
generated
vendored
|
|
@ -1,59 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
const babelP = import("./lib/index.js");
|
||||
let babel = null;
|
||||
Object.defineProperty(exports, "__ initialize @babel/core cjs proxy __", {
|
||||
set(val) {
|
||||
babel = val;
|
||||
},
|
||||
});
|
||||
|
||||
exports.version = require("./package.json").version;
|
||||
|
||||
const functionNames = [
|
||||
"createConfigItem",
|
||||
"loadPartialConfig",
|
||||
"loadOptions",
|
||||
"transform",
|
||||
"transformFile",
|
||||
"transformFromAst",
|
||||
"parse",
|
||||
];
|
||||
const propertyNames = [
|
||||
"buildExternalHelpers",
|
||||
"types",
|
||||
"tokTypes",
|
||||
"traverse",
|
||||
"template",
|
||||
];
|
||||
|
||||
for (const name of functionNames) {
|
||||
exports[name] = function (...args) {
|
||||
babelP.then(babel => {
|
||||
babel[name](...args);
|
||||
});
|
||||
};
|
||||
exports[`${name}Async`] = function (...args) {
|
||||
return babelP.then(babel => babel[`${name}Async`](...args));
|
||||
};
|
||||
exports[`${name}Sync`] = function (...args) {
|
||||
if (!babel) throw notLoadedError(`${name}Sync`, "callable");
|
||||
return babel[`${name}Sync`](...args);
|
||||
};
|
||||
}
|
||||
|
||||
for (const name of propertyNames) {
|
||||
Object.defineProperty(exports, name, {
|
||||
get() {
|
||||
if (!babel) throw notLoadedError(name, "accessible");
|
||||
return babel[name];
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function notLoadedError(name, keyword) {
|
||||
return new Error(
|
||||
`The \`${name}\` export of @babel/core is only ${keyword}` +
|
||||
` from the CommonJS version after that the ESM version is loaded.`
|
||||
);
|
||||
}
|
||||
3
tools/eslint/node_modules/@babel/core/lib/config/cache-contexts.js
generated
vendored
3
tools/eslint/node_modules/@babel/core/lib/config/cache-contexts.js
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=cache-contexts.js.map
|
||||
261
tools/eslint/node_modules/@babel/core/lib/config/caching.js
generated
vendored
261
tools/eslint/node_modules/@babel/core/lib/config/caching.js
generated
vendored
|
|
@ -1,261 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.assertSimpleType = assertSimpleType;
|
||||
exports.makeStrongCache = makeStrongCache;
|
||||
exports.makeStrongCacheSync = makeStrongCacheSync;
|
||||
exports.makeWeakCache = makeWeakCache;
|
||||
exports.makeWeakCacheSync = makeWeakCacheSync;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _async = require("../gensync-utils/async.js");
|
||||
var _util = require("./util.js");
|
||||
const synchronize = gen => {
|
||||
return _gensync()(gen).sync;
|
||||
};
|
||||
function* genTrue() {
|
||||
return true;
|
||||
}
|
||||
function makeWeakCache(handler) {
|
||||
return makeCachedFunction(WeakMap, handler);
|
||||
}
|
||||
function makeWeakCacheSync(handler) {
|
||||
return synchronize(makeWeakCache(handler));
|
||||
}
|
||||
function makeStrongCache(handler) {
|
||||
return makeCachedFunction(Map, handler);
|
||||
}
|
||||
function makeStrongCacheSync(handler) {
|
||||
return synchronize(makeStrongCache(handler));
|
||||
}
|
||||
function makeCachedFunction(CallCache, handler) {
|
||||
const callCacheSync = new CallCache();
|
||||
const callCacheAsync = new CallCache();
|
||||
const futureCache = new CallCache();
|
||||
return function* cachedFunction(arg, data) {
|
||||
const asyncContext = yield* (0, _async.isAsync)();
|
||||
const callCache = asyncContext ? callCacheAsync : callCacheSync;
|
||||
const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data);
|
||||
if (cached.valid) return cached.value;
|
||||
const cache = new CacheConfigurator(data);
|
||||
const handlerResult = handler(arg, cache);
|
||||
let finishLock;
|
||||
let value;
|
||||
if ((0, _util.isIterableIterator)(handlerResult)) {
|
||||
value = yield* (0, _async.onFirstPause)(handlerResult, () => {
|
||||
finishLock = setupAsyncLocks(cache, futureCache, arg);
|
||||
});
|
||||
} else {
|
||||
value = handlerResult;
|
||||
}
|
||||
updateFunctionCache(callCache, cache, arg, value);
|
||||
if (finishLock) {
|
||||
futureCache.delete(arg);
|
||||
finishLock.release(value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
function* getCachedValue(cache, arg, data) {
|
||||
const cachedValue = cache.get(arg);
|
||||
if (cachedValue) {
|
||||
for (const {
|
||||
value,
|
||||
valid
|
||||
} of cachedValue) {
|
||||
if (yield* valid(data)) return {
|
||||
valid: true,
|
||||
value
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
valid: false,
|
||||
value: null
|
||||
};
|
||||
}
|
||||
function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) {
|
||||
const cached = yield* getCachedValue(callCache, arg, data);
|
||||
if (cached.valid) {
|
||||
return cached;
|
||||
}
|
||||
if (asyncContext) {
|
||||
const cached = yield* getCachedValue(futureCache, arg, data);
|
||||
if (cached.valid) {
|
||||
const value = yield* (0, _async.waitFor)(cached.value.promise);
|
||||
return {
|
||||
valid: true,
|
||||
value
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
valid: false,
|
||||
value: null
|
||||
};
|
||||
}
|
||||
function setupAsyncLocks(config, futureCache, arg) {
|
||||
const finishLock = new Lock();
|
||||
updateFunctionCache(futureCache, config, arg, finishLock);
|
||||
return finishLock;
|
||||
}
|
||||
function updateFunctionCache(cache, config, arg, value) {
|
||||
if (!config.configured()) config.forever();
|
||||
let cachedValue = cache.get(arg);
|
||||
config.deactivate();
|
||||
switch (config.mode()) {
|
||||
case "forever":
|
||||
cachedValue = [{
|
||||
value,
|
||||
valid: genTrue
|
||||
}];
|
||||
cache.set(arg, cachedValue);
|
||||
break;
|
||||
case "invalidate":
|
||||
cachedValue = [{
|
||||
value,
|
||||
valid: config.validator()
|
||||
}];
|
||||
cache.set(arg, cachedValue);
|
||||
break;
|
||||
case "valid":
|
||||
if (cachedValue) {
|
||||
cachedValue.push({
|
||||
value,
|
||||
valid: config.validator()
|
||||
});
|
||||
} else {
|
||||
cachedValue = [{
|
||||
value,
|
||||
valid: config.validator()
|
||||
}];
|
||||
cache.set(arg, cachedValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
class CacheConfigurator {
|
||||
constructor(data) {
|
||||
this._active = true;
|
||||
this._never = false;
|
||||
this._forever = false;
|
||||
this._invalidate = false;
|
||||
this._configured = false;
|
||||
this._pairs = [];
|
||||
this._data = void 0;
|
||||
this._data = data;
|
||||
}
|
||||
simple() {
|
||||
return makeSimpleConfigurator(this);
|
||||
}
|
||||
mode() {
|
||||
if (this._never) return "never";
|
||||
if (this._forever) return "forever";
|
||||
if (this._invalidate) return "invalidate";
|
||||
return "valid";
|
||||
}
|
||||
forever() {
|
||||
if (!this._active) {
|
||||
throw new Error("Cannot change caching after evaluation has completed.");
|
||||
}
|
||||
if (this._never) {
|
||||
throw new Error("Caching has already been configured with .never()");
|
||||
}
|
||||
this._forever = true;
|
||||
this._configured = true;
|
||||
}
|
||||
never() {
|
||||
if (!this._active) {
|
||||
throw new Error("Cannot change caching after evaluation has completed.");
|
||||
}
|
||||
if (this._forever) {
|
||||
throw new Error("Caching has already been configured with .forever()");
|
||||
}
|
||||
this._never = true;
|
||||
this._configured = true;
|
||||
}
|
||||
using(handler) {
|
||||
if (!this._active) {
|
||||
throw new Error("Cannot change caching after evaluation has completed.");
|
||||
}
|
||||
if (this._never || this._forever) {
|
||||
throw new Error("Caching has already been configured with .never or .forever()");
|
||||
}
|
||||
this._configured = true;
|
||||
const key = handler(this._data);
|
||||
const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`);
|
||||
if ((0, _async.isThenable)(key)) {
|
||||
return key.then(key => {
|
||||
this._pairs.push([key, fn]);
|
||||
return key;
|
||||
});
|
||||
}
|
||||
this._pairs.push([key, fn]);
|
||||
return key;
|
||||
}
|
||||
invalidate(handler) {
|
||||
this._invalidate = true;
|
||||
return this.using(handler);
|
||||
}
|
||||
validator() {
|
||||
const pairs = this._pairs;
|
||||
return function* (data) {
|
||||
for (const [key, fn] of pairs) {
|
||||
if (key !== (yield* fn(data))) return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
deactivate() {
|
||||
this._active = false;
|
||||
}
|
||||
configured() {
|
||||
return this._configured;
|
||||
}
|
||||
}
|
||||
function makeSimpleConfigurator(cache) {
|
||||
function cacheFn(val) {
|
||||
if (typeof val === "boolean") {
|
||||
if (val) cache.forever();else cache.never();
|
||||
return;
|
||||
}
|
||||
return cache.using(() => assertSimpleType(val()));
|
||||
}
|
||||
cacheFn.forever = () => cache.forever();
|
||||
cacheFn.never = () => cache.never();
|
||||
cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));
|
||||
cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));
|
||||
return cacheFn;
|
||||
}
|
||||
function assertSimpleType(value) {
|
||||
if ((0, _async.isThenable)(value)) {
|
||||
throw new Error(`You appear to be using an async cache handler, ` + `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 handle your caching logic.`);
|
||||
}
|
||||
if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") {
|
||||
throw new Error("Cache keys must be either string, boolean, number, null, or undefined.");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
class Lock {
|
||||
constructor() {
|
||||
this.released = false;
|
||||
this.promise = void 0;
|
||||
this._resolve = void 0;
|
||||
this.promise = new Promise(resolve => {
|
||||
this._resolve = resolve;
|
||||
});
|
||||
}
|
||||
release(value) {
|
||||
this.released = true;
|
||||
this._resolve(value);
|
||||
}
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=caching.js.map
|
||||
469
tools/eslint/node_modules/@babel/core/lib/config/config-chain.js
generated
vendored
469
tools/eslint/node_modules/@babel/core/lib/config/config-chain.js
generated
vendored
|
|
@ -1,469 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.buildPresetChain = buildPresetChain;
|
||||
exports.buildPresetChainWalker = void 0;
|
||||
exports.buildRootChain = buildRootChain;
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _debug() {
|
||||
const data = require("debug");
|
||||
_debug = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _options = require("./validation/options.js");
|
||||
var _patternToRegex = require("./pattern-to-regex.js");
|
||||
var _printer = require("./printer.js");
|
||||
var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js");
|
||||
var _configError = require("../errors/config-error.js");
|
||||
var _index = require("./files/index.js");
|
||||
var _caching = require("./caching.js");
|
||||
var _configDescriptors = require("./config-descriptors.js");
|
||||
const debug = _debug()("babel:config:config-chain");
|
||||
function* buildPresetChain(arg, context) {
|
||||
const chain = yield* buildPresetChainWalker(arg, context);
|
||||
if (!chain) return null;
|
||||
return {
|
||||
plugins: dedupDescriptors(chain.plugins),
|
||||
presets: dedupDescriptors(chain.presets),
|
||||
options: chain.options.map(o => normalizeOptions(o)),
|
||||
files: new Set()
|
||||
};
|
||||
}
|
||||
const buildPresetChainWalker = exports.buildPresetChainWalker = makeChainWalker({
|
||||
root: preset => loadPresetDescriptors(preset),
|
||||
env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
|
||||
overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
|
||||
overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName),
|
||||
createLogger: () => () => {}
|
||||
});
|
||||
const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors));
|
||||
const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName)));
|
||||
const loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index)));
|
||||
const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName))));
|
||||
function* buildRootChain(opts, context) {
|
||||
let configReport, babelRcReport;
|
||||
const programmaticLogger = new _printer.ConfigPrinter();
|
||||
const programmaticChain = yield* loadProgrammaticChain({
|
||||
options: opts,
|
||||
dirname: context.cwd
|
||||
}, context, undefined, programmaticLogger);
|
||||
if (!programmaticChain) return null;
|
||||
const programmaticReport = yield* programmaticLogger.output();
|
||||
let configFile;
|
||||
if (typeof opts.configFile === "string") {
|
||||
configFile = yield* (0, _index.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);
|
||||
} else if (opts.configFile !== false) {
|
||||
configFile = yield* (0, _index.findRootConfig)(context.root, context.envName, context.caller);
|
||||
}
|
||||
let {
|
||||
babelrc,
|
||||
babelrcRoots
|
||||
} = opts;
|
||||
let babelrcRootsDirectory = context.cwd;
|
||||
const configFileChain = emptyChain();
|
||||
const configFileLogger = new _printer.ConfigPrinter();
|
||||
if (configFile) {
|
||||
const validatedFile = validateConfigFile(configFile);
|
||||
const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger);
|
||||
if (!result) return null;
|
||||
configReport = yield* configFileLogger.output();
|
||||
if (babelrc === undefined) {
|
||||
babelrc = validatedFile.options.babelrc;
|
||||
}
|
||||
if (babelrcRoots === undefined) {
|
||||
babelrcRootsDirectory = validatedFile.dirname;
|
||||
babelrcRoots = validatedFile.options.babelrcRoots;
|
||||
}
|
||||
mergeChain(configFileChain, result);
|
||||
}
|
||||
let ignoreFile, babelrcFile;
|
||||
let isIgnored = false;
|
||||
const fileChain = emptyChain();
|
||||
if ((babelrc === true || babelrc === undefined) && typeof context.filename === "string") {
|
||||
const pkgData = yield* (0, _index.findPackageData)(context.filename);
|
||||
if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) {
|
||||
({
|
||||
ignore: ignoreFile,
|
||||
config: babelrcFile
|
||||
} = yield* (0, _index.findRelativeConfig)(pkgData, context.envName, context.caller));
|
||||
if (ignoreFile) {
|
||||
fileChain.files.add(ignoreFile.filepath);
|
||||
}
|
||||
if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {
|
||||
isIgnored = true;
|
||||
}
|
||||
if (babelrcFile && !isIgnored) {
|
||||
const validatedFile = validateBabelrcFile(babelrcFile);
|
||||
const babelrcLogger = new _printer.ConfigPrinter();
|
||||
const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger);
|
||||
if (!result) {
|
||||
isIgnored = true;
|
||||
} else {
|
||||
babelRcReport = yield* babelrcLogger.output();
|
||||
mergeChain(fileChain, result);
|
||||
}
|
||||
}
|
||||
if (babelrcFile && isIgnored) {
|
||||
fileChain.files.add(babelrcFile.filepath);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (context.showConfig) {
|
||||
console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----");
|
||||
}
|
||||
const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);
|
||||
return {
|
||||
plugins: isIgnored ? [] : dedupDescriptors(chain.plugins),
|
||||
presets: isIgnored ? [] : dedupDescriptors(chain.presets),
|
||||
options: isIgnored ? [] : chain.options.map(o => normalizeOptions(o)),
|
||||
fileHandling: isIgnored ? "ignored" : "transpile",
|
||||
ignore: ignoreFile || undefined,
|
||||
babelrc: babelrcFile || undefined,
|
||||
config: configFile || undefined,
|
||||
files: chain.files
|
||||
};
|
||||
}
|
||||
function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) {
|
||||
if (typeof babelrcRoots === "boolean") return babelrcRoots;
|
||||
const absoluteRoot = context.root;
|
||||
if (babelrcRoots === undefined) {
|
||||
return pkgData.directories.includes(absoluteRoot);
|
||||
}
|
||||
let babelrcPatterns = babelrcRoots;
|
||||
if (!Array.isArray(babelrcPatterns)) {
|
||||
babelrcPatterns = [babelrcPatterns];
|
||||
}
|
||||
babelrcPatterns = babelrcPatterns.map(pat => {
|
||||
return typeof pat === "string" ? _path().resolve(babelrcRootsDirectory, pat) : pat;
|
||||
});
|
||||
if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {
|
||||
return pkgData.directories.includes(absoluteRoot);
|
||||
}
|
||||
return babelrcPatterns.some(pat => {
|
||||
if (typeof pat === "string") {
|
||||
pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory);
|
||||
}
|
||||
return pkgData.directories.some(directory => {
|
||||
return matchPattern(pat, babelrcRootsDirectory, directory, context);
|
||||
});
|
||||
});
|
||||
}
|
||||
const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({
|
||||
filepath: file.filepath,
|
||||
dirname: file.dirname,
|
||||
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, file.filepath)
|
||||
}));
|
||||
const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({
|
||||
filepath: file.filepath,
|
||||
dirname: file.dirname,
|
||||
options: (0, _options.validate)("extendsfile", file.options, file.filepath)
|
||||
}));
|
||||
const loadProgrammaticChain = makeChainWalker({
|
||||
root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),
|
||||
env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName),
|
||||
overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index),
|
||||
overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName),
|
||||
createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger)
|
||||
});
|
||||
const loadFileChainWalker = makeChainWalker({
|
||||
root: file => loadFileDescriptors(file),
|
||||
env: (file, envName) => loadFileEnvDescriptors(file)(envName),
|
||||
overrides: (file, index) => loadFileOverridesDescriptors(file)(index),
|
||||
overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName),
|
||||
createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger)
|
||||
});
|
||||
function* loadFileChain(input, context, files, baseLogger) {
|
||||
const chain = yield* loadFileChainWalker(input, context, files, baseLogger);
|
||||
chain == null || chain.files.add(input.filepath);
|
||||
return chain;
|
||||
}
|
||||
const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors));
|
||||
const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName)));
|
||||
const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index)));
|
||||
const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName))));
|
||||
function buildFileLogger(filepath, context, baseLogger) {
|
||||
if (!baseLogger) {
|
||||
return () => {};
|
||||
}
|
||||
return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, {
|
||||
filepath
|
||||
});
|
||||
}
|
||||
function buildRootDescriptors({
|
||||
dirname,
|
||||
options
|
||||
}, alias, descriptors) {
|
||||
return descriptors(dirname, options, alias);
|
||||
}
|
||||
function buildProgrammaticLogger(_, context, baseLogger) {
|
||||
var _context$caller;
|
||||
if (!baseLogger) {
|
||||
return () => {};
|
||||
}
|
||||
return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, {
|
||||
callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name
|
||||
});
|
||||
}
|
||||
function buildEnvDescriptors({
|
||||
dirname,
|
||||
options
|
||||
}, alias, descriptors, envName) {
|
||||
var _options$env;
|
||||
const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName];
|
||||
return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null;
|
||||
}
|
||||
function buildOverrideDescriptors({
|
||||
dirname,
|
||||
options
|
||||
}, alias, descriptors, index) {
|
||||
var _options$overrides;
|
||||
const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index];
|
||||
if (!opts) throw new Error("Assertion failure - missing override");
|
||||
return descriptors(dirname, opts, `${alias}.overrides[${index}]`);
|
||||
}
|
||||
function buildOverrideEnvDescriptors({
|
||||
dirname,
|
||||
options
|
||||
}, alias, descriptors, index, envName) {
|
||||
var _options$overrides2, _override$env;
|
||||
const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index];
|
||||
if (!override) throw new Error("Assertion failure - missing override");
|
||||
const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName];
|
||||
return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;
|
||||
}
|
||||
function makeChainWalker({
|
||||
root,
|
||||
env,
|
||||
overrides,
|
||||
overridesEnv,
|
||||
createLogger
|
||||
}) {
|
||||
return function* chainWalker(input, context, files = new Set(), baseLogger) {
|
||||
const {
|
||||
dirname
|
||||
} = input;
|
||||
const flattenedConfigs = [];
|
||||
const rootOpts = root(input);
|
||||
if (configIsApplicable(rootOpts, dirname, context, input.filepath)) {
|
||||
flattenedConfigs.push({
|
||||
config: rootOpts,
|
||||
envName: undefined,
|
||||
index: undefined
|
||||
});
|
||||
const envOpts = env(input, context.envName);
|
||||
if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) {
|
||||
flattenedConfigs.push({
|
||||
config: envOpts,
|
||||
envName: context.envName,
|
||||
index: undefined
|
||||
});
|
||||
}
|
||||
(rootOpts.options.overrides || []).forEach((_, index) => {
|
||||
const overrideOps = overrides(input, index);
|
||||
if (configIsApplicable(overrideOps, dirname, context, input.filepath)) {
|
||||
flattenedConfigs.push({
|
||||
config: overrideOps,
|
||||
index,
|
||||
envName: undefined
|
||||
});
|
||||
const overrideEnvOpts = overridesEnv(input, index, context.envName);
|
||||
if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) {
|
||||
flattenedConfigs.push({
|
||||
config: overrideEnvOpts,
|
||||
index,
|
||||
envName: context.envName
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (flattenedConfigs.some(({
|
||||
config: {
|
||||
options: {
|
||||
ignore,
|
||||
only
|
||||
}
|
||||
}
|
||||
}) => shouldIgnore(context, ignore, only, dirname))) {
|
||||
return null;
|
||||
}
|
||||
const chain = emptyChain();
|
||||
const logger = createLogger(input, context, baseLogger);
|
||||
for (const {
|
||||
config,
|
||||
index,
|
||||
envName
|
||||
} of flattenedConfigs) {
|
||||
if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) {
|
||||
return null;
|
||||
}
|
||||
logger(config, index, envName);
|
||||
yield* mergeChainOpts(chain, config);
|
||||
}
|
||||
return chain;
|
||||
};
|
||||
}
|
||||
function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) {
|
||||
if (opts.extends === undefined) return true;
|
||||
const file = yield* (0, _index.loadConfig)(opts.extends, dirname, context.envName, context.caller);
|
||||
if (files.has(file)) {
|
||||
throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n"));
|
||||
}
|
||||
files.add(file);
|
||||
const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger);
|
||||
files.delete(file);
|
||||
if (!fileChain) return false;
|
||||
mergeChain(chain, fileChain);
|
||||
return true;
|
||||
}
|
||||
function mergeChain(target, source) {
|
||||
target.options.push(...source.options);
|
||||
target.plugins.push(...source.plugins);
|
||||
target.presets.push(...source.presets);
|
||||
for (const file of source.files) {
|
||||
target.files.add(file);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
function* mergeChainOpts(target, {
|
||||
options,
|
||||
plugins,
|
||||
presets
|
||||
}) {
|
||||
target.options.push(options);
|
||||
target.plugins.push(...(yield* plugins()));
|
||||
target.presets.push(...(yield* presets()));
|
||||
return target;
|
||||
}
|
||||
function emptyChain() {
|
||||
return {
|
||||
options: [],
|
||||
presets: [],
|
||||
plugins: [],
|
||||
files: new Set()
|
||||
};
|
||||
}
|
||||
function normalizeOptions(opts) {
|
||||
const options = Object.assign({}, opts);
|
||||
delete options.extends;
|
||||
delete options.env;
|
||||
delete options.overrides;
|
||||
delete options.plugins;
|
||||
delete options.presets;
|
||||
delete options.passPerPreset;
|
||||
delete options.ignore;
|
||||
delete options.only;
|
||||
delete options.test;
|
||||
delete options.include;
|
||||
delete options.exclude;
|
||||
if (hasOwnProperty.call(options, "sourceMap")) {
|
||||
options.sourceMaps = options.sourceMap;
|
||||
delete options.sourceMap;
|
||||
}
|
||||
return options;
|
||||
}
|
||||
function dedupDescriptors(items) {
|
||||
const map = new Map();
|
||||
const descriptors = [];
|
||||
for (const item of items) {
|
||||
if (typeof item.value === "function") {
|
||||
const fnKey = item.value;
|
||||
let nameMap = map.get(fnKey);
|
||||
if (!nameMap) {
|
||||
nameMap = new Map();
|
||||
map.set(fnKey, nameMap);
|
||||
}
|
||||
let desc = nameMap.get(item.name);
|
||||
if (!desc) {
|
||||
desc = {
|
||||
value: item
|
||||
};
|
||||
descriptors.push(desc);
|
||||
if (!item.ownPass) nameMap.set(item.name, desc);
|
||||
} else {
|
||||
desc.value = item;
|
||||
}
|
||||
} else {
|
||||
descriptors.push({
|
||||
value: item
|
||||
});
|
||||
}
|
||||
}
|
||||
return descriptors.reduce((acc, desc) => {
|
||||
acc.push(desc.value);
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
function configIsApplicable({
|
||||
options
|
||||
}, 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, configName) {
|
||||
const patterns = Array.isArray(test) ? test : [test];
|
||||
return matchesPatterns(context, patterns, dirname, configName);
|
||||
}
|
||||
function ignoreListReplacer(_key, value) {
|
||||
if (value instanceof RegExp) {
|
||||
return String(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function shouldIgnore(context, ignore, only, dirname) {
|
||||
if (ignore && matchesPatterns(context, ignore, dirname)) {
|
||||
var _context$filename;
|
||||
const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`;
|
||||
debug(message);
|
||||
if (context.showConfig) {
|
||||
console.log(message);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (only && !matchesPatterns(context, only, dirname)) {
|
||||
var _context$filename2;
|
||||
const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`;
|
||||
debug(message);
|
||||
if (context.showConfig) {
|
||||
console.log(message);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function matchesPatterns(context, patterns, dirname, configName) {
|
||||
return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName));
|
||||
}
|
||||
function matchPattern(pattern, dirname, pathToTest, context, configName) {
|
||||
if (typeof pattern === "function") {
|
||||
return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, {
|
||||
dirname,
|
||||
envName: context.envName,
|
||||
caller: context.caller
|
||||
});
|
||||
}
|
||||
if (typeof pathToTest !== "string") {
|
||||
throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName);
|
||||
}
|
||||
if (typeof pattern === "string") {
|
||||
pattern = (0, _patternToRegex.default)(pattern, dirname);
|
||||
}
|
||||
return pattern.test(pathToTest);
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=config-chain.js.map
|
||||
190
tools/eslint/node_modules/@babel/core/lib/config/config-descriptors.js
generated
vendored
190
tools/eslint/node_modules/@babel/core/lib/config/config-descriptors.js
generated
vendored
|
|
@ -1,190 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createCachedDescriptors = createCachedDescriptors;
|
||||
exports.createDescriptor = createDescriptor;
|
||||
exports.createUncachedDescriptors = createUncachedDescriptors;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _functional = require("../gensync-utils/functional.js");
|
||||
var _index = require("./files/index.js");
|
||||
var _item = require("./item.js");
|
||||
var _caching = require("./caching.js");
|
||||
var _resolveTargets = require("./resolve-targets.js");
|
||||
function isEqualDescriptor(a, b) {
|
||||
var _a$file, _b$file, _a$file2, _b$file2;
|
||||
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved);
|
||||
}
|
||||
function* handlerOf(value) {
|
||||
return value;
|
||||
}
|
||||
function optionsWithResolvedBrowserslistConfigFile(options, dirname) {
|
||||
if (typeof options.browserslistConfigFile === "string") {
|
||||
options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
function createCachedDescriptors(dirname, options, alias) {
|
||||
const {
|
||||
plugins,
|
||||
presets,
|
||||
passPerPreset
|
||||
} = options;
|
||||
return {
|
||||
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
|
||||
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
|
||||
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
|
||||
};
|
||||
}
|
||||
function createUncachedDescriptors(dirname, options, alias) {
|
||||
return {
|
||||
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
|
||||
plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)),
|
||||
presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset))
|
||||
};
|
||||
}
|
||||
const PRESET_DESCRIPTOR_CACHE = new WeakMap();
|
||||
const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
|
||||
const dirname = cache.using(dir => dir);
|
||||
return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) {
|
||||
const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
|
||||
return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
|
||||
}));
|
||||
});
|
||||
const PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
|
||||
const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
|
||||
const dirname = cache.using(dir => dir);
|
||||
return (0, _caching.makeStrongCache)(function* (alias) {
|
||||
const descriptors = yield* createPluginDescriptors(items, dirname, alias);
|
||||
return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
|
||||
});
|
||||
});
|
||||
const DEFAULT_OPTIONS = {};
|
||||
function loadCachedDescriptor(cache, desc) {
|
||||
const {
|
||||
value,
|
||||
options = DEFAULT_OPTIONS
|
||||
} = desc;
|
||||
if (options === false) return desc;
|
||||
let cacheByOptions = cache.get(value);
|
||||
if (!cacheByOptions) {
|
||||
cacheByOptions = new WeakMap();
|
||||
cache.set(value, cacheByOptions);
|
||||
}
|
||||
let possibilities = cacheByOptions.get(options);
|
||||
if (!possibilities) {
|
||||
possibilities = [];
|
||||
cacheByOptions.set(options, possibilities);
|
||||
}
|
||||
if (!possibilities.includes(desc)) {
|
||||
const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));
|
||||
if (matches.length > 0) {
|
||||
return matches[0];
|
||||
}
|
||||
possibilities.push(desc);
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
function* createPresetDescriptors(items, dirname, alias, passPerPreset) {
|
||||
return yield* createDescriptors("preset", items, dirname, alias, passPerPreset);
|
||||
}
|
||||
function* createPluginDescriptors(items, dirname, alias) {
|
||||
return yield* createDescriptors("plugin", items, dirname, alias);
|
||||
}
|
||||
function* createDescriptors(type, items, dirname, alias, ownPass) {
|
||||
const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, {
|
||||
type,
|
||||
alias: `${alias}$${index}`,
|
||||
ownPass: !!ownPass
|
||||
})));
|
||||
assertNoDuplicates(descriptors);
|
||||
return descriptors;
|
||||
}
|
||||
function* createDescriptor(pair, dirname, {
|
||||
type,
|
||||
alias,
|
||||
ownPass
|
||||
}) {
|
||||
const desc = (0, _item.getItemDescriptor)(pair);
|
||||
if (desc) {
|
||||
return desc;
|
||||
}
|
||||
let name;
|
||||
let options;
|
||||
let value = pair;
|
||||
if (Array.isArray(value)) {
|
||||
if (value.length === 3) {
|
||||
[value, options, name] = value;
|
||||
} else {
|
||||
[value, options] = value;
|
||||
}
|
||||
}
|
||||
let file = undefined;
|
||||
let filepath = null;
|
||||
if (typeof value === "string") {
|
||||
if (typeof type !== "string") {
|
||||
throw new Error("To resolve a string-based item, the type of item must be given");
|
||||
}
|
||||
const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset;
|
||||
const request = value;
|
||||
({
|
||||
filepath,
|
||||
value
|
||||
} = yield* resolver(value, dirname));
|
||||
file = {
|
||||
request,
|
||||
resolved: filepath
|
||||
};
|
||||
}
|
||||
if (!value) {
|
||||
throw new Error(`Unexpected falsy value: ${String(value)}`);
|
||||
}
|
||||
if (typeof value === "object" && value.__esModule) {
|
||||
if (value.default) {
|
||||
value = value.default;
|
||||
} else {
|
||||
throw new Error("Must export a default export when using ES6 modules.");
|
||||
}
|
||||
}
|
||||
if (typeof value !== "object" && typeof value !== "function") {
|
||||
throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);
|
||||
}
|
||||
if (filepath !== null && typeof value === "object" && value) {
|
||||
throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
|
||||
}
|
||||
return {
|
||||
name,
|
||||
alias: filepath || alias,
|
||||
value,
|
||||
options,
|
||||
dirname,
|
||||
ownPass,
|
||||
file
|
||||
};
|
||||
}
|
||||
function assertNoDuplicates(items) {
|
||||
const map = new Map();
|
||||
for (const item of items) {
|
||||
if (typeof item.value !== "function") continue;
|
||||
let nameMap = map.get(item.value);
|
||||
if (!nameMap) {
|
||||
nameMap = new Set();
|
||||
map.set(item.value, nameMap);
|
||||
}
|
||||
if (nameMap.has(item.name)) {
|
||||
const conflicts = items.filter(i => i.value === item.value);
|
||||
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n"));
|
||||
}
|
||||
nameMap.add(item.name);
|
||||
}
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=config-descriptors.js.map
|
||||
286
tools/eslint/node_modules/@babel/core/lib/config/files/configuration.js
generated
vendored
286
tools/eslint/node_modules/@babel/core/lib/config/files/configuration.js
generated
vendored
|
|
@ -1,286 +0,0 @@
|
|||
"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.js");
|
||||
var _configApi = require("../helpers/config-api.js");
|
||||
var _utils = require("./utils.js");
|
||||
var _moduleTypes = require("./module-types.js");
|
||||
var _patternToRegex = require("../pattern-to-regex.js");
|
||||
var _configError = require("../../errors/config-error.js");
|
||||
var fs = require("../../gensync-utils/fs.js");
|
||||
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js");
|
||||
const debug = _debug()("babel:config:loading:files:configuration");
|
||||
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts"];
|
||||
const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];
|
||||
const BABELIGNORE_FILENAME = ".babelignore";
|
||||
const runConfig = (0, _caching.makeWeakCache)(function* runConfig(options, cache) {
|
||||
yield* [];
|
||||
return {
|
||||
options: (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)),
|
||||
cacheNeedsConfiguration: !cache.configured()
|
||||
};
|
||||
});
|
||||
function* readConfigCode(filepath, data) {
|
||||
if (!_fs().existsSync(filepath)) return null;
|
||||
let 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.");
|
||||
let cacheNeedsConfiguration = false;
|
||||
if (typeof options === "function") {
|
||||
({
|
||||
options,
|
||||
cacheNeedsConfiguration
|
||||
} = yield* runConfig(options, data));
|
||||
}
|
||||
if (!options || typeof options !== "object" || Array.isArray(options)) {
|
||||
throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath);
|
||||
}
|
||||
if (typeof options.then === "function") {
|
||||
options.catch == null || options.catch(() => {});
|
||||
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 (cacheNeedsConfiguration) throwConfigError(filepath);
|
||||
return buildConfigFileObject(options, filepath);
|
||||
}
|
||||
const cfboaf = new WeakMap();
|
||||
function buildConfigFileObject(options, filepath) {
|
||||
let configFilesByFilepath = cfboaf.get(options);
|
||||
if (!configFilesByFilepath) {
|
||||
cfboaf.set(options, configFilesByFilepath = new Map());
|
||||
}
|
||||
let configFile = configFilesByFilepath.get(filepath);
|
||||
if (!configFile) {
|
||||
configFile = {
|
||||
filepath,
|
||||
dirname: _path().dirname(filepath),
|
||||
options
|
||||
};
|
||||
configFilesByFilepath.set(filepath, configFile);
|
||||
}
|
||||
return configFile;
|
||||
}
|
||||
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 _configError.default(`.babel property must be an object`, file.filepath);
|
||||
}
|
||||
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) {
|
||||
throw new _configError.default(`Error while parsing config - ${err.message}`, filepath);
|
||||
}
|
||||
if (!options) throw new _configError.default(`No config detected`, filepath);
|
||||
if (typeof options !== "object") {
|
||||
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
|
||||
}
|
||||
if (Array.isArray(options)) {
|
||||
throw new _configError.default(`Expected config object but found array`, filepath);
|
||||
}
|
||||
delete options["$schema"];
|
||||
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 _configError.default(`Negation of file paths is not supported.`, filepath);
|
||||
}
|
||||
}
|
||||
return {
|
||||
filepath,
|
||||
dirname: _path().dirname(filepath),
|
||||
ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir))
|
||||
};
|
||||
});
|
||||
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 _configError.default(`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 _configError.default(`Config file contains no configuration data`, filepath);
|
||||
}
|
||||
debug("Loaded config %o from %o.", name, dirname);
|
||||
return conf;
|
||||
}
|
||||
function readConfig(filepath, envName, caller) {
|
||||
const ext = _path().extname(filepath);
|
||||
switch (ext) {
|
||||
case ".js":
|
||||
case ".cjs":
|
||||
case ".mjs":
|
||||
case ".cts":
|
||||
return readConfigCode(filepath, {
|
||||
envName,
|
||||
caller
|
||||
});
|
||||
default:
|
||||
return readConfigJSON5(filepath);
|
||||
}
|
||||
}
|
||||
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(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:
|
||||
|
||||
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 { };
|
||||
};`, filepath);
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=configuration.js.map
|
||||
6
tools/eslint/node_modules/@babel/core/lib/config/files/import.cjs
generated
vendored
6
tools/eslint/node_modules/@babel/core/lib/config/files/import.cjs
generated
vendored
|
|
@ -1,6 +0,0 @@
|
|||
module.exports = function import_(filepath) {
|
||||
return import(filepath);
|
||||
};
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=import.cjs.map
|
||||
58
tools/eslint/node_modules/@babel/core/lib/config/files/index-browser.js
generated
vendored
58
tools/eslint/node_modules/@babel/core/lib/config/files/index-browser.js
generated
vendored
|
|
@ -1,58 +0,0 @@
|
|||
"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 = [];
|
||||
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`);
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=index-browser.js.map
|
||||
78
tools/eslint/node_modules/@babel/core/lib/config/files/index.js
generated
vendored
78
tools/eslint/node_modules/@babel/core/lib/config/files/index.js
generated
vendored
|
|
@ -1,78 +0,0 @@
|
|||
"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.js");
|
||||
var _configuration = require("./configuration.js");
|
||||
var _plugins = require("./plugins.js");
|
||||
({});
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
176
tools/eslint/node_modules/@babel/core/lib/config/files/module-types.js
generated
vendored
176
tools/eslint/node_modules/@babel/core/lib/config/files/module-types.js
generated
vendored
|
|
@ -1,176 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = loadCodeDefault;
|
||||
exports.supportsESM = void 0;
|
||||
var _async = require("../../gensync-utils/async.js");
|
||||
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 _semver() {
|
||||
const data = require("semver");
|
||||
_semver = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _debug() {
|
||||
const data = require("debug");
|
||||
_debug = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js");
|
||||
var _configError = require("../../errors/config-error.js");
|
||||
var _transformFile = require("../../transform-file.js");
|
||||
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); }); }; }
|
||||
const debug = _debug()("babel:config:loading:files:module-types");
|
||||
{
|
||||
try {
|
||||
var import_ = require("./import.cjs");
|
||||
} catch (_unused) {}
|
||||
}
|
||||
const supportsESM = exports.supportsESM = _semver().satisfies(process.versions.node, "^12.17 || >=13.2");
|
||||
function* loadCodeDefault(filepath, asyncError) {
|
||||
switch (_path().extname(filepath)) {
|
||||
case ".cjs":
|
||||
{
|
||||
return loadCjsDefault(filepath, arguments[2]);
|
||||
}
|
||||
case ".mjs":
|
||||
break;
|
||||
case ".cts":
|
||||
return loadCtsDefault(filepath);
|
||||
default:
|
||||
try {
|
||||
{
|
||||
return loadCjsDefault(filepath, arguments[2]);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.code !== "ERR_REQUIRE_ESM") throw e;
|
||||
}
|
||||
}
|
||||
if (yield* (0, _async.isAsync)()) {
|
||||
return yield* (0, _async.waitFor)(loadMjsDefault(filepath));
|
||||
}
|
||||
throw new _configError.default(asyncError, filepath);
|
||||
}
|
||||
function loadCtsDefault(filepath) {
|
||||
const ext = ".cts";
|
||||
const hasTsSupport = !!(require.extensions[".ts"] || require.extensions[".cts"] || require.extensions[".mts"]);
|
||||
let handler;
|
||||
if (!hasTsSupport) {
|
||||
const opts = {
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
sourceType: "unambiguous",
|
||||
sourceMaps: "inline",
|
||||
sourceFileName: _path().basename(filepath),
|
||||
presets: [[getTSPreset(filepath), Object.assign({
|
||||
onlyRemoveTypeImports: true,
|
||||
optimizeConstEnums: true
|
||||
}, {
|
||||
allowDeclareFields: true
|
||||
})]]
|
||||
};
|
||||
handler = function (m, filename) {
|
||||
if (handler && filename.endsWith(ext)) {
|
||||
try {
|
||||
return m._compile((0, _transformFile.transformFileSync)(filename, Object.assign({}, opts, {
|
||||
filename
|
||||
})).code, filename);
|
||||
} catch (error) {
|
||||
if (!hasTsSupport) {
|
||||
const packageJson = require("@babel/preset-typescript/package.json");
|
||||
if (_semver().lt(packageJson.version, "7.21.4")) {
|
||||
console.error("`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`.");
|
||||
}
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return require.extensions[".js"](m, filename);
|
||||
};
|
||||
require.extensions[ext] = handler;
|
||||
}
|
||||
try {
|
||||
return loadCjsDefault(filepath);
|
||||
} finally {
|
||||
if (!hasTsSupport) {
|
||||
if (require.extensions[ext] === handler) delete require.extensions[ext];
|
||||
handler = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
const LOADING_CJS_FILES = new Set();
|
||||
function loadCjsDefault(filepath) {
|
||||
if (LOADING_CJS_FILES.has(filepath)) {
|
||||
debug("Auto-ignoring usage of config %o.", filepath);
|
||||
return {};
|
||||
}
|
||||
let module;
|
||||
try {
|
||||
LOADING_CJS_FILES.add(filepath);
|
||||
module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath);
|
||||
} finally {
|
||||
LOADING_CJS_FILES.delete(filepath);
|
||||
}
|
||||
{
|
||||
var _module;
|
||||
return (_module = module) != null && _module.__esModule ? module.default || (arguments[1] ? module : undefined) : module;
|
||||
}
|
||||
}
|
||||
const loadMjsDefault = (0, _rewriteStackTrace.endHiddenCallStack)(function () {
|
||||
var _loadMjsDefault = _asyncToGenerator(function* (filepath) {
|
||||
const url = (0, _url().pathToFileURL)(filepath).toString();
|
||||
{
|
||||
if (!import_) {
|
||||
throw new _configError.default("Internal error: Native ECMAScript modules aren't supported by this platform.\n", filepath);
|
||||
}
|
||||
return (yield import_(url)).default;
|
||||
}
|
||||
});
|
||||
function loadMjsDefault(_x) {
|
||||
return _loadMjsDefault.apply(this, arguments);
|
||||
}
|
||||
return loadMjsDefault;
|
||||
}());
|
||||
function getTSPreset(filepath) {
|
||||
try {
|
||||
return require("@babel/preset-typescript");
|
||||
} catch (error) {
|
||||
if (error.code !== "MODULE_NOT_FOUND") throw error;
|
||||
let message = "You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!";
|
||||
{
|
||||
if (process.versions.pnp) {
|
||||
message += `
|
||||
If you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file:
|
||||
|
||||
packageExtensions:
|
||||
\t"@babel/core@*":
|
||||
\t\tpeerDependencies:
|
||||
\t\t\t"@babel/preset-typescript": "*"
|
||||
`;
|
||||
}
|
||||
}
|
||||
throw new _configError.default(message, filepath);
|
||||
}
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=module-types.js.map
|
||||
61
tools/eslint/node_modules/@babel/core/lib/config/files/package.js
generated
vendored
61
tools/eslint/node_modules/@babel/core/lib/config/files/package.js
generated
vendored
|
|
@ -1,61 +0,0 @@
|
|||
"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.js");
|
||||
var _configError = require("../../errors/config-error.js");
|
||||
const PACKAGE_FILENAME = "package.json";
|
||||
const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {
|
||||
let options;
|
||||
try {
|
||||
options = JSON.parse(content);
|
||||
} catch (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 _configError.default(`Config returned typeof ${typeof options}`, filepath);
|
||||
}
|
||||
if (Array.isArray(options)) {
|
||||
throw new _configError.default(`Expected config object but found array`, filepath);
|
||||
}
|
||||
return {
|
||||
filepath,
|
||||
dirname: _path().dirname(filepath),
|
||||
options
|
||||
};
|
||||
});
|
||||
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
|
||||
};
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=package.js.map
|
||||
217
tools/eslint/node_modules/@babel/core/lib/config/files/plugins.js
generated
vendored
217
tools/eslint/node_modules/@babel/core/lib/config/files/plugins.js
generated
vendored
|
|
@ -1,217 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.loadPlugin = loadPlugin;
|
||||
exports.loadPreset = loadPreset;
|
||||
exports.resolvePreset = exports.resolvePlugin = void 0;
|
||||
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 _async = require("../../gensync-utils/async.js");
|
||||
var _moduleTypes = require("./module-types.js");
|
||||
function _url() {
|
||||
const data = require("url");
|
||||
_url = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _importMetaResolve = require("../../vendor/import-meta-resolve.js");
|
||||
function _fs() {
|
||||
const data = require("fs");
|
||||
_fs = 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$)[^/]+)$/;
|
||||
const resolvePlugin = exports.resolvePlugin = resolveStandardizedName.bind(null, "plugin");
|
||||
const resolvePreset = exports.resolvePreset = resolveStandardizedName.bind(null, "preset");
|
||||
function* loadPlugin(name, dirname) {
|
||||
const filepath = resolvePlugin(name, dirname, yield* (0, _async.isAsync)());
|
||||
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, yield* (0, _async.isAsync)());
|
||||
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* resolveAlternativesHelper(type, name) {
|
||||
const standardizedName = standardizeName(type, name);
|
||||
const {
|
||||
error,
|
||||
value
|
||||
} = yield standardizedName;
|
||||
if (!error) return value;
|
||||
if (error.code !== "MODULE_NOT_FOUND") throw error;
|
||||
if (standardizedName !== name && !(yield name).error) {
|
||||
error.message += `\n- If you want to resolve "${name}", use "module:${name}"`;
|
||||
}
|
||||
if (!(yield standardizeName(type, "@babel/" + name)).error) {
|
||||
error.message += `\n- Did you mean "@babel/${name}"?`;
|
||||
}
|
||||
const oppositeType = type === "preset" ? "plugin" : "preset";
|
||||
if (!(yield standardizeName(oppositeType, name)).error) {
|
||||
error.message += `\n- Did you accidentally pass a ${oppositeType} as a ${type}?`;
|
||||
}
|
||||
if (type === "plugin") {
|
||||
const transformName = standardizedName.replace("-proposal-", "-transform-");
|
||||
if (transformName !== standardizedName && !(yield transformName).error) {
|
||||
error.message += `\n- Did you mean "${transformName}"?`;
|
||||
}
|
||||
}
|
||||
error.message += `\n
|
||||
Make sure that all the Babel plugins and presets you are using
|
||||
are defined as dependencies or devDependencies in your package.json
|
||||
file. It's possible that the missing plugin is loaded by a preset
|
||||
you are using that forgot to add the plugin to its dependencies: you
|
||||
can workaround this problem by explicitly adding the missing package
|
||||
to your top-level package.json.
|
||||
`;
|
||||
throw error;
|
||||
}
|
||||
function tryRequireResolve(id, dirname) {
|
||||
try {
|
||||
if (dirname) {
|
||||
return {
|
||||
error: null,
|
||||
value: (((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;
|
||||
})(id, {
|
||||
paths: [dirname]
|
||||
})
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
error: null,
|
||||
value: require.resolve(id)
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
error,
|
||||
value: null
|
||||
};
|
||||
}
|
||||
}
|
||||
function tryImportMetaResolve(id, options) {
|
||||
try {
|
||||
return {
|
||||
error: null,
|
||||
value: (0, _importMetaResolve.resolve)(id, options)
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
error,
|
||||
value: null
|
||||
};
|
||||
}
|
||||
}
|
||||
function resolveStandardizedNameForRequire(type, name, dirname) {
|
||||
const it = resolveAlternativesHelper(type, name);
|
||||
let res = it.next();
|
||||
while (!res.done) {
|
||||
res = it.next(tryRequireResolve(res.value, dirname));
|
||||
}
|
||||
return res.value;
|
||||
}
|
||||
function resolveStandardizedNameForImport(type, name, dirname) {
|
||||
const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname, "./babel-virtual-resolve-base.js")).href;
|
||||
const it = resolveAlternativesHelper(type, name);
|
||||
let res = it.next();
|
||||
while (!res.done) {
|
||||
res = it.next(tryImportMetaResolve(res.value, parentUrl));
|
||||
}
|
||||
return (0, _url().fileURLToPath)(res.value);
|
||||
}
|
||||
function resolveStandardizedName(type, name, dirname, resolveESM) {
|
||||
if (!_moduleTypes.supportsESM || !resolveESM) {
|
||||
return resolveStandardizedNameForRequire(type, name, dirname);
|
||||
}
|
||||
try {
|
||||
const resolved = resolveStandardizedNameForImport(type, name, dirname);
|
||||
if (!(0, _fs().existsSync)(resolved)) {
|
||||
throw Object.assign(new Error(`Could not resolve "${name}" in file ${dirname}.`), {
|
||||
type: "MODULE_NOT_FOUND"
|
||||
});
|
||||
}
|
||||
return resolved;
|
||||
} catch (e) {
|
||||
try {
|
||||
return resolveStandardizedNameForRequire(type, name, dirname);
|
||||
} catch (e2) {
|
||||
if (e.type === "MODULE_NOT_FOUND") throw e;
|
||||
if (e2.type === "MODULE_NOT_FOUND") throw e2;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
var LOADING_MODULES = new Set();
|
||||
}
|
||||
function* requireModule(type, name) {
|
||||
{
|
||||
if (!(yield* (0, _async.isAsync)()) && 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=plugins.js.map
|
||||
3
tools/eslint/node_modules/@babel/core/lib/config/files/types.js
generated
vendored
3
tools/eslint/node_modules/@babel/core/lib/config/files/types.js
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=types.js.map
|
||||
36
tools/eslint/node_modules/@babel/core/lib/config/files/utils.js
generated
vendored
36
tools/eslint/node_modules/@babel/core/lib/config/files/utils.js
generated
vendored
|
|
@ -1,36 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.makeStaticFileCache = makeStaticFileCache;
|
||||
var _caching = require("../caching.js");
|
||||
var fs = require("../../gensync-utils/fs.js");
|
||||
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;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=utils.js.map
|
||||
310
tools/eslint/node_modules/@babel/core/lib/config/full.js
generated
vendored
310
tools/eslint/node_modules/@babel/core/lib/config/full.js
generated
vendored
|
|
@ -1,310 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _async = require("../gensync-utils/async.js");
|
||||
var _util = require("./util.js");
|
||||
var context = require("../index.js");
|
||||
var _plugin = require("./plugin.js");
|
||||
var _item = require("./item.js");
|
||||
var _configChain = require("./config-chain.js");
|
||||
var _deepArray = require("./helpers/deep-array.js");
|
||||
function _traverse() {
|
||||
const data = require("@babel/traverse");
|
||||
_traverse = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _caching = require("./caching.js");
|
||||
var _options = require("./validation/options.js");
|
||||
var _plugins = require("./validation/plugins.js");
|
||||
var _configApi = require("./helpers/config-api.js");
|
||||
var _partial = require("./partial.js");
|
||||
var _configError = require("../errors/config-error.js");
|
||||
var _default = exports.default = _gensync()(function* loadFullConfig(inputOpts) {
|
||||
var _opts$assumptions;
|
||||
const result = yield* (0, _partial.default)(inputOpts);
|
||||
if (!result) {
|
||||
return null;
|
||||
}
|
||||
const {
|
||||
options,
|
||||
context,
|
||||
fileHandling
|
||||
} = result;
|
||||
if (fileHandling === "ignored") {
|
||||
return null;
|
||||
}
|
||||
const optionDefaults = {};
|
||||
const {
|
||||
plugins,
|
||||
presets
|
||||
} = options;
|
||||
if (!plugins || !presets) {
|
||||
throw new Error("Assertion failure - plugins and presets exist");
|
||||
}
|
||||
const presetContext = Object.assign({}, context, {
|
||||
targets: options.targets
|
||||
});
|
||||
const toDescriptor = item => {
|
||||
const desc = (0, _item.getItemDescriptor)(item);
|
||||
if (!desc) {
|
||||
throw new Error("Assertion failure - must be config item");
|
||||
}
|
||||
return desc;
|
||||
};
|
||||
const presetsDescriptors = presets.map(toDescriptor);
|
||||
const initialPluginsDescriptors = plugins.map(toDescriptor);
|
||||
const pluginDescriptorsByPass = [[]];
|
||||
const passes = [];
|
||||
const externalDependencies = [];
|
||||
const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) {
|
||||
const presets = [];
|
||||
for (let i = 0; i < rawPresets.length; i++) {
|
||||
const descriptor = rawPresets[i];
|
||||
if (descriptor.options !== false) {
|
||||
try {
|
||||
var preset = yield* loadPresetDescriptor(descriptor, presetContext);
|
||||
} catch (e) {
|
||||
if (e.code === "BABEL_UNKNOWN_OPTION") {
|
||||
(0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
externalDependencies.push(preset.externalDependencies);
|
||||
if (descriptor.ownPass) {
|
||||
presets.push({
|
||||
preset: preset.chain,
|
||||
pass: []
|
||||
});
|
||||
} else {
|
||||
presets.unshift({
|
||||
preset: preset.chain,
|
||||
pass: pluginDescriptorsPass
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (presets.length > 0) {
|
||||
pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass));
|
||||
for (const {
|
||||
preset,
|
||||
pass
|
||||
} of presets) {
|
||||
if (!preset) return true;
|
||||
pass.push(...preset.plugins);
|
||||
const ignored = yield* recursePresetDescriptors(preset.presets, pass);
|
||||
if (ignored) return true;
|
||||
preset.options.forEach(opts => {
|
||||
(0, _util.mergeOptions)(optionDefaults, opts);
|
||||
});
|
||||
}
|
||||
}
|
||||
})(presetsDescriptors, pluginDescriptorsByPass[0]);
|
||||
if (ignored) return null;
|
||||
const opts = optionDefaults;
|
||||
(0, _util.mergeOptions)(opts, options);
|
||||
const pluginContext = Object.assign({}, presetContext, {
|
||||
assumptions: (_opts$assumptions = opts.assumptions) != null ? _opts$assumptions : {}
|
||||
});
|
||||
yield* enhanceError(context, function* loadPluginDescriptors() {
|
||||
pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors);
|
||||
for (const descs of pluginDescriptorsByPass) {
|
||||
const pass = [];
|
||||
passes.push(pass);
|
||||
for (let i = 0; i < descs.length; i++) {
|
||||
const descriptor = descs[i];
|
||||
if (descriptor.options !== false) {
|
||||
try {
|
||||
var plugin = yield* loadPluginDescriptor(descriptor, pluginContext);
|
||||
} catch (e) {
|
||||
if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") {
|
||||
(0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
pass.push(plugin);
|
||||
externalDependencies.push(plugin.externalDependencies);
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
opts.plugins = passes[0];
|
||||
opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({
|
||||
plugins
|
||||
}));
|
||||
opts.passPerPreset = opts.presets.length > 0;
|
||||
return {
|
||||
options: opts,
|
||||
passes: passes,
|
||||
externalDependencies: (0, _deepArray.finalize)(externalDependencies)
|
||||
};
|
||||
});
|
||||
function enhanceError(context, fn) {
|
||||
return function* (arg1, arg2) {
|
||||
try {
|
||||
return yield* fn(arg1, arg2);
|
||||
} catch (e) {
|
||||
if (!/^\[BABEL\]/.test(e.message)) {
|
||||
var _context$filename;
|
||||
e.message = `[BABEL] ${(_context$filename = context.filename) != null ? _context$filename : "unknown file"}: ${e.message}`;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
}
|
||||
const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function* ({
|
||||
value,
|
||||
options,
|
||||
dirname,
|
||||
alias
|
||||
}, cache) {
|
||||
if (options === false) throw new Error("Assertion failure");
|
||||
options = options || {};
|
||||
const externalDependencies = [];
|
||||
let item = value;
|
||||
if (typeof value === "function") {
|
||||
const factory = (0, _async.maybeAsync)(value, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
|
||||
const api = Object.assign({}, context, apiFactory(cache, externalDependencies));
|
||||
try {
|
||||
item = yield* factory(api, options, dirname);
|
||||
} catch (e) {
|
||||
if (alias) {
|
||||
e.message += ` (While processing: ${JSON.stringify(alias)})`;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (!item || typeof item !== "object") {
|
||||
throw new Error("Plugin/Preset did not return an object.");
|
||||
}
|
||||
if ((0, _async.isThenable)(item)) {
|
||||
yield* [];
|
||||
throw new Error(`You appear to be using a promise as a plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version. ` + `As an alternative, you can prefix the promise with "await". ` + `(While processing: ${JSON.stringify(alias)})`);
|
||||
}
|
||||
if (externalDependencies.length > 0 && (!cache.configured() || cache.mode() === "forever")) {
|
||||
let error = `A plugin/preset has external untracked dependencies ` + `(${externalDependencies[0]}), but the cache `;
|
||||
if (!cache.configured()) {
|
||||
error += `has not been configured to be invalidated when the external dependencies change. `;
|
||||
} else {
|
||||
error += ` has been configured to never be invalidated. `;
|
||||
}
|
||||
error += `Plugins/presets should configure their cache to be invalidated when the external ` + `dependencies change, for example using \`api.cache.invalidate(() => ` + `statSync(filepath).mtimeMs)\` or \`api.cache.never()\`\n` + `(While processing: ${JSON.stringify(alias)})`;
|
||||
throw new Error(error);
|
||||
}
|
||||
return {
|
||||
value: item,
|
||||
options,
|
||||
dirname,
|
||||
alias,
|
||||
externalDependencies: (0, _deepArray.finalize)(externalDependencies)
|
||||
};
|
||||
});
|
||||
const pluginDescriptorLoader = makeDescriptorLoader(_configApi.makePluginAPI);
|
||||
const presetDescriptorLoader = makeDescriptorLoader(_configApi.makePresetAPI);
|
||||
const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({
|
||||
value,
|
||||
options,
|
||||
dirname,
|
||||
alias,
|
||||
externalDependencies
|
||||
}, cache) {
|
||||
const pluginObj = (0, _plugins.validatePluginObject)(value);
|
||||
const plugin = Object.assign({}, pluginObj);
|
||||
if (plugin.visitor) {
|
||||
plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor));
|
||||
}
|
||||
if (plugin.inherits) {
|
||||
const inheritsDescriptor = {
|
||||
name: undefined,
|
||||
alias: `${alias}$inherits`,
|
||||
value: plugin.inherits,
|
||||
options,
|
||||
dirname
|
||||
};
|
||||
const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, run => {
|
||||
return cache.invalidate(data => run(inheritsDescriptor, data));
|
||||
});
|
||||
plugin.pre = chain(inherits.pre, plugin.pre);
|
||||
plugin.post = chain(inherits.post, plugin.post);
|
||||
plugin.manipulateOptions = chain(inherits.manipulateOptions, plugin.manipulateOptions);
|
||||
plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]);
|
||||
if (inherits.externalDependencies.length > 0) {
|
||||
if (externalDependencies.length === 0) {
|
||||
externalDependencies = inherits.externalDependencies;
|
||||
} else {
|
||||
externalDependencies = (0, _deepArray.finalize)([externalDependencies, inherits.externalDependencies]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new _plugin.default(plugin, options, alias, externalDependencies);
|
||||
});
|
||||
function* loadPluginDescriptor(descriptor, context) {
|
||||
if (descriptor.value instanceof _plugin.default) {
|
||||
if (descriptor.options) {
|
||||
throw new Error("Passed options to an existing Plugin instance will not work.");
|
||||
}
|
||||
return descriptor.value;
|
||||
}
|
||||
return yield* instantiatePlugin(yield* pluginDescriptorLoader(descriptor, context), context);
|
||||
}
|
||||
const needsFilename = val => val && typeof val !== "function";
|
||||
const validateIfOptionNeedsFilename = (options, descriptor) => {
|
||||
if (needsFilename(options.test) || needsFilename(options.include) || needsFilename(options.exclude)) {
|
||||
const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */";
|
||||
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"));
|
||||
}
|
||||
};
|
||||
const validatePreset = (preset, context, descriptor) => {
|
||||
if (!context.filename) {
|
||||
var _options$overrides;
|
||||
const {
|
||||
options
|
||||
} = preset;
|
||||
validateIfOptionNeedsFilename(options, descriptor);
|
||||
(_options$overrides = options.overrides) == null || _options$overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor));
|
||||
}
|
||||
};
|
||||
const instantiatePreset = (0, _caching.makeWeakCacheSync)(({
|
||||
value,
|
||||
dirname,
|
||||
alias,
|
||||
externalDependencies
|
||||
}) => {
|
||||
return {
|
||||
options: (0, _options.validate)("preset", value),
|
||||
alias,
|
||||
dirname,
|
||||
externalDependencies
|
||||
};
|
||||
});
|
||||
function* loadPresetDescriptor(descriptor, context) {
|
||||
const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context));
|
||||
validatePreset(preset, context, descriptor);
|
||||
return {
|
||||
chain: yield* (0, _configChain.buildPresetChain)(preset, context),
|
||||
externalDependencies: preset.externalDependencies
|
||||
};
|
||||
}
|
||||
function chain(a, b) {
|
||||
const fns = [a, b].filter(Boolean);
|
||||
if (fns.length <= 1) return fns[0];
|
||||
return function (...args) {
|
||||
for (const fn of fns) {
|
||||
fn.apply(this, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=full.js.map
|
||||
84
tools/eslint/node_modules/@babel/core/lib/config/helpers/config-api.js
generated
vendored
84
tools/eslint/node_modules/@babel/core/lib/config/helpers/config-api.js
generated
vendored
|
|
@ -1,84 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.makeConfigAPI = makeConfigAPI;
|
||||
exports.makePluginAPI = makePluginAPI;
|
||||
exports.makePresetAPI = makePresetAPI;
|
||||
function _semver() {
|
||||
const data = require("semver");
|
||||
_semver = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _index = require("../../index.js");
|
||||
var _caching = require("../caching.js");
|
||||
function makeConfigAPI(cache) {
|
||||
const env = value => cache.using(data => {
|
||||
if (typeof value === "undefined") return data.envName;
|
||||
if (typeof value === "function") {
|
||||
return (0, _caching.assertSimpleType)(value(data.envName));
|
||||
}
|
||||
return (Array.isArray(value) ? value : [value]).some(entry => {
|
||||
if (typeof entry !== "string") {
|
||||
throw new Error("Unexpected non-string value");
|
||||
}
|
||||
return entry === data.envName;
|
||||
});
|
||||
});
|
||||
const caller = cb => cache.using(data => (0, _caching.assertSimpleType)(cb(data.caller)));
|
||||
return {
|
||||
version: _index.version,
|
||||
cache: cache.simple(),
|
||||
env,
|
||||
async: () => false,
|
||||
caller,
|
||||
assertVersion
|
||||
};
|
||||
}
|
||||
function makePresetAPI(cache, externalDependencies) {
|
||||
const targets = () => JSON.parse(cache.using(data => JSON.stringify(data.targets)));
|
||||
const addExternalDependency = ref => {
|
||||
externalDependencies.push(ref);
|
||||
};
|
||||
return Object.assign({}, makeConfigAPI(cache), {
|
||||
targets,
|
||||
addExternalDependency
|
||||
});
|
||||
}
|
||||
function makePluginAPI(cache, externalDependencies) {
|
||||
const assumption = name => cache.using(data => data.assumptions[name]);
|
||||
return Object.assign({}, makePresetAPI(cache, externalDependencies), {
|
||||
assumption
|
||||
});
|
||||
}
|
||||
function assertVersion(range) {
|
||||
if (typeof range === "number") {
|
||||
if (!Number.isInteger(range)) {
|
||||
throw new Error("Expected string or integer value.");
|
||||
}
|
||||
range = `^${range}.0.0-0`;
|
||||
}
|
||||
if (typeof range !== "string") {
|
||||
throw new Error("Expected string or integer value.");
|
||||
}
|
||||
if (range === "*" || _semver().satisfies(_index.version, range)) return;
|
||||
const limit = Error.stackTraceLimit;
|
||||
if (typeof limit === "number" && limit < 25) {
|
||||
Error.stackTraceLimit = 25;
|
||||
}
|
||||
const err = new Error(`Requires Babel "${range}", but was loaded with "${_index.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`);
|
||||
if (typeof limit === "number") {
|
||||
Error.stackTraceLimit = limit;
|
||||
}
|
||||
throw Object.assign(err, {
|
||||
code: "BABEL_VERSION_UNSUPPORTED",
|
||||
version: _index.version,
|
||||
range
|
||||
});
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=config-api.js.map
|
||||
23
tools/eslint/node_modules/@babel/core/lib/config/helpers/deep-array.js
generated
vendored
23
tools/eslint/node_modules/@babel/core/lib/config/helpers/deep-array.js
generated
vendored
|
|
@ -1,23 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.finalize = finalize;
|
||||
exports.flattenToSet = flattenToSet;
|
||||
function finalize(deepArr) {
|
||||
return Object.freeze(deepArr);
|
||||
}
|
||||
function flattenToSet(arr) {
|
||||
const result = new Set();
|
||||
const stack = [arr];
|
||||
while (stack.length > 0) {
|
||||
for (const el of stack.pop()) {
|
||||
if (Array.isArray(el)) stack.push(el);else result.add(el);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=deep-array.js.map
|
||||
12
tools/eslint/node_modules/@babel/core/lib/config/helpers/environment.js
generated
vendored
12
tools/eslint/node_modules/@babel/core/lib/config/helpers/environment.js
generated
vendored
|
|
@ -1,12 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getEnv = getEnv;
|
||||
function getEnv(defaultValue = "development") {
|
||||
return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=environment.js.map
|
||||
93
tools/eslint/node_modules/@babel/core/lib/config/index.js
generated
vendored
93
tools/eslint/node_modules/@babel/core/lib/config/index.js
generated
vendored
|
|
@ -1,93 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createConfigItem = createConfigItem;
|
||||
exports.createConfigItemAsync = createConfigItemAsync;
|
||||
exports.createConfigItemSync = createConfigItemSync;
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _full.default;
|
||||
}
|
||||
});
|
||||
exports.loadOptions = loadOptions;
|
||||
exports.loadOptionsAsync = loadOptionsAsync;
|
||||
exports.loadOptionsSync = loadOptionsSync;
|
||||
exports.loadPartialConfig = loadPartialConfig;
|
||||
exports.loadPartialConfigAsync = loadPartialConfigAsync;
|
||||
exports.loadPartialConfigSync = loadPartialConfigSync;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _full = require("./full.js");
|
||||
var _partial = require("./partial.js");
|
||||
var _item = require("./item.js");
|
||||
var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js");
|
||||
const loadPartialConfigRunner = _gensync()(_partial.loadPartialConfig);
|
||||
function loadPartialConfigAsync(...args) {
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.async)(...args);
|
||||
}
|
||||
function loadPartialConfigSync(...args) {
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.sync)(...args);
|
||||
}
|
||||
function loadPartialConfig(opts, callback) {
|
||||
if (callback !== undefined) {
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(opts, callback);
|
||||
} else if (typeof opts === "function") {
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(undefined, opts);
|
||||
} else {
|
||||
{
|
||||
return loadPartialConfigSync(opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
function* loadOptionsImpl(opts) {
|
||||
var _config$options;
|
||||
const config = yield* (0, _full.default)(opts);
|
||||
return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null;
|
||||
}
|
||||
const loadOptionsRunner = _gensync()(loadOptionsImpl);
|
||||
function loadOptionsAsync(...args) {
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.async)(...args);
|
||||
}
|
||||
function loadOptionsSync(...args) {
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.sync)(...args);
|
||||
}
|
||||
function loadOptions(opts, callback) {
|
||||
if (callback !== undefined) {
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(opts, callback);
|
||||
} else if (typeof opts === "function") {
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(undefined, opts);
|
||||
} else {
|
||||
{
|
||||
return loadOptionsSync(opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
const createConfigItemRunner = _gensync()(_item.createConfigItem);
|
||||
function createConfigItemAsync(...args) {
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.async)(...args);
|
||||
}
|
||||
function createConfigItemSync(...args) {
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.sync)(...args);
|
||||
}
|
||||
function createConfigItem(target, options, callback) {
|
||||
if (callback !== undefined) {
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, options, callback);
|
||||
} else if (typeof options === "function") {
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, undefined, callback);
|
||||
} else {
|
||||
{
|
||||
return createConfigItemSync(target, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
67
tools/eslint/node_modules/@babel/core/lib/config/item.js
generated
vendored
67
tools/eslint/node_modules/@babel/core/lib/config/item.js
generated
vendored
|
|
@ -1,67 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createConfigItem = createConfigItem;
|
||||
exports.createItemFromDescriptor = createItemFromDescriptor;
|
||||
exports.getItemDescriptor = getItemDescriptor;
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _configDescriptors = require("./config-descriptors.js");
|
||||
function createItemFromDescriptor(desc) {
|
||||
return new ConfigItem(desc);
|
||||
}
|
||||
function* createConfigItem(value, {
|
||||
dirname = ".",
|
||||
type
|
||||
} = {}) {
|
||||
const descriptor = yield* (0, _configDescriptors.createDescriptor)(value, _path().resolve(dirname), {
|
||||
type,
|
||||
alias: "programmatic item"
|
||||
});
|
||||
return createItemFromDescriptor(descriptor);
|
||||
}
|
||||
const CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem");
|
||||
function getItemDescriptor(item) {
|
||||
if (item != null && item[CONFIG_ITEM_BRAND]) {
|
||||
return item._descriptor;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
class ConfigItem {
|
||||
constructor(descriptor) {
|
||||
this._descriptor = void 0;
|
||||
this[CONFIG_ITEM_BRAND] = true;
|
||||
this.value = void 0;
|
||||
this.options = void 0;
|
||||
this.dirname = void 0;
|
||||
this.name = void 0;
|
||||
this.file = void 0;
|
||||
this._descriptor = descriptor;
|
||||
Object.defineProperty(this, "_descriptor", {
|
||||
enumerable: false
|
||||
});
|
||||
Object.defineProperty(this, CONFIG_ITEM_BRAND, {
|
||||
enumerable: false
|
||||
});
|
||||
this.value = this._descriptor.value;
|
||||
this.options = this._descriptor.options;
|
||||
this.dirname = this._descriptor.dirname;
|
||||
this.name = this._descriptor.name;
|
||||
this.file = this._descriptor.file ? {
|
||||
request: this._descriptor.file.request,
|
||||
resolved: this._descriptor.file.resolved
|
||||
} : undefined;
|
||||
Object.freeze(this);
|
||||
}
|
||||
}
|
||||
Object.freeze(ConfigItem.prototype);
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=item.js.map
|
||||
158
tools/eslint/node_modules/@babel/core/lib/config/partial.js
generated
vendored
158
tools/eslint/node_modules/@babel/core/lib/config/partial.js
generated
vendored
|
|
@ -1,158 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = loadPrivatePartialConfig;
|
||||
exports.loadPartialConfig = loadPartialConfig;
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _plugin = require("./plugin.js");
|
||||
var _util = require("./util.js");
|
||||
var _item = require("./item.js");
|
||||
var _configChain = require("./config-chain.js");
|
||||
var _environment = require("./helpers/environment.js");
|
||||
var _options = require("./validation/options.js");
|
||||
var _index = require("./files/index.js");
|
||||
var _resolveTargets = require("./resolve-targets.js");
|
||||
const _excluded = ["showIgnoredFiles"];
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
function resolveRootMode(rootDir, rootMode) {
|
||||
switch (rootMode) {
|
||||
case "root":
|
||||
return rootDir;
|
||||
case "upward-optional":
|
||||
{
|
||||
const upwardRootDir = (0, _index.findConfigUpwards)(rootDir);
|
||||
return upwardRootDir === null ? rootDir : upwardRootDir;
|
||||
}
|
||||
case "upward":
|
||||
{
|
||||
const upwardRootDir = (0, _index.findConfigUpwards)(rootDir);
|
||||
if (upwardRootDir !== null) return upwardRootDir;
|
||||
throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_index.ROOT_CONFIG_FILENAMES.join(", ")}".`), {
|
||||
code: "BABEL_ROOT_NOT_FOUND",
|
||||
dirname: rootDir
|
||||
});
|
||||
}
|
||||
default:
|
||||
throw new Error(`Assertion failure - unknown rootMode value.`);
|
||||
}
|
||||
}
|
||||
function* loadPrivatePartialConfig(inputOpts) {
|
||||
if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) {
|
||||
throw new Error("Babel options must be an object, null, or undefined");
|
||||
}
|
||||
const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {};
|
||||
const {
|
||||
envName = (0, _environment.getEnv)(),
|
||||
cwd = ".",
|
||||
root: rootDir = ".",
|
||||
rootMode = "root",
|
||||
caller,
|
||||
cloneInputAst = true
|
||||
} = args;
|
||||
const absoluteCwd = _path().resolve(cwd);
|
||||
const absoluteRootDir = resolveRootMode(_path().resolve(absoluteCwd, rootDir), rootMode);
|
||||
const filename = typeof args.filename === "string" ? _path().resolve(cwd, args.filename) : undefined;
|
||||
const showConfigPath = yield* (0, _index.resolveShowConfigPath)(absoluteCwd);
|
||||
const context = {
|
||||
filename,
|
||||
cwd: absoluteCwd,
|
||||
root: absoluteRootDir,
|
||||
envName,
|
||||
caller,
|
||||
showConfig: showConfigPath === filename
|
||||
};
|
||||
const configChain = yield* (0, _configChain.buildRootChain)(args, context);
|
||||
if (!configChain) return null;
|
||||
const merged = {
|
||||
assumptions: {}
|
||||
};
|
||||
configChain.options.forEach(opts => {
|
||||
(0, _util.mergeOptions)(merged, opts);
|
||||
});
|
||||
const options = Object.assign({}, merged, {
|
||||
targets: (0, _resolveTargets.resolveTargets)(merged, absoluteRootDir),
|
||||
cloneInputAst,
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
browserslistConfigFile: false,
|
||||
passPerPreset: false,
|
||||
envName: context.envName,
|
||||
cwd: context.cwd,
|
||||
root: context.root,
|
||||
rootMode: "root",
|
||||
filename: typeof context.filename === "string" ? context.filename : undefined,
|
||||
plugins: configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)),
|
||||
presets: configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor))
|
||||
});
|
||||
return {
|
||||
options,
|
||||
context,
|
||||
fileHandling: configChain.fileHandling,
|
||||
ignore: configChain.ignore,
|
||||
babelrc: configChain.babelrc,
|
||||
config: configChain.config,
|
||||
files: configChain.files
|
||||
};
|
||||
}
|
||||
function* loadPartialConfig(opts) {
|
||||
let showIgnoredFiles = false;
|
||||
if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) {
|
||||
var _opts = opts;
|
||||
({
|
||||
showIgnoredFiles
|
||||
} = _opts);
|
||||
opts = _objectWithoutPropertiesLoose(_opts, _excluded);
|
||||
_opts;
|
||||
}
|
||||
const result = yield* loadPrivatePartialConfig(opts);
|
||||
if (!result) return null;
|
||||
const {
|
||||
options,
|
||||
babelrc,
|
||||
ignore,
|
||||
config,
|
||||
fileHandling,
|
||||
files
|
||||
} = result;
|
||||
if (fileHandling === "ignored" && !showIgnoredFiles) {
|
||||
return null;
|
||||
}
|
||||
(options.plugins || []).forEach(item => {
|
||||
if (item.value instanceof _plugin.default) {
|
||||
throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()");
|
||||
}
|
||||
});
|
||||
return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files);
|
||||
}
|
||||
class PartialConfig {
|
||||
constructor(options, babelrc, ignore, config, fileHandling, files) {
|
||||
this.options = void 0;
|
||||
this.babelrc = void 0;
|
||||
this.babelignore = void 0;
|
||||
this.config = void 0;
|
||||
this.fileHandling = void 0;
|
||||
this.files = void 0;
|
||||
this.options = options;
|
||||
this.babelignore = ignore;
|
||||
this.babelrc = babelrc;
|
||||
this.config = config;
|
||||
this.fileHandling = fileHandling;
|
||||
this.files = files;
|
||||
Object.freeze(this);
|
||||
}
|
||||
hasFilesystemConfig() {
|
||||
return this.babelrc !== undefined || this.config !== undefined;
|
||||
}
|
||||
}
|
||||
Object.freeze(PartialConfig.prototype);
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=partial.js.map
|
||||
38
tools/eslint/node_modules/@babel/core/lib/config/pattern-to-regex.js
generated
vendored
38
tools/eslint/node_modules/@babel/core/lib/config/pattern-to-regex.js
generated
vendored
|
|
@ -1,38 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = pathToPattern;
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
const sep = `\\${_path().sep}`;
|
||||
const endSep = `(?:${sep}|$)`;
|
||||
const substitution = `[^${sep}]+`;
|
||||
const starPat = `(?:${substitution}${sep})`;
|
||||
const starPatLast = `(?:${substitution}${endSep})`;
|
||||
const starStarPat = `${starPat}*?`;
|
||||
const starStarPatLast = `${starPat}*?${starPatLast}?`;
|
||||
function escapeRegExp(string) {
|
||||
return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
|
||||
}
|
||||
function pathToPattern(pattern, dirname) {
|
||||
const parts = _path().resolve(dirname, pattern).split(_path().sep);
|
||||
return new RegExp(["^", ...parts.map((part, i) => {
|
||||
const last = i === parts.length - 1;
|
||||
if (part === "**") return last ? starStarPatLast : starStarPat;
|
||||
if (part === "*") return last ? starPatLast : starPat;
|
||||
if (part.indexOf("*.") === 0) {
|
||||
return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep);
|
||||
}
|
||||
return escapeRegExp(part) + (last ? endSep : sep);
|
||||
})].join(""));
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=pattern-to-regex.js.map
|
||||
33
tools/eslint/node_modules/@babel/core/lib/config/plugin.js
generated
vendored
33
tools/eslint/node_modules/@babel/core/lib/config/plugin.js
generated
vendored
|
|
@ -1,33 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _deepArray = require("./helpers/deep-array.js");
|
||||
class Plugin {
|
||||
constructor(plugin, options, key, externalDependencies = (0, _deepArray.finalize)([])) {
|
||||
this.key = void 0;
|
||||
this.manipulateOptions = void 0;
|
||||
this.post = void 0;
|
||||
this.pre = void 0;
|
||||
this.visitor = void 0;
|
||||
this.parserOverride = void 0;
|
||||
this.generatorOverride = void 0;
|
||||
this.options = void 0;
|
||||
this.externalDependencies = void 0;
|
||||
this.key = plugin.name || key;
|
||||
this.manipulateOptions = plugin.manipulateOptions;
|
||||
this.post = plugin.post;
|
||||
this.pre = plugin.pre;
|
||||
this.visitor = plugin.visitor || {};
|
||||
this.parserOverride = plugin.parserOverride;
|
||||
this.generatorOverride = plugin.generatorOverride;
|
||||
this.options = options;
|
||||
this.externalDependencies = externalDependencies;
|
||||
}
|
||||
}
|
||||
exports.default = Plugin;
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=plugin.js.map
|
||||
113
tools/eslint/node_modules/@babel/core/lib/config/printer.js
generated
vendored
113
tools/eslint/node_modules/@babel/core/lib/config/printer.js
generated
vendored
|
|
@ -1,113 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ConfigPrinter = exports.ChainFormatter = void 0;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
const ChainFormatter = exports.ChainFormatter = {
|
||||
Programmatic: 0,
|
||||
Config: 1
|
||||
};
|
||||
const Formatter = {
|
||||
title(type, callerName, filepath) {
|
||||
let title = "";
|
||||
if (type === ChainFormatter.Programmatic) {
|
||||
title = "programmatic options";
|
||||
if (callerName) {
|
||||
title += " from " + callerName;
|
||||
}
|
||||
} else {
|
||||
title = "config " + filepath;
|
||||
}
|
||||
return title;
|
||||
},
|
||||
loc(index, envName) {
|
||||
let loc = "";
|
||||
if (index != null) {
|
||||
loc += `.overrides[${index}]`;
|
||||
}
|
||||
if (envName != null) {
|
||||
loc += `.env["${envName}"]`;
|
||||
}
|
||||
return loc;
|
||||
},
|
||||
*optionsAndDescriptors(opt) {
|
||||
const content = Object.assign({}, opt.options);
|
||||
delete content.overrides;
|
||||
delete content.env;
|
||||
const pluginDescriptors = [...(yield* opt.plugins())];
|
||||
if (pluginDescriptors.length) {
|
||||
content.plugins = pluginDescriptors.map(d => descriptorToConfig(d));
|
||||
}
|
||||
const presetDescriptors = [...(yield* opt.presets())];
|
||||
if (presetDescriptors.length) {
|
||||
content.presets = [...presetDescriptors].map(d => descriptorToConfig(d));
|
||||
}
|
||||
return JSON.stringify(content, undefined, 2);
|
||||
}
|
||||
};
|
||||
function descriptorToConfig(d) {
|
||||
var _d$file;
|
||||
let name = (_d$file = d.file) == null ? void 0 : _d$file.request;
|
||||
if (name == null) {
|
||||
if (typeof d.value === "object") {
|
||||
name = d.value;
|
||||
} else if (typeof d.value === "function") {
|
||||
name = `[Function: ${d.value.toString().slice(0, 50)} ... ]`;
|
||||
}
|
||||
}
|
||||
if (name == null) {
|
||||
name = "[Unknown]";
|
||||
}
|
||||
if (d.options === undefined) {
|
||||
return name;
|
||||
} else if (d.name == null) {
|
||||
return [name, d.options];
|
||||
} else {
|
||||
return [name, d.options, d.name];
|
||||
}
|
||||
}
|
||||
class ConfigPrinter {
|
||||
constructor() {
|
||||
this._stack = [];
|
||||
}
|
||||
configure(enabled, type, {
|
||||
callerName,
|
||||
filepath
|
||||
}) {
|
||||
if (!enabled) return () => {};
|
||||
return (content, index, envName) => {
|
||||
this._stack.push({
|
||||
type,
|
||||
callerName,
|
||||
filepath,
|
||||
content,
|
||||
index,
|
||||
envName
|
||||
});
|
||||
};
|
||||
}
|
||||
static *format(config) {
|
||||
let title = Formatter.title(config.type, config.callerName, config.filepath);
|
||||
const loc = Formatter.loc(config.index, config.envName);
|
||||
if (loc) title += ` ${loc}`;
|
||||
const content = yield* Formatter.optionsAndDescriptors(config.content);
|
||||
return `${title}\n${content}`;
|
||||
}
|
||||
*output() {
|
||||
if (this._stack.length === 0) return "";
|
||||
const configs = yield* _gensync().all(this._stack.map(s => ConfigPrinter.format(s)));
|
||||
return configs.join("\n\n");
|
||||
}
|
||||
}
|
||||
exports.ConfigPrinter = ConfigPrinter;
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=printer.js.map
|
||||
41
tools/eslint/node_modules/@babel/core/lib/config/resolve-targets-browser.js
generated
vendored
41
tools/eslint/node_modules/@babel/core/lib/config/resolve-targets-browser.js
generated
vendored
|
|
@ -1,41 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile;
|
||||
exports.resolveTargets = resolveTargets;
|
||||
function _helperCompilationTargets() {
|
||||
const data = require("@babel/helper-compilation-targets");
|
||||
_helperCompilationTargets = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function resolveBrowserslistConfigFile(browserslistConfigFile, configFilePath) {
|
||||
return undefined;
|
||||
}
|
||||
function resolveTargets(options, root) {
|
||||
const optTargets = options.targets;
|
||||
let targets;
|
||||
if (typeof optTargets === "string" || Array.isArray(optTargets)) {
|
||||
targets = {
|
||||
browsers: optTargets
|
||||
};
|
||||
} else if (optTargets) {
|
||||
if ("esmodules" in optTargets) {
|
||||
targets = Object.assign({}, optTargets, {
|
||||
esmodules: "intersect"
|
||||
});
|
||||
} else {
|
||||
targets = optTargets;
|
||||
}
|
||||
}
|
||||
return (0, _helperCompilationTargets().default)(targets, {
|
||||
ignoreBrowserslistConfig: true,
|
||||
browserslistEnv: options.browserslistEnv
|
||||
});
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=resolve-targets-browser.js.map
|
||||
61
tools/eslint/node_modules/@babel/core/lib/config/resolve-targets.js
generated
vendored
61
tools/eslint/node_modules/@babel/core/lib/config/resolve-targets.js
generated
vendored
|
|
@ -1,61 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile;
|
||||
exports.resolveTargets = resolveTargets;
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _helperCompilationTargets() {
|
||||
const data = require("@babel/helper-compilation-targets");
|
||||
_helperCompilationTargets = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
({});
|
||||
function resolveBrowserslistConfigFile(browserslistConfigFile, configFileDir) {
|
||||
return _path().resolve(configFileDir, browserslistConfigFile);
|
||||
}
|
||||
function resolveTargets(options, root) {
|
||||
const optTargets = options.targets;
|
||||
let targets;
|
||||
if (typeof optTargets === "string" || Array.isArray(optTargets)) {
|
||||
targets = {
|
||||
browsers: optTargets
|
||||
};
|
||||
} else if (optTargets) {
|
||||
if ("esmodules" in optTargets) {
|
||||
targets = Object.assign({}, optTargets, {
|
||||
esmodules: "intersect"
|
||||
});
|
||||
} else {
|
||||
targets = optTargets;
|
||||
}
|
||||
}
|
||||
const {
|
||||
browserslistConfigFile
|
||||
} = options;
|
||||
let configFile;
|
||||
let ignoreBrowserslistConfig = false;
|
||||
if (typeof browserslistConfigFile === "string") {
|
||||
configFile = browserslistConfigFile;
|
||||
} else {
|
||||
ignoreBrowserslistConfig = browserslistConfigFile === false;
|
||||
}
|
||||
return (0, _helperCompilationTargets().default)(targets, {
|
||||
ignoreBrowserslistConfig,
|
||||
configFile,
|
||||
configPath: root,
|
||||
browserslistEnv: options.browserslistEnv
|
||||
});
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=resolve-targets.js.map
|
||||
31
tools/eslint/node_modules/@babel/core/lib/config/util.js
generated
vendored
31
tools/eslint/node_modules/@babel/core/lib/config/util.js
generated
vendored
|
|
@ -1,31 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isIterableIterator = isIterableIterator;
|
||||
exports.mergeOptions = mergeOptions;
|
||||
function mergeOptions(target, source) {
|
||||
for (const k of Object.keys(source)) {
|
||||
if ((k === "parserOpts" || k === "generatorOpts" || k === "assumptions") && source[k]) {
|
||||
const parserOpts = source[k];
|
||||
const targetObj = target[k] || (target[k] = {});
|
||||
mergeDefaultFields(targetObj, parserOpts);
|
||||
} else {
|
||||
const val = source[k];
|
||||
if (val !== undefined) target[k] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
function mergeDefaultFields(target, source) {
|
||||
for (const k of Object.keys(source)) {
|
||||
const val = source[k];
|
||||
if (val !== undefined) target[k] = val;
|
||||
}
|
||||
}
|
||||
function isIterableIterator(value) {
|
||||
return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function";
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=util.js.map
|
||||
277
tools/eslint/node_modules/@babel/core/lib/config/validation/option-assertions.js
generated
vendored
277
tools/eslint/node_modules/@babel/core/lib/config/validation/option-assertions.js
generated
vendored
|
|
@ -1,277 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.access = access;
|
||||
exports.assertArray = assertArray;
|
||||
exports.assertAssumptions = assertAssumptions;
|
||||
exports.assertBabelrcSearch = assertBabelrcSearch;
|
||||
exports.assertBoolean = assertBoolean;
|
||||
exports.assertCallerMetadata = assertCallerMetadata;
|
||||
exports.assertCompact = assertCompact;
|
||||
exports.assertConfigApplicableTest = assertConfigApplicableTest;
|
||||
exports.assertConfigFileSearch = assertConfigFileSearch;
|
||||
exports.assertFunction = assertFunction;
|
||||
exports.assertIgnoreList = assertIgnoreList;
|
||||
exports.assertInputSourceMap = assertInputSourceMap;
|
||||
exports.assertObject = assertObject;
|
||||
exports.assertPluginList = assertPluginList;
|
||||
exports.assertRootMode = assertRootMode;
|
||||
exports.assertSourceMaps = assertSourceMaps;
|
||||
exports.assertSourceType = assertSourceType;
|
||||
exports.assertString = assertString;
|
||||
exports.assertTargets = assertTargets;
|
||||
exports.msg = msg;
|
||||
function _helperCompilationTargets() {
|
||||
const data = require("@babel/helper-compilation-targets");
|
||||
_helperCompilationTargets = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _options = require("./options.js");
|
||||
function msg(loc) {
|
||||
switch (loc.type) {
|
||||
case "root":
|
||||
return ``;
|
||||
case "env":
|
||||
return `${msg(loc.parent)}.env["${loc.name}"]`;
|
||||
case "overrides":
|
||||
return `${msg(loc.parent)}.overrides[${loc.index}]`;
|
||||
case "option":
|
||||
return `${msg(loc.parent)}.${loc.name}`;
|
||||
case "access":
|
||||
return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;
|
||||
default:
|
||||
throw new Error(`Assertion failure: Unknown type ${loc.type}`);
|
||||
}
|
||||
}
|
||||
function access(loc, name) {
|
||||
return {
|
||||
type: "access",
|
||||
name,
|
||||
parent: loc
|
||||
};
|
||||
}
|
||||
function assertRootMode(loc, value) {
|
||||
if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") {
|
||||
throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertSourceMaps(loc, value) {
|
||||
if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") {
|
||||
throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertCompact(loc, value) {
|
||||
if (value !== undefined && typeof value !== "boolean" && value !== "auto") {
|
||||
throw new Error(`${msg(loc)} must be a boolean, "auto", or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertSourceType(loc, value) {
|
||||
if (value !== undefined && value !== "module" && value !== "script" && value !== "unambiguous") {
|
||||
throw new Error(`${msg(loc)} must be "module", "script", "unambiguous", or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertCallerMetadata(loc, value) {
|
||||
const obj = assertObject(loc, value);
|
||||
if (obj) {
|
||||
if (typeof obj.name !== "string") {
|
||||
throw new Error(`${msg(loc)} set but does not contain "name" property string`);
|
||||
}
|
||||
for (const prop of Object.keys(obj)) {
|
||||
const propLoc = access(loc, prop);
|
||||
const value = obj[prop];
|
||||
if (value != null && typeof value !== "boolean" && typeof value !== "string" && typeof value !== "number") {
|
||||
throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertInputSourceMap(loc, value) {
|
||||
if (value !== undefined && typeof value !== "boolean" && (typeof value !== "object" || !value)) {
|
||||
throw new Error(`${msg(loc)} must be a boolean, object, or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertString(loc, value) {
|
||||
if (value !== undefined && typeof value !== "string") {
|
||||
throw new Error(`${msg(loc)} must be a string, or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertFunction(loc, value) {
|
||||
if (value !== undefined && typeof value !== "function") {
|
||||
throw new Error(`${msg(loc)} must be a function, or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertBoolean(loc, value) {
|
||||
if (value !== undefined && typeof value !== "boolean") {
|
||||
throw new Error(`${msg(loc)} must be a boolean, or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertObject(loc, value) {
|
||||
if (value !== undefined && (typeof value !== "object" || Array.isArray(value) || !value)) {
|
||||
throw new Error(`${msg(loc)} must be an object, or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertArray(loc, value) {
|
||||
if (value != null && !Array.isArray(value)) {
|
||||
throw new Error(`${msg(loc)} must be an array, or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertIgnoreList(loc, value) {
|
||||
const arr = assertArray(loc, value);
|
||||
arr == null || arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
|
||||
return arr;
|
||||
}
|
||||
function assertIgnoreItem(loc, value) {
|
||||
if (typeof value !== "string" && typeof value !== "function" && !(value instanceof RegExp)) {
|
||||
throw new Error(`${msg(loc)} must be an array of string/Function/RegExp values, or undefined`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertConfigApplicableTest(loc, value) {
|
||||
if (value === undefined) {
|
||||
return value;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((item, i) => {
|
||||
if (!checkValidTest(item)) {
|
||||
throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
|
||||
}
|
||||
});
|
||||
} else if (!checkValidTest(value)) {
|
||||
throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function checkValidTest(value) {
|
||||
return typeof value === "string" || typeof value === "function" || value instanceof RegExp;
|
||||
}
|
||||
function assertConfigFileSearch(loc, value) {
|
||||
if (value !== undefined && typeof value !== "boolean" && typeof value !== "string") {
|
||||
throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, ` + `got ${JSON.stringify(value)}`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertBabelrcSearch(loc, value) {
|
||||
if (value === undefined || typeof value === "boolean") {
|
||||
return value;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((item, i) => {
|
||||
if (!checkValidTest(item)) {
|
||||
throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
|
||||
}
|
||||
});
|
||||
} else if (!checkValidTest(value)) {
|
||||
throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + `or an array of those, got ${JSON.stringify(value)}`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertPluginList(loc, value) {
|
||||
const arr = assertArray(loc, value);
|
||||
if (arr) {
|
||||
arr.forEach((item, i) => assertPluginItem(access(loc, i), item));
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
function assertPluginItem(loc, value) {
|
||||
if (Array.isArray(value)) {
|
||||
if (value.length === 0) {
|
||||
throw new Error(`${msg(loc)} must include an object`);
|
||||
}
|
||||
if (value.length > 3) {
|
||||
throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);
|
||||
}
|
||||
assertPluginTarget(access(loc, 0), value[0]);
|
||||
if (value.length > 1) {
|
||||
const opts = value[1];
|
||||
if (opts !== undefined && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) {
|
||||
throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`);
|
||||
}
|
||||
}
|
||||
if (value.length === 3) {
|
||||
const name = value[2];
|
||||
if (name !== undefined && typeof name !== "string") {
|
||||
throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assertPluginTarget(loc, value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertPluginTarget(loc, value) {
|
||||
if ((typeof value !== "object" || !value) && typeof value !== "string" && typeof value !== "function") {
|
||||
throw new Error(`${msg(loc)} must be a string, object, function`);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertTargets(loc, value) {
|
||||
if ((0, _helperCompilationTargets().isBrowsersQueryValid)(value)) return value;
|
||||
if (typeof value !== "object" || !value || Array.isArray(value)) {
|
||||
throw new Error(`${msg(loc)} must be a string, an array of strings or an object`);
|
||||
}
|
||||
const browsersLoc = access(loc, "browsers");
|
||||
const esmodulesLoc = access(loc, "esmodules");
|
||||
assertBrowsersList(browsersLoc, value.browsers);
|
||||
assertBoolean(esmodulesLoc, value.esmodules);
|
||||
for (const key of Object.keys(value)) {
|
||||
const val = value[key];
|
||||
const subLoc = access(loc, key);
|
||||
if (key === "esmodules") assertBoolean(subLoc, val);else if (key === "browsers") assertBrowsersList(subLoc, val);else if (!hasOwnProperty.call(_helperCompilationTargets().TargetNames, key)) {
|
||||
const validTargets = Object.keys(_helperCompilationTargets().TargetNames).join(", ");
|
||||
throw new Error(`${msg(subLoc)} is not a valid target. Supported targets are ${validTargets}`);
|
||||
} else assertBrowserVersion(subLoc, val);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertBrowsersList(loc, value) {
|
||||
if (value !== undefined && !(0, _helperCompilationTargets().isBrowsersQueryValid)(value)) {
|
||||
throw new Error(`${msg(loc)} must be undefined, a string or an array of strings`);
|
||||
}
|
||||
}
|
||||
function assertBrowserVersion(loc, value) {
|
||||
if (typeof value === "number" && Math.round(value) === value) return;
|
||||
if (typeof value === "string") return;
|
||||
throw new Error(`${msg(loc)} must be a string or an integer number`);
|
||||
}
|
||||
function assertAssumptions(loc, value) {
|
||||
if (value === undefined) return;
|
||||
if (typeof value !== "object" || value === null) {
|
||||
throw new Error(`${msg(loc)} must be an object or undefined.`);
|
||||
}
|
||||
let root = loc;
|
||||
do {
|
||||
root = root.parent;
|
||||
} while (root.type !== "root");
|
||||
const inPreset = root.source === "preset";
|
||||
for (const name of Object.keys(value)) {
|
||||
const subLoc = access(loc, name);
|
||||
if (!_options.assumptionsNames.has(name)) {
|
||||
throw new Error(`${msg(subLoc)} is not a supported assumption.`);
|
||||
}
|
||||
if (typeof value[name] !== "boolean") {
|
||||
throw new Error(`${msg(subLoc)} must be a boolean.`);
|
||||
}
|
||||
if (inPreset && value[name] === false) {
|
||||
throw new Error(`${msg(subLoc)} cannot be set to 'false' inside presets.`);
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=option-assertions.js.map
|
||||
189
tools/eslint/node_modules/@babel/core/lib/config/validation/options.js
generated
vendored
189
tools/eslint/node_modules/@babel/core/lib/config/validation/options.js
generated
vendored
|
|
@ -1,189 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.assumptionsNames = void 0;
|
||||
exports.checkNoUnwrappedItemOptionPairs = checkNoUnwrappedItemOptionPairs;
|
||||
exports.validate = validate;
|
||||
var _removed = require("./removed.js");
|
||||
var _optionAssertions = require("./option-assertions.js");
|
||||
var _configError = require("../../errors/config-error.js");
|
||||
const ROOT_VALIDATORS = {
|
||||
cwd: _optionAssertions.assertString,
|
||||
root: _optionAssertions.assertString,
|
||||
rootMode: _optionAssertions.assertRootMode,
|
||||
configFile: _optionAssertions.assertConfigFileSearch,
|
||||
caller: _optionAssertions.assertCallerMetadata,
|
||||
filename: _optionAssertions.assertString,
|
||||
filenameRelative: _optionAssertions.assertString,
|
||||
code: _optionAssertions.assertBoolean,
|
||||
ast: _optionAssertions.assertBoolean,
|
||||
cloneInputAst: _optionAssertions.assertBoolean,
|
||||
envName: _optionAssertions.assertString
|
||||
};
|
||||
const BABELRC_VALIDATORS = {
|
||||
babelrc: _optionAssertions.assertBoolean,
|
||||
babelrcRoots: _optionAssertions.assertBabelrcSearch
|
||||
};
|
||||
const NONPRESET_VALIDATORS = {
|
||||
extends: _optionAssertions.assertString,
|
||||
ignore: _optionAssertions.assertIgnoreList,
|
||||
only: _optionAssertions.assertIgnoreList,
|
||||
targets: _optionAssertions.assertTargets,
|
||||
browserslistConfigFile: _optionAssertions.assertConfigFileSearch,
|
||||
browserslistEnv: _optionAssertions.assertString
|
||||
};
|
||||
const COMMON_VALIDATORS = {
|
||||
inputSourceMap: _optionAssertions.assertInputSourceMap,
|
||||
presets: _optionAssertions.assertPluginList,
|
||||
plugins: _optionAssertions.assertPluginList,
|
||||
passPerPreset: _optionAssertions.assertBoolean,
|
||||
assumptions: _optionAssertions.assertAssumptions,
|
||||
env: assertEnvSet,
|
||||
overrides: assertOverridesList,
|
||||
test: _optionAssertions.assertConfigApplicableTest,
|
||||
include: _optionAssertions.assertConfigApplicableTest,
|
||||
exclude: _optionAssertions.assertConfigApplicableTest,
|
||||
retainLines: _optionAssertions.assertBoolean,
|
||||
comments: _optionAssertions.assertBoolean,
|
||||
shouldPrintComment: _optionAssertions.assertFunction,
|
||||
compact: _optionAssertions.assertCompact,
|
||||
minified: _optionAssertions.assertBoolean,
|
||||
auxiliaryCommentBefore: _optionAssertions.assertString,
|
||||
auxiliaryCommentAfter: _optionAssertions.assertString,
|
||||
sourceType: _optionAssertions.assertSourceType,
|
||||
wrapPluginVisitorMethod: _optionAssertions.assertFunction,
|
||||
highlightCode: _optionAssertions.assertBoolean,
|
||||
sourceMaps: _optionAssertions.assertSourceMaps,
|
||||
sourceMap: _optionAssertions.assertSourceMaps,
|
||||
sourceFileName: _optionAssertions.assertString,
|
||||
sourceRoot: _optionAssertions.assertString,
|
||||
parserOpts: _optionAssertions.assertObject,
|
||||
generatorOpts: _optionAssertions.assertObject
|
||||
};
|
||||
{
|
||||
Object.assign(COMMON_VALIDATORS, {
|
||||
getModuleId: _optionAssertions.assertFunction,
|
||||
moduleRoot: _optionAssertions.assertString,
|
||||
moduleIds: _optionAssertions.assertBoolean,
|
||||
moduleId: _optionAssertions.assertString
|
||||
});
|
||||
}
|
||||
const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "noUninitializedPrivateFieldAccess", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"];
|
||||
const assumptionsNames = exports.assumptionsNames = new Set(knownAssumptions);
|
||||
function getSource(loc) {
|
||||
return loc.type === "root" ? loc.source : getSource(loc.parent);
|
||||
}
|
||||
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) {
|
||||
const type = getSource(loc);
|
||||
assertNoDuplicateSourcemap(opts);
|
||||
Object.keys(opts).forEach(key => {
|
||||
const optLoc = {
|
||||
type: "option",
|
||||
name: key,
|
||||
parent: loc
|
||||
};
|
||||
if (type === "preset" && NONPRESET_VALIDATORS[key]) {
|
||||
throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in preset options`);
|
||||
}
|
||||
if (type !== "arguments" && ROOT_VALIDATORS[key]) {
|
||||
throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options`);
|
||||
}
|
||||
if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) {
|
||||
if (type === "babelrcfile" || type === "extendsfile") {
|
||||
throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in .babelrc or "extends"ed files, only in root programmatic options, ` + `or babel.config.js/config file options`);
|
||||
}
|
||||
throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options, or babel.config.js/config file options`);
|
||||
}
|
||||
const validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError;
|
||||
validator(optLoc, opts[key]);
|
||||
});
|
||||
return opts;
|
||||
}
|
||||
function throwUnknownError(loc) {
|
||||
const key = loc.name;
|
||||
if (_removed.default[key]) {
|
||||
const {
|
||||
message,
|
||||
version = 5
|
||||
} = _removed.default[key];
|
||||
throw new Error(`Using removed Babel ${version} option: ${(0, _optionAssertions.msg)(loc)} - ${message}`);
|
||||
} else {
|
||||
const unknownOptErr = new Error(`Unknown option: ${(0, _optionAssertions.msg)(loc)}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`);
|
||||
unknownOptErr.code = "BABEL_UNKNOWN_OPTION";
|
||||
throw unknownOptErr;
|
||||
}
|
||||
}
|
||||
function assertNoDuplicateSourcemap(opts) {
|
||||
if (hasOwnProperty.call(opts, "sourceMap") && hasOwnProperty.call(opts, "sourceMaps")) {
|
||||
throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both");
|
||||
}
|
||||
}
|
||||
function assertEnvSet(loc, value) {
|
||||
if (loc.parent.type === "env") {
|
||||
throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside of another .env block`);
|
||||
}
|
||||
const parent = loc.parent;
|
||||
const obj = (0, _optionAssertions.assertObject)(loc, value);
|
||||
if (obj) {
|
||||
for (const envName of Object.keys(obj)) {
|
||||
const env = (0, _optionAssertions.assertObject)((0, _optionAssertions.access)(loc, envName), obj[envName]);
|
||||
if (!env) continue;
|
||||
const envLoc = {
|
||||
type: "env",
|
||||
name: envName,
|
||||
parent
|
||||
};
|
||||
validateNested(envLoc, env);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function assertOverridesList(loc, value) {
|
||||
if (loc.parent.type === "env") {
|
||||
throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .env block`);
|
||||
}
|
||||
if (loc.parent.type === "overrides") {
|
||||
throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .overrides block`);
|
||||
}
|
||||
const parent = loc.parent;
|
||||
const arr = (0, _optionAssertions.assertArray)(loc, value);
|
||||
if (arr) {
|
||||
for (const [index, item] of arr.entries()) {
|
||||
const objLoc = (0, _optionAssertions.access)(loc, index);
|
||||
const env = (0, _optionAssertions.assertObject)(objLoc, item);
|
||||
if (!env) throw new Error(`${(0, _optionAssertions.msg)(objLoc)} must be an object`);
|
||||
const overridesLoc = {
|
||||
type: "overrides",
|
||||
index,
|
||||
parent
|
||||
};
|
||||
validateNested(overridesLoc, env);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
function checkNoUnwrappedItemOptionPairs(items, index, type, e) {
|
||||
if (index === 0) return;
|
||||
const lastItem = items[index - 1];
|
||||
const thisItem = items[index];
|
||||
if (lastItem.file && lastItem.options === undefined && typeof thisItem.value === "object") {
|
||||
e.message += `\n- Maybe you meant to use\n` + `"${type}s": [\n ["${lastItem.file.request}", ${JSON.stringify(thisItem.value, undefined, 2)}]\n]\n` + `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`;
|
||||
}
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=options.js.map
|
||||
67
tools/eslint/node_modules/@babel/core/lib/config/validation/plugins.js
generated
vendored
67
tools/eslint/node_modules/@babel/core/lib/config/validation/plugins.js
generated
vendored
|
|
@ -1,67 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validatePluginObject = validatePluginObject;
|
||||
var _optionAssertions = require("./option-assertions.js");
|
||||
const VALIDATORS = {
|
||||
name: _optionAssertions.assertString,
|
||||
manipulateOptions: _optionAssertions.assertFunction,
|
||||
pre: _optionAssertions.assertFunction,
|
||||
post: _optionAssertions.assertFunction,
|
||||
inherits: _optionAssertions.assertFunction,
|
||||
visitor: assertVisitorMap,
|
||||
parserOverride: _optionAssertions.assertFunction,
|
||||
generatorOverride: _optionAssertions.assertFunction
|
||||
};
|
||||
function assertVisitorMap(loc, value) {
|
||||
const obj = (0, _optionAssertions.assertObject)(loc, value);
|
||||
if (obj) {
|
||||
Object.keys(obj).forEach(prop => {
|
||||
if (prop !== "_exploded" && prop !== "_verified") {
|
||||
assertVisitorHandler(prop, obj[prop]);
|
||||
}
|
||||
});
|
||||
if (obj.enter || obj.exit) {
|
||||
throw new Error(`${(0, _optionAssertions.msg)(loc)} cannot contain catch-all "enter" or "exit" handlers. Please target individual nodes.`);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function assertVisitorHandler(key, value) {
|
||||
if (value && typeof value === "object") {
|
||||
Object.keys(value).forEach(handler => {
|
||||
if (handler !== "enter" && handler !== "exit") {
|
||||
throw new Error(`.visitor["${key}"] may only have .enter and/or .exit handlers.`);
|
||||
}
|
||||
});
|
||||
} else if (typeof value !== "function") {
|
||||
throw new Error(`.visitor["${key}"] must be a function`);
|
||||
}
|
||||
}
|
||||
function validatePluginObject(obj) {
|
||||
const rootPath = {
|
||||
type: "root",
|
||||
source: "plugin"
|
||||
};
|
||||
Object.keys(obj).forEach(key => {
|
||||
const validator = VALIDATORS[key];
|
||||
if (validator) {
|
||||
const optLoc = {
|
||||
type: "option",
|
||||
name: key,
|
||||
parent: rootPath
|
||||
};
|
||||
validator(optLoc, obj[key]);
|
||||
} else {
|
||||
const invalidPluginPropertyError = new Error(`.${key} is not a valid Plugin property`);
|
||||
invalidPluginPropertyError.code = "BABEL_UNKNOWN_PLUGIN_PROPERTY";
|
||||
throw invalidPluginPropertyError;
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=plugins.js.map
|
||||
68
tools/eslint/node_modules/@babel/core/lib/config/validation/removed.js
generated
vendored
68
tools/eslint/node_modules/@babel/core/lib/config/validation/removed.js
generated
vendored
|
|
@ -1,68 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = exports.default = {
|
||||
auxiliaryComment: {
|
||||
message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"
|
||||
},
|
||||
blacklist: {
|
||||
message: "Put the specific transforms you want in the `plugins` option"
|
||||
},
|
||||
breakConfig: {
|
||||
message: "This is not a necessary option in Babel 6"
|
||||
},
|
||||
experimental: {
|
||||
message: "Put the specific transforms you want in the `plugins` option"
|
||||
},
|
||||
externalHelpers: {
|
||||
message: "Use the `external-helpers` plugin instead. " + "Check out http://babeljs.io/docs/plugins/external-helpers/"
|
||||
},
|
||||
extra: {
|
||||
message: ""
|
||||
},
|
||||
jsxPragma: {
|
||||
message: "use the `pragma` option in the `react-jsx` plugin. " + "Check out http://babeljs.io/docs/plugins/transform-react-jsx/"
|
||||
},
|
||||
loose: {
|
||||
message: "Specify the `loose` option for the relevant plugin you are using " + "or use a preset that sets the option."
|
||||
},
|
||||
metadataUsedHelpers: {
|
||||
message: "Not required anymore as this is enabled by default"
|
||||
},
|
||||
modules: {
|
||||
message: "Use the corresponding module transform plugin in the `plugins` option. " + "Check out http://babeljs.io/docs/plugins/#modules"
|
||||
},
|
||||
nonStandard: {
|
||||
message: "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. " + "Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"
|
||||
},
|
||||
optional: {
|
||||
message: "Put the specific transforms you want in the `plugins` option"
|
||||
},
|
||||
sourceMapName: {
|
||||
message: "The `sourceMapName` option has been removed because it makes more sense for the " + "tooling that calls Babel to assign `map.file` themselves."
|
||||
},
|
||||
stage: {
|
||||
message: "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"
|
||||
},
|
||||
whitelist: {
|
||||
message: "Put the specific transforms you want in the `plugins` option"
|
||||
},
|
||||
resolveModuleSource: {
|
||||
version: 6,
|
||||
message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options"
|
||||
},
|
||||
metadata: {
|
||||
version: 6,
|
||||
message: "Generated plugin metadata is always included in the output result"
|
||||
},
|
||||
sourceMapTarget: {
|
||||
version: 6,
|
||||
message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling " + "that calls Babel to assign `map.file` themselves."
|
||||
}
|
||||
};
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=removed.js.map
|
||||
18
tools/eslint/node_modules/@babel/core/lib/errors/config-error.js
generated
vendored
18
tools/eslint/node_modules/@babel/core/lib/errors/config-error.js
generated
vendored
|
|
@ -1,18 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _rewriteStackTrace = require("./rewrite-stack-trace.js");
|
||||
class ConfigError extends Error {
|
||||
constructor(message, filename) {
|
||||
super(message);
|
||||
(0, _rewriteStackTrace.expectedError)(this);
|
||||
if (filename) (0, _rewriteStackTrace.injectVirtualStackFrame)(this, filename);
|
||||
}
|
||||
}
|
||||
exports.default = ConfigError;
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=config-error.js.map
|
||||
98
tools/eslint/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js
generated
vendored
98
tools/eslint/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js
generated
vendored
|
|
@ -1,98 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.beginHiddenCallStack = beginHiddenCallStack;
|
||||
exports.endHiddenCallStack = endHiddenCallStack;
|
||||
exports.expectedError = expectedError;
|
||||
exports.injectVirtualStackFrame = injectVirtualStackFrame;
|
||||
var _Object$getOwnPropert;
|
||||
const ErrorToString = Function.call.bind(Error.prototype.toString);
|
||||
const SUPPORTED = !!Error.captureStackTrace && ((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit")) == null ? void 0 : _Object$getOwnPropert.writable) === true;
|
||||
const START_HIDING = "startHiding - secret - don't use this - v1";
|
||||
const STOP_HIDING = "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 injectVirtualStackFrame(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_HIDING
|
||||
});
|
||||
}
|
||||
function endHiddenCallStack(fn) {
|
||||
if (!SUPPORTED) return fn;
|
||||
return Object.defineProperty(function (...args) {
|
||||
return fn(...args);
|
||||
}, "name", {
|
||||
value: START_HIDING
|
||||
});
|
||||
}
|
||||
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_HIDING) {
|
||||
status = "hiding";
|
||||
} else if (name === STOP_HIDING) {
|
||||
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
|
||||
90
tools/eslint/node_modules/@babel/core/lib/gensync-utils/async.js
generated
vendored
90
tools/eslint/node_modules/@babel/core/lib/gensync-utils/async.js
generated
vendored
|
|
@ -1,90 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.forwardAsync = forwardAsync;
|
||||
exports.isAsync = void 0;
|
||||
exports.isThenable = isThenable;
|
||||
exports.maybeAsync = maybeAsync;
|
||||
exports.waitFor = exports.onFirstPause = void 0;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = 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); }); }; }
|
||||
const runGenerator = _gensync()(function* (item) {
|
||||
return yield* item;
|
||||
});
|
||||
const isAsync = exports.isAsync = _gensync()({
|
||||
sync: () => false,
|
||||
errback: cb => cb(null, true)
|
||||
});
|
||||
function maybeAsync(fn, message) {
|
||||
return _gensync()({
|
||||
sync(...args) {
|
||||
const result = fn.apply(this, args);
|
||||
if (isThenable(result)) throw new Error(message);
|
||||
return result;
|
||||
},
|
||||
async(...args) {
|
||||
return Promise.resolve(fn.apply(this, args));
|
||||
}
|
||||
});
|
||||
}
|
||||
const withKind = _gensync()({
|
||||
sync: cb => cb("sync"),
|
||||
async: function () {
|
||||
var _ref = _asyncToGenerator(function* (cb) {
|
||||
return cb("async");
|
||||
});
|
||||
return function async(_x) {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
}()
|
||||
});
|
||||
function forwardAsync(action, cb) {
|
||||
const g = _gensync()(action);
|
||||
return withKind(kind => {
|
||||
const adapted = g[kind];
|
||||
return cb(adapted);
|
||||
});
|
||||
}
|
||||
const onFirstPause = exports.onFirstPause = _gensync()({
|
||||
name: "onFirstPause",
|
||||
arity: 2,
|
||||
sync: function (item) {
|
||||
return runGenerator.sync(item);
|
||||
},
|
||||
errback: function (item, firstPause, cb) {
|
||||
let completed = false;
|
||||
runGenerator.errback(item, (err, value) => {
|
||||
completed = true;
|
||||
cb(err, value);
|
||||
});
|
||||
if (!completed) {
|
||||
firstPause();
|
||||
}
|
||||
}
|
||||
});
|
||||
const waitFor = exports.waitFor = _gensync()({
|
||||
sync: x => x,
|
||||
async: function () {
|
||||
var _ref2 = _asyncToGenerator(function* (x) {
|
||||
return x;
|
||||
});
|
||||
return function async(_x2) {
|
||||
return _ref2.apply(this, arguments);
|
||||
};
|
||||
}()
|
||||
});
|
||||
function isThenable(val) {
|
||||
return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=async.js.map
|
||||
31
tools/eslint/node_modules/@babel/core/lib/gensync-utils/fs.js
generated
vendored
31
tools/eslint/node_modules/@babel/core/lib/gensync-utils/fs.js
generated
vendored
|
|
@ -1,31 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.stat = exports.readFile = void 0;
|
||||
function _fs() {
|
||||
const data = require("fs");
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
const readFile = exports.readFile = _gensync()({
|
||||
sync: _fs().readFileSync,
|
||||
errback: _fs().readFile
|
||||
});
|
||||
const stat = exports.stat = _gensync()({
|
||||
sync: _fs().statSync,
|
||||
errback: _fs().stat
|
||||
});
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=fs.js.map
|
||||
58
tools/eslint/node_modules/@babel/core/lib/gensync-utils/functional.js
generated
vendored
58
tools/eslint/node_modules/@babel/core/lib/gensync-utils/functional.js
generated
vendored
|
|
@ -1,58 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.once = once;
|
||||
var _async = require("./async.js");
|
||||
function once(fn) {
|
||||
let result;
|
||||
let resultP;
|
||||
let promiseReferenced = false;
|
||||
return function* () {
|
||||
if (!result) {
|
||||
if (resultP) {
|
||||
promiseReferenced = true;
|
||||
return yield* (0, _async.waitFor)(resultP);
|
||||
}
|
||||
if (!(yield* (0, _async.isAsync)())) {
|
||||
try {
|
||||
result = {
|
||||
ok: true,
|
||||
value: yield* fn()
|
||||
};
|
||||
} catch (error) {
|
||||
result = {
|
||||
ok: false,
|
||||
value: error
|
||||
};
|
||||
}
|
||||
} else {
|
||||
let resolve, reject;
|
||||
resultP = new Promise((res, rej) => {
|
||||
resolve = res;
|
||||
reject = rej;
|
||||
});
|
||||
try {
|
||||
result = {
|
||||
ok: true,
|
||||
value: yield* fn()
|
||||
};
|
||||
resultP = null;
|
||||
if (promiseReferenced) resolve(result.value);
|
||||
} catch (error) {
|
||||
result = {
|
||||
ok: false,
|
||||
value: error
|
||||
};
|
||||
resultP = null;
|
||||
if (promiseReferenced) reject(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result.ok) return result.value;else throw result.value;
|
||||
};
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=functional.js.map
|
||||
242
tools/eslint/node_modules/@babel/core/lib/index.js
generated
vendored
242
tools/eslint/node_modules/@babel/core/lib/index.js
generated
vendored
|
|
@ -1,242 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.DEFAULT_EXTENSIONS = void 0;
|
||||
Object.defineProperty(exports, "File", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _file.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "buildExternalHelpers", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _buildExternalHelpers.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "createConfigItem", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.createConfigItem;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "createConfigItemAsync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.createConfigItemAsync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "createConfigItemSync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.createConfigItemSync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "getEnv", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _environment.getEnv;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadOptions", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.loadOptions;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadOptionsAsync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.loadOptionsAsync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadOptionsSync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.loadOptionsSync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadPartialConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.loadPartialConfig;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadPartialConfigAsync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.loadPartialConfigAsync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadPartialConfigSync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index2.loadPartialConfigSync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "parse", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parse.parse;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "parseAsync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parse.parseAsync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "parseSync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parse.parseSync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "resolvePlugin", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index.resolvePlugin;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "resolvePreset", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _index.resolvePreset;
|
||||
}
|
||||
});
|
||||
Object.defineProperty((0, exports), "template", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _template().default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty((0, exports), "tokTypes", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parser().tokTypes;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transform", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transform.transform;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transformAsync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transform.transformAsync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transformFile", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transformFile.transformFile;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transformFileAsync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transformFile.transformFileAsync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transformFileSync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transformFile.transformFileSync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transformFromAst", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transformAst.transformFromAst;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transformFromAstAsync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transformAst.transformFromAstAsync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transformFromAstSync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transformAst.transformFromAstSync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "transformSync", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _transform.transformSync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty((0, exports), "traverse", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _traverse().default;
|
||||
}
|
||||
});
|
||||
exports.version = exports.types = void 0;
|
||||
var _file = require("./transformation/file/file.js");
|
||||
var _buildExternalHelpers = require("./tools/build-external-helpers.js");
|
||||
var _index = require("./config/files/index.js");
|
||||
var _environment = require("./config/helpers/environment.js");
|
||||
function _types() {
|
||||
const data = require("@babel/types");
|
||||
_types = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
Object.defineProperty((0, exports), "types", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types();
|
||||
}
|
||||
});
|
||||
function _parser() {
|
||||
const data = require("@babel/parser");
|
||||
_parser = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _traverse() {
|
||||
const data = require("@babel/traverse");
|
||||
_traverse = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _template() {
|
||||
const data = require("@babel/template");
|
||||
_template = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _index2 = require("./config/index.js");
|
||||
var _transform = require("./transform.js");
|
||||
var _transformFile = require("./transform-file.js");
|
||||
var _transformAst = require("./transform-ast.js");
|
||||
var _parse = require("./parse.js");
|
||||
var thisFile = require("./index.js");
|
||||
;
|
||||
const version = exports.version = "7.24.9";
|
||||
const DEFAULT_EXTENSIONS = exports.DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
|
||||
;
|
||||
{
|
||||
exports.OptionManager = class OptionManager {
|
||||
init(opts) {
|
||||
return (0, _index2.loadOptionsSync)(opts);
|
||||
}
|
||||
};
|
||||
exports.Plugin = 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);
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
47
tools/eslint/node_modules/@babel/core/lib/parse.js
generated
vendored
47
tools/eslint/node_modules/@babel/core/lib/parse.js
generated
vendored
|
|
@ -1,47 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.parse = void 0;
|
||||
exports.parseAsync = parseAsync;
|
||||
exports.parseSync = parseSync;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _index = require("./config/index.js");
|
||||
var _index2 = require("./parser/index.js");
|
||||
var _normalizeOpts = require("./transformation/normalize-opts.js");
|
||||
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
|
||||
const parseRunner = _gensync()(function* parse(code, opts) {
|
||||
const config = yield* (0, _index.default)(opts);
|
||||
if (config === null) {
|
||||
return null;
|
||||
}
|
||||
return yield* (0, _index2.default)(config.passes, (0, _normalizeOpts.default)(config), code);
|
||||
});
|
||||
const parse = exports.parse = function parse(code, opts, callback) {
|
||||
if (typeof opts === "function") {
|
||||
callback = opts;
|
||||
opts = undefined;
|
||||
}
|
||||
if (callback === undefined) {
|
||||
{
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(code, opts);
|
||||
}
|
||||
}
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.errback)(code, opts, callback);
|
||||
};
|
||||
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
|
||||
79
tools/eslint/node_modules/@babel/core/lib/parser/index.js
generated
vendored
79
tools/eslint/node_modules/@babel/core/lib/parser/index.js
generated
vendored
|
|
@ -1,79 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = parser;
|
||||
function _parser() {
|
||||
const data = require("@babel/parser");
|
||||
_parser = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _codeFrame() {
|
||||
const data = require("@babel/code-frame");
|
||||
_codeFrame = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _missingPluginHelper = require("./util/missing-plugin-helper.js");
|
||||
function* parser(pluginPasses, {
|
||||
parserOpts,
|
||||
highlightCode = true,
|
||||
filename = "unknown"
|
||||
}, code) {
|
||||
try {
|
||||
const results = [];
|
||||
for (const plugins of pluginPasses) {
|
||||
for (const plugin of plugins) {
|
||||
const {
|
||||
parserOverride
|
||||
} = plugin;
|
||||
if (parserOverride) {
|
||||
const ast = parserOverride(code, parserOpts, _parser().parse);
|
||||
if (ast !== undefined) results.push(ast);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (results.length === 0) {
|
||||
return (0, _parser().parse)(code, parserOpts);
|
||||
} else if (results.length === 1) {
|
||||
yield* [];
|
||||
if (typeof results[0].then === "function") {
|
||||
throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
|
||||
}
|
||||
return results[0];
|
||||
}
|
||||
throw new Error("More than one plugin attempted to override parsing.");
|
||||
} catch (err) {
|
||||
if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") {
|
||||
err.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module " + "or sourceType:unambiguous in your Babel config for this file.";
|
||||
}
|
||||
const {
|
||||
loc,
|
||||
missingPlugin
|
||||
} = err;
|
||||
if (loc) {
|
||||
const codeFrame = (0, _codeFrame().codeFrameColumns)(code, {
|
||||
start: {
|
||||
line: loc.line,
|
||||
column: loc.column + 1
|
||||
}
|
||||
}, {
|
||||
highlightCode
|
||||
});
|
||||
if (missingPlugin) {
|
||||
err.message = `${filename}: ` + (0, _missingPluginHelper.default)(missingPlugin[0], loc, codeFrame, filename);
|
||||
} else {
|
||||
err.message = `${filename}: ${err.message}\n\n` + codeFrame;
|
||||
}
|
||||
err.code = "BABEL_PARSE_ERROR";
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
339
tools/eslint/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js
generated
vendored
339
tools/eslint/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js
generated
vendored
|
|
@ -1,339 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = generateMissingPluginMessage;
|
||||
const pluginNameMap = {
|
||||
asyncDoExpressions: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-async-do-expressions",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions"
|
||||
}
|
||||
},
|
||||
decimal: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-decimal",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal"
|
||||
}
|
||||
},
|
||||
decorators: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-decorators",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-decorators",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators"
|
||||
}
|
||||
},
|
||||
doExpressions: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-do-expressions",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-do-expressions",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions"
|
||||
}
|
||||
},
|
||||
exportDefaultFrom: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-export-default-from",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-export-default-from",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from"
|
||||
}
|
||||
},
|
||||
flow: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-flow",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/preset-flow",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-flow"
|
||||
}
|
||||
},
|
||||
functionBind: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-function-bind",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-function-bind",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind"
|
||||
}
|
||||
},
|
||||
functionSent: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-function-sent",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-function-sent",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent"
|
||||
}
|
||||
},
|
||||
jsx: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-jsx",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/preset-react",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-react"
|
||||
}
|
||||
},
|
||||
importAttributes: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-import-attributes",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes"
|
||||
}
|
||||
},
|
||||
pipelineOperator: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-pipeline-operator",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-pipeline-operator",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator"
|
||||
}
|
||||
},
|
||||
recordAndTuple: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-record-and-tuple",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple"
|
||||
}
|
||||
},
|
||||
throwExpressions: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-throw-expressions",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-throw-expressions",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions"
|
||||
}
|
||||
},
|
||||
typescript: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-typescript",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/preset-typescript",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-typescript"
|
||||
}
|
||||
}
|
||||
};
|
||||
{
|
||||
Object.assign(pluginNameMap, {
|
||||
asyncGenerators: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-async-generators",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-async-generator-functions",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions"
|
||||
}
|
||||
},
|
||||
classProperties: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-class-properties",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-class-properties",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
|
||||
}
|
||||
},
|
||||
classPrivateProperties: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-class-properties",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-class-properties",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
|
||||
}
|
||||
},
|
||||
classPrivateMethods: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-class-properties",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-private-methods",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods"
|
||||
}
|
||||
},
|
||||
classStaticBlock: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-class-static-block",
|
||||
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-class-static-block",
|
||||
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block"
|
||||
}
|
||||
},
|
||||
dynamicImport: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-dynamic-import",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import"
|
||||
}
|
||||
},
|
||||
exportNamespaceFrom: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-export-namespace-from",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-export-namespace-from",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from"
|
||||
}
|
||||
},
|
||||
importAssertions: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-import-assertions",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions"
|
||||
}
|
||||
},
|
||||
importMeta: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-import-meta",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta"
|
||||
}
|
||||
},
|
||||
logicalAssignment: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-logical-assignment-operators",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-logical-assignment-operators",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators"
|
||||
}
|
||||
},
|
||||
moduleStringNames: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-module-string-names",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names"
|
||||
}
|
||||
},
|
||||
numericSeparator: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-numeric-separator",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-numeric-separator",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator"
|
||||
}
|
||||
},
|
||||
nullishCoalescingOperator: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-nullish-coalescing-operator",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-nullish-coalescing-operator",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator"
|
||||
}
|
||||
},
|
||||
objectRestSpread: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-object-rest-spread",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-object-rest-spread",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread"
|
||||
}
|
||||
},
|
||||
optionalCatchBinding: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-optional-catch-binding",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-optional-catch-binding",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding"
|
||||
}
|
||||
},
|
||||
optionalChaining: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-optional-chaining",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-optional-chaining",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining"
|
||||
}
|
||||
},
|
||||
privateIn: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-private-property-in-object",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-private-property-in-object",
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object"
|
||||
}
|
||||
},
|
||||
regexpUnicodeSets: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-unicode-sets-regex",
|
||||
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-transform-unicode-sets-regex",
|
||||
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md"
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
const getNameURLCombination = ({
|
||||
name,
|
||||
url
|
||||
}) => `${name} (${url})`;
|
||||
function generateMissingPluginMessage(missingPluginName, loc, codeFrame, filename) {
|
||||
let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame;
|
||||
const pluginInfo = pluginNameMap[missingPluginName];
|
||||
if (pluginInfo) {
|
||||
const {
|
||||
syntax: syntaxPlugin,
|
||||
transform: transformPlugin
|
||||
} = pluginInfo;
|
||||
if (syntaxPlugin) {
|
||||
const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);
|
||||
if (transformPlugin) {
|
||||
const transformPluginInfo = getNameURLCombination(transformPlugin);
|
||||
const sectionType = transformPlugin.name.startsWith("@babel/plugin") ? "plugins" : "presets";
|
||||
helpMessage += `\n\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation.
|
||||
If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`;
|
||||
} else {
|
||||
helpMessage += `\n\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`;
|
||||
}
|
||||
}
|
||||
}
|
||||
const msgFilename = filename === "unknown" ? "<name of the input file>" : filename;
|
||||
helpMessage += `
|
||||
|
||||
If you already added the plugin for this syntax to your config, it's possible that your config \
|
||||
isn't being loaded.
|
||||
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \
|
||||
configuration:
|
||||
\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} <your build command>
|
||||
See https://babeljs.io/docs/configuration#print-effective-configs for more info.
|
||||
`;
|
||||
return helpMessage;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=missing-plugin-helper.js.map
|
||||
144
tools/eslint/node_modules/@babel/core/lib/tools/build-external-helpers.js
generated
vendored
144
tools/eslint/node_modules/@babel/core/lib/tools/build-external-helpers.js
generated
vendored
|
|
@ -1,144 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
function helpers() {
|
||||
const data = require("@babel/helpers");
|
||||
helpers = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _generator() {
|
||||
const data = require("@babel/generator");
|
||||
_generator = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _template() {
|
||||
const data = require("@babel/template");
|
||||
_template = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _t() {
|
||||
const data = require("@babel/types");
|
||||
_t = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
const {
|
||||
arrayExpression,
|
||||
assignmentExpression,
|
||||
binaryExpression,
|
||||
blockStatement,
|
||||
callExpression,
|
||||
cloneNode,
|
||||
conditionalExpression,
|
||||
exportNamedDeclaration,
|
||||
exportSpecifier,
|
||||
expressionStatement,
|
||||
functionExpression,
|
||||
identifier,
|
||||
memberExpression,
|
||||
objectExpression,
|
||||
program,
|
||||
stringLiteral,
|
||||
unaryExpression,
|
||||
variableDeclaration,
|
||||
variableDeclarator
|
||||
} = _t();
|
||||
const buildUmdWrapper = replacements => _template().default.statement`
|
||||
(function (root, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define(AMD_ARGUMENTS, factory);
|
||||
} else if (typeof exports === "object") {
|
||||
factory(COMMON_ARGUMENTS);
|
||||
} else {
|
||||
factory(BROWSER_ARGUMENTS);
|
||||
}
|
||||
})(UMD_ROOT, function (FACTORY_PARAMETERS) {
|
||||
FACTORY_BODY
|
||||
});
|
||||
`(replacements);
|
||||
function buildGlobal(allowlist) {
|
||||
const namespace = identifier("babelHelpers");
|
||||
const body = [];
|
||||
const container = functionExpression(null, [identifier("global")], blockStatement(body));
|
||||
const tree = program([expressionStatement(callExpression(container, [conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]);
|
||||
body.push(variableDeclaration("var", [variableDeclarator(namespace, assignmentExpression("=", memberExpression(identifier("global"), namespace), objectExpression([])))]));
|
||||
buildHelpers(body, namespace, allowlist);
|
||||
return tree;
|
||||
}
|
||||
function buildModule(allowlist) {
|
||||
const body = [];
|
||||
const refs = buildHelpers(body, null, allowlist);
|
||||
body.unshift(exportNamedDeclaration(null, Object.keys(refs).map(name => {
|
||||
return exportSpecifier(cloneNode(refs[name]), identifier(name));
|
||||
})));
|
||||
return program(body, [], "module");
|
||||
}
|
||||
function buildUmd(allowlist) {
|
||||
const namespace = identifier("babelHelpers");
|
||||
const body = [];
|
||||
body.push(variableDeclaration("var", [variableDeclarator(namespace, identifier("global"))]));
|
||||
buildHelpers(body, namespace, allowlist);
|
||||
return program([buildUmdWrapper({
|
||||
FACTORY_PARAMETERS: identifier("global"),
|
||||
BROWSER_ARGUMENTS: assignmentExpression("=", memberExpression(identifier("root"), namespace), objectExpression([])),
|
||||
COMMON_ARGUMENTS: identifier("exports"),
|
||||
AMD_ARGUMENTS: arrayExpression([stringLiteral("exports")]),
|
||||
FACTORY_BODY: body,
|
||||
UMD_ROOT: identifier("this")
|
||||
})]);
|
||||
}
|
||||
function buildVar(allowlist) {
|
||||
const namespace = identifier("babelHelpers");
|
||||
const body = [];
|
||||
body.push(variableDeclaration("var", [variableDeclarator(namespace, objectExpression([]))]));
|
||||
const tree = program(body);
|
||||
buildHelpers(body, namespace, allowlist);
|
||||
body.push(expressionStatement(namespace));
|
||||
return tree;
|
||||
}
|
||||
function buildHelpers(body, namespace, allowlist) {
|
||||
const getHelperReference = name => {
|
||||
return namespace ? memberExpression(namespace, identifier(name)) : identifier(`_${name}`);
|
||||
};
|
||||
const refs = {};
|
||||
helpers().list.forEach(function (name) {
|
||||
if (allowlist && !allowlist.includes(name)) return;
|
||||
const ref = refs[name] = getHelperReference(name);
|
||||
const {
|
||||
nodes
|
||||
} = helpers().get(name, getHelperReference, namespace ? null : `_${name}`, [], namespace ? (ast, exportName, mapExportBindingAssignments) => {
|
||||
mapExportBindingAssignments(node => assignmentExpression("=", ref, node));
|
||||
ast.body.push(expressionStatement(assignmentExpression("=", ref, identifier(exportName))));
|
||||
} : null);
|
||||
body.push(...nodes);
|
||||
});
|
||||
return refs;
|
||||
}
|
||||
function _default(allowlist, outputType = "global") {
|
||||
let tree;
|
||||
const build = {
|
||||
global: buildGlobal,
|
||||
module: buildModule,
|
||||
umd: buildUmd,
|
||||
var: buildVar
|
||||
}[outputType];
|
||||
if (build) {
|
||||
tree = build(allowlist);
|
||||
} else {
|
||||
throw new Error(`Unsupported output type ${outputType}`);
|
||||
}
|
||||
return (0, _generator().default)(tree).code;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=build-external-helpers.js.map
|
||||
50
tools/eslint/node_modules/@babel/core/lib/transform-ast.js
generated
vendored
50
tools/eslint/node_modules/@babel/core/lib/transform-ast.js
generated
vendored
|
|
@ -1,50 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.transformFromAst = void 0;
|
||||
exports.transformFromAstAsync = transformFromAstAsync;
|
||||
exports.transformFromAstSync = transformFromAstSync;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _index = require("./config/index.js");
|
||||
var _index2 = require("./transformation/index.js");
|
||||
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
|
||||
const transformFromAstRunner = _gensync()(function* (ast, code, opts) {
|
||||
const config = yield* (0, _index.default)(opts);
|
||||
if (config === null) return null;
|
||||
if (!ast) throw new Error("No AST given");
|
||||
return yield* (0, _index2.run)(config, code, ast);
|
||||
});
|
||||
const transformFromAst = exports.transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) {
|
||||
let opts;
|
||||
let callback;
|
||||
if (typeof optsOrCallback === "function") {
|
||||
callback = optsOrCallback;
|
||||
opts = undefined;
|
||||
} else {
|
||||
opts = optsOrCallback;
|
||||
callback = maybeCallback;
|
||||
}
|
||||
if (callback === undefined) {
|
||||
{
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast, code, opts);
|
||||
}
|
||||
}
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast, code, opts, callback);
|
||||
};
|
||||
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
|
||||
23
tools/eslint/node_modules/@babel/core/lib/transform-file-browser.js
generated
vendored
23
tools/eslint/node_modules/@babel/core/lib/transform-file-browser.js
generated
vendored
|
|
@ -1,23 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.transformFile = void 0;
|
||||
exports.transformFileAsync = transformFileAsync;
|
||||
exports.transformFileSync = transformFileSync;
|
||||
const transformFile = exports.transformFile = function transformFile(filename, opts, callback) {
|
||||
if (typeof opts === "function") {
|
||||
callback = opts;
|
||||
}
|
||||
callback(new Error("Transforming files is not supported in browsers"), null);
|
||||
};
|
||||
function transformFileSync() {
|
||||
throw new Error("Transforming files is not supported in browsers");
|
||||
}
|
||||
function transformFileAsync() {
|
||||
return Promise.reject(new Error("Transforming files is not supported in browsers"));
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=transform-file-browser.js.map
|
||||
40
tools/eslint/node_modules/@babel/core/lib/transform-file.js
generated
vendored
40
tools/eslint/node_modules/@babel/core/lib/transform-file.js
generated
vendored
|
|
@ -1,40 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.transformFile = transformFile;
|
||||
exports.transformFileAsync = transformFileAsync;
|
||||
exports.transformFileSync = transformFileSync;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _index = require("./config/index.js");
|
||||
var _index2 = require("./transformation/index.js");
|
||||
var fs = require("./gensync-utils/fs.js");
|
||||
({});
|
||||
const transformFileRunner = _gensync()(function* (filename, opts) {
|
||||
const options = Object.assign({}, opts, {
|
||||
filename
|
||||
});
|
||||
const config = yield* (0, _index.default)(options);
|
||||
if (config === null) return null;
|
||||
const code = yield* fs.readFile(filename, "utf8");
|
||||
return yield* (0, _index2.run)(config, code);
|
||||
});
|
||||
function transformFile(...args) {
|
||||
transformFileRunner.errback(...args);
|
||||
}
|
||||
function transformFileSync(...args) {
|
||||
return transformFileRunner.sync(...args);
|
||||
}
|
||||
function transformFileAsync(...args) {
|
||||
return transformFileRunner.async(...args);
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=transform-file.js.map
|
||||
49
tools/eslint/node_modules/@babel/core/lib/transform.js
generated
vendored
49
tools/eslint/node_modules/@babel/core/lib/transform.js
generated
vendored
|
|
@ -1,49 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.transform = void 0;
|
||||
exports.transformAsync = transformAsync;
|
||||
exports.transformSync = transformSync;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _index = require("./config/index.js");
|
||||
var _index2 = require("./transformation/index.js");
|
||||
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
|
||||
const transformRunner = _gensync()(function* transform(code, opts) {
|
||||
const config = yield* (0, _index.default)(opts);
|
||||
if (config === null) return null;
|
||||
return yield* (0, _index2.run)(config, code);
|
||||
});
|
||||
const transform = exports.transform = function transform(code, optsOrCallback, maybeCallback) {
|
||||
let opts;
|
||||
let callback;
|
||||
if (typeof optsOrCallback === "function") {
|
||||
callback = optsOrCallback;
|
||||
opts = undefined;
|
||||
} else {
|
||||
opts = optsOrCallback;
|
||||
callback = maybeCallback;
|
||||
}
|
||||
if (callback === undefined) {
|
||||
{
|
||||
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(code, opts);
|
||||
}
|
||||
}
|
||||
(0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.errback)(code, opts, callback);
|
||||
};
|
||||
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
|
||||
84
tools/eslint/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js
generated
vendored
84
tools/eslint/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js
generated
vendored
|
|
@ -1,84 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = loadBlockHoistPlugin;
|
||||
function _traverse() {
|
||||
const data = require("@babel/traverse");
|
||||
_traverse = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _plugin = require("../config/plugin.js");
|
||||
let LOADED_PLUGIN;
|
||||
const blockHoistPlugin = {
|
||||
name: "internal.blockHoist",
|
||||
visitor: {
|
||||
Block: {
|
||||
exit({
|
||||
node
|
||||
}) {
|
||||
node.body = performHoisting(node.body);
|
||||
}
|
||||
},
|
||||
SwitchCase: {
|
||||
exit({
|
||||
node
|
||||
}) {
|
||||
node.consequent = performHoisting(node.consequent);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function performHoisting(body) {
|
||||
let max = Math.pow(2, 30) - 1;
|
||||
let hasChange = false;
|
||||
for (let i = 0; i < body.length; i++) {
|
||||
const n = body[i];
|
||||
const p = priority(n);
|
||||
if (p > max) {
|
||||
hasChange = true;
|
||||
break;
|
||||
}
|
||||
max = p;
|
||||
}
|
||||
if (!hasChange) return body;
|
||||
return stableSort(body.slice());
|
||||
}
|
||||
function loadBlockHoistPlugin() {
|
||||
if (!LOADED_PLUGIN) {
|
||||
LOADED_PLUGIN = new _plugin.default(Object.assign({}, blockHoistPlugin, {
|
||||
visitor: _traverse().default.explode(blockHoistPlugin.visitor)
|
||||
}), {});
|
||||
}
|
||||
return LOADED_PLUGIN;
|
||||
}
|
||||
function priority(bodyNode) {
|
||||
const priority = bodyNode == null ? void 0 : bodyNode._blockHoist;
|
||||
if (priority == null) return 1;
|
||||
if (priority === true) return 2;
|
||||
return priority;
|
||||
}
|
||||
function stableSort(body) {
|
||||
const buckets = Object.create(null);
|
||||
for (let i = 0; i < body.length; i++) {
|
||||
const n = body[i];
|
||||
const p = priority(n);
|
||||
const bucket = buckets[p] || (buckets[p] = []);
|
||||
bucket.push(n);
|
||||
}
|
||||
const keys = Object.keys(buckets).map(k => +k).sort((a, b) => b - a);
|
||||
let index = 0;
|
||||
for (const key of keys) {
|
||||
const bucket = buckets[key];
|
||||
for (const n of bucket) {
|
||||
body[index++] = n;
|
||||
}
|
||||
}
|
||||
return body;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=block-hoist-plugin.js.map
|
||||
4
tools/eslint/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs
generated
vendored
4
tools/eslint/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs
generated
vendored
|
|
@ -1,4 +0,0 @@
|
|||
exports.getModuleName = () => require("@babel/helper-module-transforms").getModuleName;
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=babel-7-helpers.cjs.map
|
||||
214
tools/eslint/node_modules/@babel/core/lib/transformation/file/file.js
generated
vendored
214
tools/eslint/node_modules/@babel/core/lib/transformation/file/file.js
generated
vendored
|
|
@ -1,214 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function helpers() {
|
||||
const data = require("@babel/helpers");
|
||||
helpers = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _traverse() {
|
||||
const data = require("@babel/traverse");
|
||||
_traverse = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _codeFrame() {
|
||||
const data = require("@babel/code-frame");
|
||||
_codeFrame = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _t() {
|
||||
const data = require("@babel/types");
|
||||
_t = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _semver() {
|
||||
const data = require("semver");
|
||||
_semver = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var babel7 = _interopRequireWildcard(require("./babel-7-helpers.cjs"), true);
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
const {
|
||||
cloneNode,
|
||||
interpreterDirective
|
||||
} = _t();
|
||||
const errorVisitor = {
|
||||
enter(path, state) {
|
||||
const loc = path.node.loc;
|
||||
if (loc) {
|
||||
state.loc = loc;
|
||||
path.stop();
|
||||
}
|
||||
}
|
||||
};
|
||||
class File {
|
||||
constructor(options, {
|
||||
code,
|
||||
ast,
|
||||
inputMap
|
||||
}) {
|
||||
this._map = new Map();
|
||||
this.opts = void 0;
|
||||
this.declarations = {};
|
||||
this.path = void 0;
|
||||
this.ast = void 0;
|
||||
this.scope = void 0;
|
||||
this.metadata = {};
|
||||
this.code = "";
|
||||
this.inputMap = void 0;
|
||||
this.hub = {
|
||||
file: this,
|
||||
getCode: () => this.code,
|
||||
getScope: () => this.scope,
|
||||
addHelper: this.addHelper.bind(this),
|
||||
buildError: this.buildCodeFrameError.bind(this)
|
||||
};
|
||||
this.opts = options;
|
||||
this.code = code;
|
||||
this.ast = ast;
|
||||
this.inputMap = inputMap;
|
||||
this.path = _traverse().NodePath.get({
|
||||
hub: this.hub,
|
||||
parentPath: null,
|
||||
parent: this.ast,
|
||||
container: this.ast,
|
||||
key: "program"
|
||||
}).setContext();
|
||||
this.scope = this.path.scope;
|
||||
}
|
||||
get shebang() {
|
||||
const {
|
||||
interpreter
|
||||
} = this.path.node;
|
||||
return interpreter ? interpreter.value : "";
|
||||
}
|
||||
set shebang(value) {
|
||||
if (value) {
|
||||
this.path.get("interpreter").replaceWith(interpreterDirective(value));
|
||||
} else {
|
||||
this.path.get("interpreter").remove();
|
||||
}
|
||||
}
|
||||
set(key, val) {
|
||||
{
|
||||
if (key === "helpersNamespace") {
|
||||
throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." + "If you are using @babel/plugin-external-helpers you will need to use a newer " + "version than the one you currently have installed. " + "If you have your own implementation, you'll want to explore using 'helperGenerator' " + "alongside 'file.availableHelper()'.");
|
||||
}
|
||||
}
|
||||
this._map.set(key, val);
|
||||
}
|
||||
get(key) {
|
||||
return this._map.get(key);
|
||||
}
|
||||
has(key) {
|
||||
return this._map.has(key);
|
||||
}
|
||||
availableHelper(name, versionRange) {
|
||||
let minVersion;
|
||||
try {
|
||||
minVersion = helpers().minVersion(name);
|
||||
} catch (err) {
|
||||
if (err.code !== "BABEL_HELPER_UNKNOWN") throw err;
|
||||
return false;
|
||||
}
|
||||
if (typeof versionRange !== "string") return true;
|
||||
if (_semver().valid(versionRange)) versionRange = `^${versionRange}`;
|
||||
{
|
||||
return !_semver().intersects(`<${minVersion}`, versionRange) && !_semver().intersects(`>=8.0.0`, versionRange);
|
||||
}
|
||||
}
|
||||
addHelper(name) {
|
||||
const declar = this.declarations[name];
|
||||
if (declar) return cloneNode(declar);
|
||||
const generator = this.get("helperGenerator");
|
||||
if (generator) {
|
||||
const res = generator(name);
|
||||
if (res) return res;
|
||||
}
|
||||
helpers().minVersion(name);
|
||||
const uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
|
||||
const dependencies = {};
|
||||
for (const dep of helpers().getDependencies(name)) {
|
||||
dependencies[dep] = this.addHelper(dep);
|
||||
}
|
||||
const {
|
||||
nodes,
|
||||
globals
|
||||
} = helpers().get(name, dep => dependencies[dep], uid.name, Object.keys(this.scope.getAllBindings()));
|
||||
globals.forEach(name => {
|
||||
if (this.path.scope.hasBinding(name, true)) {
|
||||
this.path.scope.rename(name);
|
||||
}
|
||||
});
|
||||
nodes.forEach(node => {
|
||||
node._compact = true;
|
||||
});
|
||||
const added = this.path.unshiftContainer("body", nodes);
|
||||
for (const path of added) {
|
||||
if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);
|
||||
}
|
||||
return uid;
|
||||
}
|
||||
buildCodeFrameError(node, msg, _Error = SyntaxError) {
|
||||
let loc = node == null ? void 0 : node.loc;
|
||||
if (!loc && node) {
|
||||
const state = {
|
||||
loc: null
|
||||
};
|
||||
(0, _traverse().default)(node, errorVisitor, this.scope, state);
|
||||
loc = state.loc;
|
||||
let txt = "This is an error on an internal node. Probably an internal error.";
|
||||
if (loc) txt += " Location has been estimated.";
|
||||
msg += ` (${txt})`;
|
||||
}
|
||||
if (loc) {
|
||||
const {
|
||||
highlightCode = true
|
||||
} = this.opts;
|
||||
msg += "\n" + (0, _codeFrame().codeFrameColumns)(this.code, {
|
||||
start: {
|
||||
line: loc.start.line,
|
||||
column: loc.start.column + 1
|
||||
},
|
||||
end: loc.end && loc.start.line === loc.end.line ? {
|
||||
line: loc.end.line,
|
||||
column: loc.end.column + 1
|
||||
} : undefined
|
||||
}, {
|
||||
highlightCode
|
||||
});
|
||||
}
|
||||
return new _Error(msg);
|
||||
}
|
||||
}
|
||||
exports.default = File;
|
||||
{
|
||||
File.prototype.addImport = function addImport() {
|
||||
throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'.");
|
||||
};
|
||||
File.prototype.addTemplateObject = function addTemplateObject() {
|
||||
throw new Error("This function has been moved into the template literal transform itself.");
|
||||
};
|
||||
{
|
||||
File.prototype.getModuleName = function getModuleName() {
|
||||
return babel7.getModuleName()(this.opts, this.opts);
|
||||
};
|
||||
}
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=file.js.map
|
||||
84
tools/eslint/node_modules/@babel/core/lib/transformation/file/generate.js
generated
vendored
84
tools/eslint/node_modules/@babel/core/lib/transformation/file/generate.js
generated
vendored
|
|
@ -1,84 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = generateCode;
|
||||
function _convertSourceMap() {
|
||||
const data = require("convert-source-map");
|
||||
_convertSourceMap = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _generator() {
|
||||
const data = require("@babel/generator");
|
||||
_generator = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _mergeMap = require("./merge-map.js");
|
||||
function generateCode(pluginPasses, file) {
|
||||
const {
|
||||
opts,
|
||||
ast,
|
||||
code,
|
||||
inputMap
|
||||
} = file;
|
||||
const {
|
||||
generatorOpts
|
||||
} = opts;
|
||||
generatorOpts.inputSourceMap = inputMap == null ? void 0 : inputMap.toObject();
|
||||
const results = [];
|
||||
for (const plugins of pluginPasses) {
|
||||
for (const plugin of plugins) {
|
||||
const {
|
||||
generatorOverride
|
||||
} = plugin;
|
||||
if (generatorOverride) {
|
||||
const result = generatorOverride(ast, generatorOpts, code, _generator().default);
|
||||
if (result !== undefined) results.push(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
let result;
|
||||
if (results.length === 0) {
|
||||
result = (0, _generator().default)(ast, generatorOpts, code);
|
||||
} else if (results.length === 1) {
|
||||
result = results[0];
|
||||
if (typeof result.then === "function") {
|
||||
throw new Error(`You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`);
|
||||
}
|
||||
} else {
|
||||
throw new Error("More than one plugin attempted to override codegen.");
|
||||
}
|
||||
let {
|
||||
code: outputCode,
|
||||
decodedMap: outputMap = result.map
|
||||
} = result;
|
||||
if (result.__mergedMap) {
|
||||
outputMap = Object.assign({}, result.map);
|
||||
} else {
|
||||
if (outputMap) {
|
||||
if (inputMap) {
|
||||
outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap, generatorOpts.sourceFileName);
|
||||
} else {
|
||||
outputMap = result.map;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
|
||||
outputCode += "\n" + _convertSourceMap().fromObject(outputMap).toComment();
|
||||
}
|
||||
if (opts.sourceMaps === "inline") {
|
||||
outputMap = null;
|
||||
}
|
||||
return {
|
||||
outputCode,
|
||||
outputMap
|
||||
};
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=generate.js.map
|
||||
37
tools/eslint/node_modules/@babel/core/lib/transformation/file/merge-map.js
generated
vendored
37
tools/eslint/node_modules/@babel/core/lib/transformation/file/merge-map.js
generated
vendored
|
|
@ -1,37 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = mergeSourceMap;
|
||||
function _remapping() {
|
||||
const data = require("@ampproject/remapping");
|
||||
_remapping = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function mergeSourceMap(inputMap, map, sourceFileName) {
|
||||
const source = sourceFileName.replace(/\\/g, "/");
|
||||
let found = false;
|
||||
const result = _remapping()(rootless(map), (s, ctx) => {
|
||||
if (s === source && !found) {
|
||||
found = true;
|
||||
ctx.source = "";
|
||||
return rootless(inputMap);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
if (typeof inputMap.sourceRoot === "string") {
|
||||
result.sourceRoot = inputMap.sourceRoot;
|
||||
}
|
||||
return Object.assign({}, result);
|
||||
}
|
||||
function rootless(map) {
|
||||
return Object.assign({}, map, {
|
||||
sourceRoot: null
|
||||
});
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=merge-map.js.map
|
||||
101
tools/eslint/node_modules/@babel/core/lib/transformation/index.js
generated
vendored
101
tools/eslint/node_modules/@babel/core/lib/transformation/index.js
generated
vendored
|
|
@ -1,101 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.run = run;
|
||||
function _traverse() {
|
||||
const data = require("@babel/traverse");
|
||||
_traverse = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _pluginPass = require("./plugin-pass.js");
|
||||
var _blockHoistPlugin = require("./block-hoist-plugin.js");
|
||||
var _normalizeOpts = require("./normalize-opts.js");
|
||||
var _normalizeFile = require("./normalize-file.js");
|
||||
var _generate = require("./file/generate.js");
|
||||
var _deepArray = require("../config/helpers/deep-array.js");
|
||||
function* run(config, code, ast) {
|
||||
const file = yield* (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast);
|
||||
const opts = file.opts;
|
||||
try {
|
||||
yield* transformFile(file, config.passes);
|
||||
} catch (e) {
|
||||
var _opts$filename;
|
||||
e.message = `${(_opts$filename = opts.filename) != null ? _opts$filename : "unknown file"}: ${e.message}`;
|
||||
if (!e.code) {
|
||||
e.code = "BABEL_TRANSFORM_ERROR";
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
let outputCode, outputMap;
|
||||
try {
|
||||
if (opts.code !== false) {
|
||||
({
|
||||
outputCode,
|
||||
outputMap
|
||||
} = (0, _generate.default)(config.passes, file));
|
||||
}
|
||||
} catch (e) {
|
||||
var _opts$filename2;
|
||||
e.message = `${(_opts$filename2 = opts.filename) != null ? _opts$filename2 : "unknown file"}: ${e.message}`;
|
||||
if (!e.code) {
|
||||
e.code = "BABEL_GENERATE_ERROR";
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return {
|
||||
metadata: file.metadata,
|
||||
options: opts,
|
||||
ast: opts.ast === true ? file.ast : null,
|
||||
code: outputCode === undefined ? null : outputCode,
|
||||
map: outputMap === undefined ? null : outputMap,
|
||||
sourceType: file.ast.program.sourceType,
|
||||
externalDependencies: (0, _deepArray.flattenToSet)(config.externalDependencies)
|
||||
};
|
||||
}
|
||||
function* transformFile(file, pluginPasses) {
|
||||
for (const pluginPairs of pluginPasses) {
|
||||
const passPairs = [];
|
||||
const passes = [];
|
||||
const visitors = [];
|
||||
for (const plugin of pluginPairs.concat([(0, _blockHoistPlugin.default)()])) {
|
||||
const pass = new _pluginPass.default(file, plugin.key, plugin.options);
|
||||
passPairs.push([plugin, pass]);
|
||||
passes.push(pass);
|
||||
visitors.push(plugin.visitor);
|
||||
}
|
||||
for (const [plugin, pass] of passPairs) {
|
||||
const fn = plugin.pre;
|
||||
if (fn) {
|
||||
const result = fn.call(pass, file);
|
||||
yield* [];
|
||||
if (isThenable(result)) {
|
||||
throw new Error(`You appear to be using an plugin with an async .pre, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod);
|
||||
{
|
||||
(0, _traverse().default)(file.ast, visitor, file.scope);
|
||||
}
|
||||
for (const [plugin, pass] of passPairs) {
|
||||
const fn = plugin.post;
|
||||
if (fn) {
|
||||
const result = fn.call(pass, file);
|
||||
yield* [];
|
||||
if (isThenable(result)) {
|
||||
throw new Error(`You appear to be using an plugin with an async .post, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function isThenable(val) {
|
||||
return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
129
tools/eslint/node_modules/@babel/core/lib/transformation/normalize-file.js
generated
vendored
129
tools/eslint/node_modules/@babel/core/lib/transformation/normalize-file.js
generated
vendored
|
|
@ -1,129 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = normalizeFile;
|
||||
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 _debug() {
|
||||
const data = require("debug");
|
||||
_debug = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _t() {
|
||||
const data = require("@babel/types");
|
||||
_t = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _convertSourceMap() {
|
||||
const data = require("convert-source-map");
|
||||
_convertSourceMap = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _file = require("./file/file.js");
|
||||
var _index = require("../parser/index.js");
|
||||
var _cloneDeep = require("./util/clone-deep.js");
|
||||
const {
|
||||
file,
|
||||
traverseFast
|
||||
} = _t();
|
||||
const debug = _debug()("babel:transform:file");
|
||||
const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
|
||||
const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
|
||||
function* normalizeFile(pluginPasses, options, code, ast) {
|
||||
code = `${code || ""}`;
|
||||
if (ast) {
|
||||
if (ast.type === "Program") {
|
||||
ast = file(ast, [], []);
|
||||
} else if (ast.type !== "File") {
|
||||
throw new Error("AST root must be a Program or File node");
|
||||
}
|
||||
if (options.cloneInputAst) {
|
||||
ast = (0, _cloneDeep.default)(ast);
|
||||
}
|
||||
} else {
|
||||
ast = yield* (0, _index.default)(pluginPasses, options, code);
|
||||
}
|
||||
let inputMap = null;
|
||||
if (options.inputSourceMap !== false) {
|
||||
if (typeof options.inputSourceMap === "object") {
|
||||
inputMap = _convertSourceMap().fromObject(options.inputSourceMap);
|
||||
}
|
||||
if (!inputMap) {
|
||||
const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);
|
||||
if (lastComment) {
|
||||
try {
|
||||
inputMap = _convertSourceMap().fromComment("//" + lastComment);
|
||||
} catch (err) {
|
||||
{
|
||||
debug("discarding unknown inline input sourcemap");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!inputMap) {
|
||||
const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);
|
||||
if (typeof options.filename === "string" && lastComment) {
|
||||
try {
|
||||
const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment);
|
||||
const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1]), "utf8");
|
||||
inputMap = _convertSourceMap().fromJSON(inputMapContent);
|
||||
} catch (err) {
|
||||
debug("discarding unknown file input sourcemap", err);
|
||||
}
|
||||
} else if (lastComment) {
|
||||
debug("discarding un-loadable file input sourcemap");
|
||||
}
|
||||
}
|
||||
}
|
||||
return new _file.default(options, {
|
||||
code,
|
||||
ast: ast,
|
||||
inputMap
|
||||
});
|
||||
}
|
||||
function extractCommentsFromList(regex, comments, lastComment) {
|
||||
if (comments) {
|
||||
comments = comments.filter(({
|
||||
value
|
||||
}) => {
|
||||
if (regex.test(value)) {
|
||||
lastComment = value;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
return [comments, lastComment];
|
||||
}
|
||||
function extractComments(regex, ast) {
|
||||
let lastComment = null;
|
||||
traverseFast(ast, node => {
|
||||
[node.leadingComments, lastComment] = extractCommentsFromList(regex, node.leadingComments, lastComment);
|
||||
[node.innerComments, lastComment] = extractCommentsFromList(regex, node.innerComments, lastComment);
|
||||
[node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment);
|
||||
});
|
||||
return lastComment;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=normalize-file.js.map
|
||||
59
tools/eslint/node_modules/@babel/core/lib/transformation/normalize-opts.js
generated
vendored
59
tools/eslint/node_modules/@babel/core/lib/transformation/normalize-opts.js
generated
vendored
|
|
@ -1,59 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = normalizeOptions;
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function normalizeOptions(config) {
|
||||
const {
|
||||
filename,
|
||||
cwd,
|
||||
filenameRelative = typeof filename === "string" ? _path().relative(cwd, filename) : "unknown",
|
||||
sourceType = "module",
|
||||
inputSourceMap,
|
||||
sourceMaps = !!inputSourceMap,
|
||||
sourceRoot = config.options.moduleRoot,
|
||||
sourceFileName = _path().basename(filenameRelative),
|
||||
comments = true,
|
||||
compact = "auto"
|
||||
} = config.options;
|
||||
const opts = config.options;
|
||||
const options = Object.assign({}, opts, {
|
||||
parserOpts: Object.assign({
|
||||
sourceType: _path().extname(filenameRelative) === ".mjs" ? "module" : sourceType,
|
||||
sourceFileName: filename,
|
||||
plugins: []
|
||||
}, opts.parserOpts),
|
||||
generatorOpts: Object.assign({
|
||||
filename,
|
||||
auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
|
||||
auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
|
||||
retainLines: opts.retainLines,
|
||||
comments,
|
||||
shouldPrintComment: opts.shouldPrintComment,
|
||||
compact,
|
||||
minified: opts.minified,
|
||||
sourceMaps,
|
||||
sourceRoot,
|
||||
sourceFileName
|
||||
}, opts.generatorOpts)
|
||||
});
|
||||
for (const plugins of config.passes) {
|
||||
for (const plugin of plugins) {
|
||||
if (plugin.manipulateOptions) {
|
||||
plugin.manipulateOptions(options, options.parserOpts);
|
||||
}
|
||||
}
|
||||
}
|
||||
return options;
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=normalize-opts.js.map
|
||||
48
tools/eslint/node_modules/@babel/core/lib/transformation/plugin-pass.js
generated
vendored
48
tools/eslint/node_modules/@babel/core/lib/transformation/plugin-pass.js
generated
vendored
|
|
@ -1,48 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
class PluginPass {
|
||||
constructor(file, key, options) {
|
||||
this._map = new Map();
|
||||
this.key = void 0;
|
||||
this.file = void 0;
|
||||
this.opts = void 0;
|
||||
this.cwd = void 0;
|
||||
this.filename = void 0;
|
||||
this.key = key;
|
||||
this.file = file;
|
||||
this.opts = options || {};
|
||||
this.cwd = file.opts.cwd;
|
||||
this.filename = file.opts.filename;
|
||||
}
|
||||
set(key, val) {
|
||||
this._map.set(key, val);
|
||||
}
|
||||
get(key) {
|
||||
return this._map.get(key);
|
||||
}
|
||||
availableHelper(name, versionRange) {
|
||||
return this.file.availableHelper(name, versionRange);
|
||||
}
|
||||
addHelper(name) {
|
||||
return this.file.addHelper(name);
|
||||
}
|
||||
buildCodeFrameError(node, msg, _Error) {
|
||||
return this.file.buildCodeFrameError(node, msg, _Error);
|
||||
}
|
||||
}
|
||||
exports.default = PluginPass;
|
||||
{
|
||||
PluginPass.prototype.getModuleName = function getModuleName() {
|
||||
return this.file.getModuleName();
|
||||
};
|
||||
PluginPass.prototype.addImport = function addImport() {
|
||||
this.file.addImport();
|
||||
};
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=plugin-pass.js.map
|
||||
36
tools/eslint/node_modules/@babel/core/lib/transformation/util/clone-deep.js
generated
vendored
36
tools/eslint/node_modules/@babel/core/lib/transformation/util/clone-deep.js
generated
vendored
|
|
@ -1,36 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
function deepClone(value, cache) {
|
||||
if (value !== null) {
|
||||
if (cache.has(value)) return cache.get(value);
|
||||
let cloned;
|
||||
if (Array.isArray(value)) {
|
||||
cloned = new Array(value.length);
|
||||
cache.set(value, cloned);
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache);
|
||||
}
|
||||
} else {
|
||||
cloned = {};
|
||||
cache.set(value, cloned);
|
||||
const keys = Object.keys(value);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache);
|
||||
}
|
||||
}
|
||||
return cloned;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function _default(value) {
|
||||
if (typeof value !== "object") return value;
|
||||
return deepClone(value, new Map());
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=clone-deep.js.map
|
||||
1043
tools/eslint/node_modules/@babel/core/lib/vendor/import-meta-resolve.js
generated
vendored
1043
tools/eslint/node_modules/@babel/core/lib/vendor/import-meta-resolve.js
generated
vendored
File diff suppressed because it is too large
Load Diff
82
tools/eslint/node_modules/@babel/core/package.json
generated
vendored
82
tools/eslint/node_modules/@babel/core/package.json
generated
vendored
|
|
@ -1,82 +0,0 @@
|
|||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.24.9",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "./lib/index.js",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-core"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-core",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen",
|
||||
"keywords": [
|
||||
"6to5",
|
||||
"babel",
|
||||
"classes",
|
||||
"const",
|
||||
"es6",
|
||||
"harmony",
|
||||
"let",
|
||||
"modules",
|
||||
"transpile",
|
||||
"transpiler",
|
||||
"var",
|
||||
"babel-core",
|
||||
"compiler"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/babel"
|
||||
},
|
||||
"browser": {
|
||||
"./lib/config/files/index.js": "./lib/config/files/index-browser.js",
|
||||
"./lib/config/resolve-targets.js": "./lib/config/resolve-targets-browser.js",
|
||||
"./lib/transform-file.js": "./lib/transform-file-browser.js",
|
||||
"./src/config/files/index.ts": "./src/config/files/index-browser.ts",
|
||||
"./src/config/resolve-targets.ts": "./src/config/resolve-targets-browser.ts",
|
||||
"./src/transform-file.ts": "./src/transform-file-browser.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ampproject/remapping": "^2.2.0",
|
||||
"@babel/code-frame": "^7.24.7",
|
||||
"@babel/generator": "^7.24.9",
|
||||
"@babel/helper-compilation-targets": "^7.24.8",
|
||||
"@babel/helper-module-transforms": "^7.24.9",
|
||||
"@babel/helpers": "^7.24.8",
|
||||
"@babel/parser": "^7.24.8",
|
||||
"@babel/template": "^7.24.7",
|
||||
"@babel/traverse": "^7.24.8",
|
||||
"@babel/types": "^7.24.9",
|
||||
"convert-source-map": "^2.0.0",
|
||||
"debug": "^4.1.0",
|
||||
"gensync": "^1.0.0-beta.2",
|
||||
"json5": "^2.2.3",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-transform-fixture-test-runner": "^7.24.8",
|
||||
"@babel/plugin-syntax-flow": "^7.24.7",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.24.7",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.24.8",
|
||||
"@babel/preset-env": "^7.24.8",
|
||||
"@babel/preset-typescript": "^7.24.7",
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"@types/convert-source-map": "^2.0.0",
|
||||
"@types/debug": "^4.1.0",
|
||||
"@types/gensync": "^1.0.0",
|
||||
"@types/resolve": "^1.3.2",
|
||||
"@types/semver": "^5.4.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"ts-node": "^11.0.0-beta.1"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
22
tools/eslint/node_modules/@babel/eslint-parser/LICENSE
generated
vendored
22
tools/eslint/node_modules/@babel/eslint-parser/LICENSE
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
319
tools/eslint/node_modules/@babel/eslint-parser/lib/analyze-scope.cjs
generated
vendored
319
tools/eslint/node_modules/@babel/eslint-parser/lib/analyze-scope.cjs
generated
vendored
|
|
@ -1,319 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
||||
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
||||
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
||||
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
||||
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
||||
const {
|
||||
Definition,
|
||||
PatternVisitor: OriginalPatternVisitor,
|
||||
Referencer: OriginalReferencer,
|
||||
Scope,
|
||||
ScopeManager
|
||||
} = require("@nicolo-ribaudo/eslint-scope-5-internals");
|
||||
const {
|
||||
getKeys: fallback
|
||||
} = require("eslint-visitor-keys");
|
||||
let visitorKeysMap;
|
||||
function getVisitorValues(nodeType, client) {
|
||||
if (visitorKeysMap) return visitorKeysMap[nodeType];
|
||||
const {
|
||||
FLOW_FLIPPED_ALIAS_KEYS,
|
||||
VISITOR_KEYS
|
||||
} = client.getTypesInfo();
|
||||
const flowFlippedAliasKeys = FLOW_FLIPPED_ALIAS_KEYS.concat(["ArrayPattern", "ClassDeclaration", "ClassExpression", "FunctionDeclaration", "FunctionExpression", "Identifier", "ObjectPattern", "RestElement"]);
|
||||
visitorKeysMap = (Object.entries || (o => Object.keys(o).map(k => [k, o[k]])))(VISITOR_KEYS).reduce((acc, [key, value]) => {
|
||||
if (!flowFlippedAliasKeys.includes(value)) {
|
||||
acc[key] = value;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
return visitorKeysMap[nodeType];
|
||||
}
|
||||
const propertyTypes = {
|
||||
callProperties: {
|
||||
type: "loop",
|
||||
values: ["value"]
|
||||
},
|
||||
indexers: {
|
||||
type: "loop",
|
||||
values: ["key", "value"]
|
||||
},
|
||||
properties: {
|
||||
type: "loop",
|
||||
values: ["argument", "value"]
|
||||
},
|
||||
types: {
|
||||
type: "loop"
|
||||
},
|
||||
params: {
|
||||
type: "loop"
|
||||
},
|
||||
argument: {
|
||||
type: "single"
|
||||
},
|
||||
elementType: {
|
||||
type: "single"
|
||||
},
|
||||
qualification: {
|
||||
type: "single"
|
||||
},
|
||||
rest: {
|
||||
type: "single"
|
||||
},
|
||||
returnType: {
|
||||
type: "single"
|
||||
},
|
||||
typeAnnotation: {
|
||||
type: "typeAnnotation"
|
||||
},
|
||||
typeParameters: {
|
||||
type: "typeParameters"
|
||||
},
|
||||
id: {
|
||||
type: "id"
|
||||
}
|
||||
};
|
||||
class PatternVisitor extends OriginalPatternVisitor {
|
||||
ArrayPattern(node) {
|
||||
node.elements.forEach(this.visit, this);
|
||||
}
|
||||
ObjectPattern(node) {
|
||||
node.properties.forEach(this.visit, this);
|
||||
}
|
||||
}
|
||||
var _client = new WeakMap();
|
||||
class Referencer extends OriginalReferencer {
|
||||
constructor(options, scopeManager, client) {
|
||||
super(options, scopeManager);
|
||||
_classPrivateFieldInitSpec(this, _client, void 0);
|
||||
_classPrivateFieldSet(_client, this, client);
|
||||
}
|
||||
visitPattern(node, options, callback) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
this._checkIdentifierOrVisit(node.typeAnnotation);
|
||||
if (node.type === "AssignmentPattern") {
|
||||
this._checkIdentifierOrVisit(node.left.typeAnnotation);
|
||||
}
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = {
|
||||
processRightHandNodes: false
|
||||
};
|
||||
}
|
||||
const visitor = new PatternVisitor(this.options, node, callback);
|
||||
visitor.visit(node);
|
||||
if (options.processRightHandNodes) {
|
||||
visitor.rightHandNodes.forEach(this.visit, this);
|
||||
}
|
||||
}
|
||||
visitClass(node) {
|
||||
var _node$superTypeParame;
|
||||
this._visitArray(node.decorators);
|
||||
const typeParamScope = this._nestTypeParamScope(node);
|
||||
this._visitTypeAnnotation(node.implements);
|
||||
this._visitTypeAnnotation((_node$superTypeParame = node.superTypeParameters) == null ? void 0 : _node$superTypeParame.params);
|
||||
super.visitClass(node);
|
||||
if (typeParamScope) {
|
||||
this.close(node);
|
||||
}
|
||||
}
|
||||
visitFunction(node) {
|
||||
const typeParamScope = this._nestTypeParamScope(node);
|
||||
this._checkIdentifierOrVisit(node.returnType);
|
||||
super.visitFunction(node);
|
||||
if (typeParamScope) {
|
||||
this.close(node);
|
||||
}
|
||||
}
|
||||
visitProperty(node) {
|
||||
var _node$value;
|
||||
if (((_node$value = node.value) == null ? void 0 : _node$value.type) === "TypeCastExpression") {
|
||||
this._visitTypeAnnotation(node.value);
|
||||
}
|
||||
this._visitArray(node.decorators);
|
||||
super.visitProperty(node);
|
||||
}
|
||||
InterfaceDeclaration(node) {
|
||||
this._createScopeVariable(node, node.id);
|
||||
const typeParamScope = this._nestTypeParamScope(node);
|
||||
this._visitArray(node.extends);
|
||||
this.visit(node.body);
|
||||
if (typeParamScope) {
|
||||
this.close(node);
|
||||
}
|
||||
}
|
||||
TypeAlias(node) {
|
||||
this._createScopeVariable(node, node.id);
|
||||
const typeParamScope = this._nestTypeParamScope(node);
|
||||
this.visit(node.right);
|
||||
if (typeParamScope) {
|
||||
this.close(node);
|
||||
}
|
||||
}
|
||||
ClassProperty(node) {
|
||||
this._visitClassProperty(node);
|
||||
}
|
||||
ClassPrivateProperty(node) {
|
||||
this._visitClassProperty(node);
|
||||
}
|
||||
PropertyDefinition(node) {
|
||||
this._visitClassProperty(node);
|
||||
}
|
||||
ClassPrivateMethod(node) {
|
||||
super.MethodDefinition(node);
|
||||
}
|
||||
DeclareModule(node) {
|
||||
this._visitDeclareX(node);
|
||||
}
|
||||
DeclareFunction(node) {
|
||||
this._visitDeclareX(node);
|
||||
}
|
||||
DeclareVariable(node) {
|
||||
this._visitDeclareX(node);
|
||||
}
|
||||
DeclareClass(node) {
|
||||
this._visitDeclareX(node);
|
||||
}
|
||||
OptionalMemberExpression(node) {
|
||||
super.MemberExpression(node);
|
||||
}
|
||||
_visitClassProperty(node) {
|
||||
const {
|
||||
computed,
|
||||
key,
|
||||
typeAnnotation,
|
||||
decorators,
|
||||
value
|
||||
} = node;
|
||||
this._visitArray(decorators);
|
||||
if (computed) this.visit(key);
|
||||
this._visitTypeAnnotation(typeAnnotation);
|
||||
if (value) {
|
||||
if (this.scopeManager.__nestClassFieldInitializerScope) {
|
||||
this.scopeManager.__nestClassFieldInitializerScope(value);
|
||||
} else {
|
||||
this.scopeManager.__nestScope(new Scope(this.scopeManager, "function", this.scopeManager.__currentScope, value, true));
|
||||
}
|
||||
this.visit(value);
|
||||
this.close(value);
|
||||
}
|
||||
}
|
||||
_visitDeclareX(node) {
|
||||
if (node.id) {
|
||||
this._createScopeVariable(node, node.id);
|
||||
}
|
||||
const typeParamScope = this._nestTypeParamScope(node);
|
||||
if (typeParamScope) {
|
||||
this.close(node);
|
||||
}
|
||||
}
|
||||
_createScopeVariable(node, name) {
|
||||
this.currentScope().variableScope.__define(name, new Definition("Variable", name, node, null, null, null));
|
||||
}
|
||||
_nestTypeParamScope(node) {
|
||||
if (!node.typeParameters) {
|
||||
return null;
|
||||
}
|
||||
const parentScope = this.scopeManager.__currentScope;
|
||||
const scope = new Scope(this.scopeManager, "type-parameters", parentScope, node, false);
|
||||
this.scopeManager.__nestScope(scope);
|
||||
for (let j = 0; j < node.typeParameters.params.length; j++) {
|
||||
const name = node.typeParameters.params[j];
|
||||
scope.__define(name, new Definition("TypeParameter", name, name));
|
||||
if (name.typeAnnotation) {
|
||||
this._checkIdentifierOrVisit(name);
|
||||
}
|
||||
}
|
||||
scope.__define = parentScope.__define.bind(parentScope);
|
||||
return scope;
|
||||
}
|
||||
_visitTypeAnnotation(node) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(node)) {
|
||||
node.forEach(this._visitTypeAnnotation, this);
|
||||
return;
|
||||
}
|
||||
const visitorValues = getVisitorValues(node.type, _classPrivateFieldGet(_client, this));
|
||||
if (!visitorValues) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < visitorValues.length; i++) {
|
||||
const visitorValue = visitorValues[i];
|
||||
const propertyType = propertyTypes[visitorValue];
|
||||
const nodeProperty = node[visitorValue];
|
||||
if (propertyType == null || nodeProperty == null) {
|
||||
continue;
|
||||
}
|
||||
if (propertyType.type === "loop") {
|
||||
for (let j = 0; j < nodeProperty.length; j++) {
|
||||
if (Array.isArray(propertyType.values)) {
|
||||
for (let k = 0; k < propertyType.values.length; k++) {
|
||||
const loopPropertyNode = nodeProperty[j][propertyType.values[k]];
|
||||
if (loopPropertyNode) {
|
||||
this._checkIdentifierOrVisit(loopPropertyNode);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this._checkIdentifierOrVisit(nodeProperty[j]);
|
||||
}
|
||||
}
|
||||
} else if (propertyType.type === "single") {
|
||||
this._checkIdentifierOrVisit(nodeProperty);
|
||||
} else if (propertyType.type === "typeAnnotation") {
|
||||
this._visitTypeAnnotation(node.typeAnnotation);
|
||||
} else if (propertyType.type === "typeParameters") {
|
||||
for (let l = 0; l < node.typeParameters.params.length; l++) {
|
||||
this._checkIdentifierOrVisit(node.typeParameters.params[l]);
|
||||
}
|
||||
} else if (propertyType.type === "id") {
|
||||
if (node.id.type === "Identifier") {
|
||||
this._checkIdentifierOrVisit(node.id);
|
||||
} else {
|
||||
this._visitTypeAnnotation(node.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_checkIdentifierOrVisit(node) {
|
||||
if (node != null && node.typeAnnotation) {
|
||||
this._visitTypeAnnotation(node.typeAnnotation);
|
||||
} else if ((node == null ? void 0 : node.type) === "Identifier") {
|
||||
this.visit(node);
|
||||
} else {
|
||||
this._visitTypeAnnotation(node);
|
||||
}
|
||||
}
|
||||
_visitArray(nodeList) {
|
||||
if (nodeList) {
|
||||
for (const node of nodeList) {
|
||||
this.visit(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = function analyzeScope(ast, parserOptions, client) {
|
||||
var _parserOptions$ecmaFe;
|
||||
const options = {
|
||||
ignoreEval: true,
|
||||
optimistic: false,
|
||||
directive: false,
|
||||
nodejsScope: ast.sourceType === "script" && ((_parserOptions$ecmaFe = parserOptions.ecmaFeatures) == null ? void 0 : _parserOptions$ecmaFe.globalReturn) === true,
|
||||
impliedStrict: false,
|
||||
sourceType: ast.sourceType,
|
||||
ecmaVersion: parserOptions.ecmaVersion,
|
||||
fallback,
|
||||
childVisitorKeys: client.getVisitorKeys()
|
||||
};
|
||||
const scopeManager = new ScopeManager(options);
|
||||
const referencer = new Referencer(options, scopeManager, client);
|
||||
referencer.visit(ast);
|
||||
return scopeManager;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=analyze-scope.cjs.map
|
||||
106
tools/eslint/node_modules/@babel/eslint-parser/lib/client.cjs
generated
vendored
106
tools/eslint/node_modules/@babel/eslint-parser/lib/client.cjs
generated
vendored
|
|
@ -1,106 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.WorkerClient = exports.Client = exports.ACTIONS = void 0;
|
||||
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
||||
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
||||
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
||||
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
||||
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
||||
const path = require("path");
|
||||
const ACTIONS = exports.ACTIONS = {
|
||||
GET_VERSION: "GET_VERSION",
|
||||
GET_TYPES_INFO: "GET_TYPES_INFO",
|
||||
GET_VISITOR_KEYS: "GET_VISITOR_KEYS",
|
||||
GET_TOKEN_LABELS: "GET_TOKEN_LABELS",
|
||||
MAYBE_PARSE: "MAYBE_PARSE",
|
||||
MAYBE_PARSE_SYNC: "MAYBE_PARSE_SYNC"
|
||||
};
|
||||
var _send = new WeakMap();
|
||||
var _vCache = new WeakMap();
|
||||
var _tiCache = new WeakMap();
|
||||
var _vkCache = new WeakMap();
|
||||
var _tlCache = new WeakMap();
|
||||
class Client {
|
||||
constructor(send) {
|
||||
_classPrivateFieldInitSpec(this, _send, void 0);
|
||||
_classPrivateFieldInitSpec(this, _vCache, void 0);
|
||||
_classPrivateFieldInitSpec(this, _tiCache, void 0);
|
||||
_classPrivateFieldInitSpec(this, _vkCache, void 0);
|
||||
_classPrivateFieldInitSpec(this, _tlCache, void 0);
|
||||
_classPrivateFieldSet(_send, this, send);
|
||||
}
|
||||
getVersion() {
|
||||
var _classPrivateFieldGet2;
|
||||
return (_classPrivateFieldGet2 = _classPrivateFieldGet(_vCache, this)) != null ? _classPrivateFieldGet2 : _classPrivateFieldSet(_vCache, this, _classPrivateFieldGet(_send, this).call(this, ACTIONS.GET_VERSION, undefined));
|
||||
}
|
||||
getTypesInfo() {
|
||||
var _classPrivateFieldGet3;
|
||||
return (_classPrivateFieldGet3 = _classPrivateFieldGet(_tiCache, this)) != null ? _classPrivateFieldGet3 : _classPrivateFieldSet(_tiCache, this, _classPrivateFieldGet(_send, this).call(this, ACTIONS.GET_TYPES_INFO, undefined));
|
||||
}
|
||||
getVisitorKeys() {
|
||||
var _classPrivateFieldGet4;
|
||||
return (_classPrivateFieldGet4 = _classPrivateFieldGet(_vkCache, this)) != null ? _classPrivateFieldGet4 : _classPrivateFieldSet(_vkCache, this, _classPrivateFieldGet(_send, this).call(this, ACTIONS.GET_VISITOR_KEYS, undefined));
|
||||
}
|
||||
getTokLabels() {
|
||||
var _classPrivateFieldGet5;
|
||||
return (_classPrivateFieldGet5 = _classPrivateFieldGet(_tlCache, this)) != null ? _classPrivateFieldGet5 : _classPrivateFieldSet(_tlCache, this, _classPrivateFieldGet(_send, this).call(this, ACTIONS.GET_TOKEN_LABELS, undefined));
|
||||
}
|
||||
maybeParse(code, options) {
|
||||
return _classPrivateFieldGet(_send, this).call(this, ACTIONS.MAYBE_PARSE, {
|
||||
code,
|
||||
options
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.Client = Client;
|
||||
var _worker = new WeakMap();
|
||||
class WorkerClient extends Client {
|
||||
constructor() {
|
||||
super((action, payload) => {
|
||||
const signal = new Int32Array(new SharedArrayBuffer(8));
|
||||
const subChannel = new (_get_worker_threads(WorkerClient).MessageChannel)();
|
||||
_classPrivateFieldGet(_worker, this).postMessage({
|
||||
signal,
|
||||
port: subChannel.port1,
|
||||
action,
|
||||
payload
|
||||
}, [subChannel.port1]);
|
||||
Atomics.wait(signal, 0, 0);
|
||||
const {
|
||||
message
|
||||
} = _get_worker_threads(WorkerClient).receiveMessageOnPort(subChannel.port2);
|
||||
if (message.error) throw Object.assign(message.error, message.errorData);else return message.result;
|
||||
});
|
||||
_classPrivateFieldInitSpec(this, _worker, new (_get_worker_threads(WorkerClient).Worker)(path.resolve(__dirname, "../lib/worker/index.cjs"), {
|
||||
env: _get_worker_threads(WorkerClient).SHARE_ENV
|
||||
}));
|
||||
_classPrivateFieldGet(_worker, this).unref();
|
||||
}
|
||||
}
|
||||
exports.WorkerClient = WorkerClient;
|
||||
function _get_worker_threads(_this) {
|
||||
var _worker_threads_cache2;
|
||||
return (_worker_threads_cache2 = _worker_threads_cache._) != null ? _worker_threads_cache2 : _worker_threads_cache._ = require("worker_threads");
|
||||
}
|
||||
var _worker_threads_cache = {
|
||||
_: void 0
|
||||
};
|
||||
{
|
||||
var _LocalClient, _handleMessage;
|
||||
exports.LocalClient = (_LocalClient = class LocalClient extends Client {
|
||||
constructor() {
|
||||
var _assertClassBrand$_;
|
||||
(_assertClassBrand$_ = _assertClassBrand(_LocalClient, LocalClient, _handleMessage)._) != null ? _assertClassBrand$_ : _handleMessage._ = _assertClassBrand(_LocalClient, LocalClient, require("./worker/handle-message.cjs"));
|
||||
super((action, payload) => {
|
||||
return _assertClassBrand(_LocalClient, LocalClient, _handleMessage)._.call(LocalClient, action === ACTIONS.MAYBE_PARSE ? ACTIONS.MAYBE_PARSE_SYNC : action, payload);
|
||||
});
|
||||
}
|
||||
}, _handleMessage = {
|
||||
_: void 0
|
||||
}, _LocalClient);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=client.cjs.map
|
||||
23
tools/eslint/node_modules/@babel/eslint-parser/lib/configuration.cjs
generated
vendored
23
tools/eslint/node_modules/@babel/eslint-parser/lib/configuration.cjs
generated
vendored
|
|
@ -1,23 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
const _excluded = ["babelOptions", "ecmaVersion", "sourceType", "requireConfigFile"];
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
module.exports = function normalizeESLintConfig(options) {
|
||||
const {
|
||||
babelOptions = {},
|
||||
ecmaVersion = 2020,
|
||||
sourceType = "module",
|
||||
requireConfigFile = true
|
||||
} = options,
|
||||
otherOptions = _objectWithoutPropertiesLoose(options, _excluded);
|
||||
return Object.assign({
|
||||
babelOptions: Object.assign({
|
||||
cwd: process.cwd()
|
||||
}, babelOptions),
|
||||
ecmaVersion: ecmaVersion === "latest" ? 1e8 : ecmaVersion,
|
||||
sourceType,
|
||||
requireConfigFile
|
||||
}, otherOptions);
|
||||
};
|
||||
|
||||
//# sourceMappingURL=configuration.cjs.map
|
||||
134
tools/eslint/node_modules/@babel/eslint-parser/lib/convert/convertAST.cjs
generated
vendored
134
tools/eslint/node_modules/@babel/eslint-parser/lib/convert/convertAST.cjs
generated
vendored
|
|
@ -1,134 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
const ESLINT_VERSION = require("../utils/eslint-version.cjs");
|
||||
function* it(children) {
|
||||
if (Array.isArray(children)) yield* children;else yield children;
|
||||
}
|
||||
function traverse(node, visitorKeys, visitor) {
|
||||
const {
|
||||
type
|
||||
} = node;
|
||||
if (!type) return;
|
||||
const keys = visitorKeys[type];
|
||||
if (!keys) return;
|
||||
for (const key of keys) {
|
||||
for (const child of it(node[key])) {
|
||||
if (child && typeof child === "object") {
|
||||
visitor.enter(child);
|
||||
traverse(child, visitorKeys, visitor);
|
||||
visitor.exit(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const convertNodesVisitor = {
|
||||
enter(node) {
|
||||
if (node.innerComments) {
|
||||
delete node.innerComments;
|
||||
}
|
||||
if (node.trailingComments) {
|
||||
delete node.trailingComments;
|
||||
}
|
||||
if (node.leadingComments) {
|
||||
delete node.leadingComments;
|
||||
}
|
||||
},
|
||||
exit(node) {
|
||||
if (node.extra) {
|
||||
delete node.extra;
|
||||
}
|
||||
if (node.loc.identifierName) {
|
||||
delete node.loc.identifierName;
|
||||
}
|
||||
if (node.type === "TypeParameter") {
|
||||
node.type = "Identifier";
|
||||
node.typeAnnotation = node.bound;
|
||||
delete node.bound;
|
||||
}
|
||||
if (node.type === "QualifiedTypeIdentifier") {
|
||||
delete node.id;
|
||||
}
|
||||
if (node.type === "ObjectTypeProperty") {
|
||||
delete node.key;
|
||||
}
|
||||
if (node.type === "ObjectTypeIndexer") {
|
||||
delete node.id;
|
||||
}
|
||||
if (node.type === "FunctionTypeParam") {
|
||||
delete node.name;
|
||||
}
|
||||
if (node.type === "ImportDeclaration") {
|
||||
delete node.isType;
|
||||
}
|
||||
if (node.type === "TemplateLiteral") {
|
||||
for (let i = 0; i < node.quasis.length; i++) {
|
||||
const q = node.quasis[i];
|
||||
q.range[0] -= 1;
|
||||
if (q.tail) {
|
||||
q.range[1] += 1;
|
||||
} else {
|
||||
q.range[1] += 2;
|
||||
}
|
||||
q.loc.start.column -= 1;
|
||||
if (q.tail) {
|
||||
q.loc.end.column += 1;
|
||||
} else {
|
||||
q.loc.end.column += 2;
|
||||
}
|
||||
if (ESLINT_VERSION >= 8) {
|
||||
q.start -= 1;
|
||||
if (q.tail) {
|
||||
q.end += 1;
|
||||
} else {
|
||||
q.end += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function convertNodes(ast, visitorKeys) {
|
||||
traverse(ast, visitorKeys, convertNodesVisitor);
|
||||
}
|
||||
function convertProgramNode(ast) {
|
||||
const body = ast.program.body;
|
||||
Object.assign(ast, {
|
||||
type: "Program",
|
||||
sourceType: ast.program.sourceType,
|
||||
body
|
||||
});
|
||||
delete ast.program;
|
||||
delete ast.errors;
|
||||
if (ast.comments.length) {
|
||||
const lastComment = ast.comments[ast.comments.length - 1];
|
||||
if (ast.tokens.length) {
|
||||
const lastToken = ast.tokens[ast.tokens.length - 1];
|
||||
if (lastComment.end > lastToken.end) {
|
||||
ast.range[1] = lastToken.end;
|
||||
ast.loc.end.line = lastToken.loc.end.line;
|
||||
ast.loc.end.column = lastToken.loc.end.column;
|
||||
if (ESLINT_VERSION >= 8) {
|
||||
ast.end = lastToken.end;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!ast.tokens.length) {
|
||||
ast.loc.start.line = 1;
|
||||
ast.loc.end.line = 1;
|
||||
}
|
||||
}
|
||||
if (body != null && body.length) {
|
||||
ast.loc.start.line = body[0].loc.start.line;
|
||||
ast.range[0] = body[0].start;
|
||||
if (ESLINT_VERSION >= 8) {
|
||||
ast.start = body[0].start;
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = function convertAST(ast, visitorKeys) {
|
||||
convertNodes(ast, visitorKeys);
|
||||
convertProgramNode(ast);
|
||||
};
|
||||
|
||||
//# sourceMappingURL=convertAST.cjs.map
|
||||
10
tools/eslint/node_modules/@babel/eslint-parser/lib/convert/convertComments.cjs
generated
vendored
10
tools/eslint/node_modules/@babel/eslint-parser/lib/convert/convertComments.cjs
generated
vendored
|
|
@ -1,10 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = function convertComments(comments) {
|
||||
for (const comment of comments) {
|
||||
comment.type = comment.type === "CommentBlock" ? "Block" : "Line";
|
||||
comment.range || (comment.range = [comment.start, comment.end]);
|
||||
}
|
||||
};
|
||||
|
||||
//# sourceMappingURL=convertComments.cjs.map
|
||||
159
tools/eslint/node_modules/@babel/eslint-parser/lib/convert/convertTokens.cjs
generated
vendored
159
tools/eslint/node_modules/@babel/eslint-parser/lib/convert/convertTokens.cjs
generated
vendored
|
|
@ -1,159 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
const ESLINT_VERSION = require("../utils/eslint-version.cjs");
|
||||
function convertTemplateType(tokens, tl) {
|
||||
let curlyBrace = null;
|
||||
let templateTokens = [];
|
||||
const result = [];
|
||||
function addTemplateType() {
|
||||
const start = templateTokens[0];
|
||||
const end = templateTokens[templateTokens.length - 1];
|
||||
const value = templateTokens.reduce((result, token) => {
|
||||
if (token.value) {
|
||||
result += token.value;
|
||||
} else if (token.type.label !== tl.template) {
|
||||
result += token.type.label;
|
||||
}
|
||||
return result;
|
||||
}, "");
|
||||
result.push({
|
||||
type: "Template",
|
||||
value: value,
|
||||
start: start.start,
|
||||
end: end.end,
|
||||
loc: {
|
||||
start: start.loc.start,
|
||||
end: end.loc.end
|
||||
}
|
||||
});
|
||||
templateTokens = [];
|
||||
}
|
||||
tokens.forEach(token => {
|
||||
switch (token.type.label) {
|
||||
case tl.backQuote:
|
||||
if (curlyBrace) {
|
||||
result.push(curlyBrace);
|
||||
curlyBrace = null;
|
||||
}
|
||||
templateTokens.push(token);
|
||||
if (templateTokens.length > 1) {
|
||||
addTemplateType();
|
||||
}
|
||||
break;
|
||||
case tl.dollarBraceL:
|
||||
templateTokens.push(token);
|
||||
addTemplateType();
|
||||
break;
|
||||
case tl.braceR:
|
||||
if (curlyBrace) {
|
||||
result.push(curlyBrace);
|
||||
}
|
||||
curlyBrace = token;
|
||||
break;
|
||||
case tl.template:
|
||||
if (curlyBrace) {
|
||||
templateTokens.push(curlyBrace);
|
||||
curlyBrace = null;
|
||||
}
|
||||
templateTokens.push(token);
|
||||
break;
|
||||
default:
|
||||
if (curlyBrace) {
|
||||
result.push(curlyBrace);
|
||||
curlyBrace = null;
|
||||
}
|
||||
result.push(token);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function convertToken(token, source, tl) {
|
||||
const {
|
||||
type
|
||||
} = token;
|
||||
const {
|
||||
label
|
||||
} = type;
|
||||
const newToken = token;
|
||||
newToken.range = [token.start, token.end];
|
||||
if (label === tl.name) {
|
||||
if (token.value === "static") {
|
||||
newToken.type = "Keyword";
|
||||
} else {
|
||||
newToken.type = "Identifier";
|
||||
}
|
||||
} else if (label === tl.semi || label === tl.comma || label === tl.parenL || label === tl.parenR || label === tl.braceL || label === tl.braceR || label === tl.slash || label === tl.dot || label === tl.bracketL || label === tl.bracketR || label === tl.ellipsis || label === tl.arrow || label === tl.pipeline || label === tl.star || label === tl.incDec || label === tl.colon || label === tl.question || label === tl.template || label === tl.backQuote || label === tl.dollarBraceL || label === tl.at || label === tl.logicalOR || label === tl.logicalAND || label === tl.nullishCoalescing || label === tl.bitwiseOR || label === tl.bitwiseXOR || label === tl.bitwiseAND || label === tl.equality || label === tl.relational || label === tl.bitShift || label === tl.plusMin || label === tl.modulo || label === tl.exponent || label === tl.bang || label === tl.tilde || label === tl.doubleColon || label === tl.hash || label === tl.questionDot || label === tl.braceHashL || label === tl.braceBarL || label === tl.braceBarR || label === tl.bracketHashL || label === tl.bracketBarL || label === tl.bracketBarR || label === tl.doubleCaret || label === tl.doubleAt || type.isAssign) {
|
||||
var _newToken$value;
|
||||
newToken.type = "Punctuator";
|
||||
(_newToken$value = newToken.value) != null ? _newToken$value : newToken.value = label;
|
||||
} else if (label === tl.jsxTagStart) {
|
||||
newToken.type = "Punctuator";
|
||||
newToken.value = "<";
|
||||
} else if (label === tl.jsxTagEnd) {
|
||||
newToken.type = "Punctuator";
|
||||
newToken.value = ">";
|
||||
} else if (label === tl.jsxName) {
|
||||
newToken.type = "JSXIdentifier";
|
||||
} else if (label === tl.jsxText) {
|
||||
newToken.type = "JSXText";
|
||||
} else if (type.keyword === "null") {
|
||||
newToken.type = "Null";
|
||||
} else if (type.keyword === "false" || type.keyword === "true") {
|
||||
newToken.type = "Boolean";
|
||||
} else if (type.keyword) {
|
||||
newToken.type = "Keyword";
|
||||
} else if (label === tl.num) {
|
||||
newToken.type = "Numeric";
|
||||
newToken.value = source.slice(token.start, token.end);
|
||||
} else if (label === tl.string) {
|
||||
newToken.type = "String";
|
||||
newToken.value = source.slice(token.start, token.end);
|
||||
} else if (label === tl.regexp) {
|
||||
newToken.type = "RegularExpression";
|
||||
const value = token.value;
|
||||
newToken.regex = {
|
||||
pattern: value.pattern,
|
||||
flags: value.flags
|
||||
};
|
||||
newToken.value = `/${value.pattern}/${value.flags}`;
|
||||
} else if (label === tl.bigint) {
|
||||
newToken.type = "Numeric";
|
||||
newToken.value = `${token.value}n`;
|
||||
} else if (label === tl.privateName) {
|
||||
newToken.type = "PrivateIdentifier";
|
||||
} else if (label === tl.templateNonTail || label === tl.templateTail || label === tl.Template) {
|
||||
newToken.type = "Template";
|
||||
}
|
||||
return newToken;
|
||||
}
|
||||
module.exports = function convertTokens(tokens, code, tokLabels) {
|
||||
const result = [];
|
||||
const templateTypeMergedTokens = convertTemplateType(tokens, tokLabels);
|
||||
for (let i = 0, {
|
||||
length
|
||||
} = templateTypeMergedTokens; i < length - 1; i++) {
|
||||
const token = templateTypeMergedTokens[i];
|
||||
const tokenType = token.type;
|
||||
if (tokenType === "CommentLine" || tokenType === "CommentBlock") {
|
||||
continue;
|
||||
}
|
||||
{
|
||||
if (ESLINT_VERSION >= 8 && i + 1 < length && tokenType.label === tokLabels.hash) {
|
||||
const nextToken = templateTypeMergedTokens[i + 1];
|
||||
if (nextToken.type.label === tokLabels.name && token.end === nextToken.start) {
|
||||
i++;
|
||||
nextToken.type = "PrivateIdentifier";
|
||||
nextToken.start -= 1;
|
||||
nextToken.loc.start.column -= 1;
|
||||
nextToken.range = [nextToken.start, nextToken.end];
|
||||
result.push(nextToken);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
result.push(convertToken(token, code, tokLabels));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=convertTokens.cjs.map
|
||||
25
tools/eslint/node_modules/@babel/eslint-parser/lib/convert/index.cjs
generated
vendored
25
tools/eslint/node_modules/@babel/eslint-parser/lib/convert/index.cjs
generated
vendored
|
|
@ -1,25 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.convertError = convertError;
|
||||
exports.convertFile = convertFile;
|
||||
const convertTokens = require("./convertTokens.cjs");
|
||||
const convertComments = require("./convertComments.cjs");
|
||||
const convertAST = require("./convertAST.cjs");
|
||||
function convertFile(ast, code, tokLabels, visitorKeys) {
|
||||
ast.tokens = convertTokens(ast.tokens, code, tokLabels);
|
||||
convertComments(ast.comments);
|
||||
convertAST(ast, visitorKeys);
|
||||
return ast;
|
||||
}
|
||||
function convertError(err) {
|
||||
if (err instanceof SyntaxError) {
|
||||
err.lineNumber = err.loc.line;
|
||||
err.column = err.loc.column;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
32
tools/eslint/node_modules/@babel/eslint-parser/lib/experimental-worker.cjs
generated
vendored
32
tools/eslint/node_modules/@babel/eslint-parser/lib/experimental-worker.cjs
generated
vendored
|
|
@ -1,32 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.meta = void 0;
|
||||
exports.parseForESLint = parseForESLint;
|
||||
const [major, minor] = process.versions.node.split(".").map(Number);
|
||||
if (major < 12 || major === 12 && minor < 3) {
|
||||
throw new Error("@babel/eslint-parser/experimental-worker requires Node.js >= 12.3.0");
|
||||
}
|
||||
const normalizeESLintConfig = require("./configuration.cjs");
|
||||
const analyzeScope = require("./analyze-scope.cjs");
|
||||
const baseParse = require("./parse.cjs");
|
||||
const Clients = require("./client.cjs");
|
||||
const client = new Clients.WorkerClient();
|
||||
const meta = exports.meta = {
|
||||
name: "@babel/eslint-parser/experimental-worker",
|
||||
version: "7.25.0"
|
||||
};
|
||||
function parseForESLint(code, options = {}) {
|
||||
const normalizedOptions = normalizeESLintConfig(options);
|
||||
const ast = baseParse(code, normalizedOptions, client);
|
||||
const scopeManager = analyzeScope(ast, normalizedOptions, client);
|
||||
return {
|
||||
ast,
|
||||
scopeManager,
|
||||
visitorKeys: client.getVisitorKeys()
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=experimental-worker.cjs.map
|
||||
32
tools/eslint/node_modules/@babel/eslint-parser/lib/index.cjs
generated
vendored
32
tools/eslint/node_modules/@babel/eslint-parser/lib/index.cjs
generated
vendored
|
|
@ -1,32 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.meta = void 0;
|
||||
exports.parse = parse;
|
||||
exports.parseForESLint = parseForESLint;
|
||||
var _client = require("./client.cjs");
|
||||
const normalizeESLintConfig = require("./configuration.cjs");
|
||||
const analyzeScope = require("./analyze-scope.cjs");
|
||||
const baseParse = require("./parse.cjs");
|
||||
const client = new _client.LocalClient();
|
||||
const meta = exports.meta = {
|
||||
name: "@babel/eslint-parser",
|
||||
version: "7.25.0"
|
||||
};
|
||||
function parse(code, options = {}) {
|
||||
return baseParse(code, normalizeESLintConfig(options), client);
|
||||
}
|
||||
function parseForESLint(code, options = {}) {
|
||||
const normalizedOptions = normalizeESLintConfig(options);
|
||||
const ast = baseParse(code, normalizedOptions, client);
|
||||
const scopeManager = analyzeScope(ast, normalizedOptions, client);
|
||||
return {
|
||||
ast,
|
||||
scopeManager,
|
||||
visitorKeys: client.getVisitorKeys()
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
37
tools/eslint/node_modules/@babel/eslint-parser/lib/parse.cjs
generated
vendored
37
tools/eslint/node_modules/@babel/eslint-parser/lib/parse.cjs
generated
vendored
|
|
@ -1,37 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
const semver = require("semver");
|
||||
const convert = require("./convert/index.cjs");
|
||||
const babelParser = require((((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;
|
||||
})("@babel/parser", {
|
||||
paths: [require.resolve("@babel/core/package.json")]
|
||||
}));
|
||||
let isRunningMinSupportedCoreVersion = null;
|
||||
module.exports = function parse(code, options, client) {
|
||||
const minSupportedCoreVersion = ">=7.2.0";
|
||||
if (typeof isRunningMinSupportedCoreVersion !== "boolean") {
|
||||
isRunningMinSupportedCoreVersion = semver.satisfies(client.getVersion(), minSupportedCoreVersion);
|
||||
}
|
||||
if (!isRunningMinSupportedCoreVersion) {
|
||||
throw new Error(`@babel/eslint-parser@${"7.25.0"} does not support @babel/core@${client.getVersion()}. Please upgrade to @babel/core@${minSupportedCoreVersion}.`);
|
||||
}
|
||||
const {
|
||||
ast,
|
||||
parserOptions
|
||||
} = client.maybeParse(code, options);
|
||||
if (ast) return ast;
|
||||
try {
|
||||
return convert.convertFile(babelParser.parse(code, parserOptions), code, client.getTokLabels(), client.getVisitorKeys());
|
||||
} catch (err) {
|
||||
throw convert.convertError(err);
|
||||
}
|
||||
};
|
||||
|
||||
//# sourceMappingURL=parse.cjs.map
|
||||
5
tools/eslint/node_modules/@babel/eslint-parser/lib/utils/eslint-version.cjs
generated
vendored
5
tools/eslint/node_modules/@babel/eslint-parser/lib/utils/eslint-version.cjs
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = parseInt(require("eslint/package.json").version, 10);
|
||||
|
||||
//# sourceMappingURL=eslint-version.cjs.map
|
||||
37
tools/eslint/node_modules/@babel/eslint-parser/lib/worker/ast-info.cjs
generated
vendored
37
tools/eslint/node_modules/@babel/eslint-parser/lib/worker/ast-info.cjs
generated
vendored
|
|
@ -1,37 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getTokLabels = getTokLabels;
|
||||
exports.getVisitorKeys = getVisitorKeys;
|
||||
const _ESLINT_VISITOR_KEYS = require("eslint-visitor-keys");
|
||||
const babel = require("./babel-core.cjs");
|
||||
const ESLINT_VISITOR_KEYS = _ESLINT_VISITOR_KEYS.KEYS;
|
||||
let visitorKeys;
|
||||
function getVisitorKeys() {
|
||||
if (!visitorKeys) {
|
||||
const newTypes = {
|
||||
ChainExpression: ESLINT_VISITOR_KEYS.ChainExpression,
|
||||
ImportExpression: ESLINT_VISITOR_KEYS.ImportExpression,
|
||||
Literal: ESLINT_VISITOR_KEYS.Literal,
|
||||
MethodDefinition: ["decorators"].concat(ESLINT_VISITOR_KEYS.MethodDefinition),
|
||||
Property: ["decorators"].concat(ESLINT_VISITOR_KEYS.Property),
|
||||
PropertyDefinition: ["decorators", "typeAnnotation"].concat(ESLINT_VISITOR_KEYS.PropertyDefinition)
|
||||
};
|
||||
const conflictTypes = {
|
||||
ClassPrivateMethod: ["decorators"].concat(ESLINT_VISITOR_KEYS.MethodDefinition),
|
||||
ExportAllDeclaration: ESLINT_VISITOR_KEYS.ExportAllDeclaration
|
||||
};
|
||||
visitorKeys = Object.assign({}, newTypes, babel.types.VISITOR_KEYS, conflictTypes);
|
||||
}
|
||||
return visitorKeys;
|
||||
}
|
||||
let tokLabels;
|
||||
function getTokLabels() {
|
||||
return tokLabels || (tokLabels = (p => p.reduce((o, [k, v]) => Object.assign({}, o, {
|
||||
[k]: v
|
||||
}), {}))((Object.entries || (o => Object.keys(o).map(k => [k, o[k]])))(babel.tokTypes).map(([key, tok]) => [key, tok.label])));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=ast-info.cjs.map
|
||||
21
tools/eslint/node_modules/@babel/eslint-parser/lib/worker/babel-core.cjs
generated
vendored
21
tools/eslint/node_modules/@babel/eslint-parser/lib/worker/babel-core.cjs
generated
vendored
|
|
@ -1,21 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = exports;
|
||||
function initialize(babel) {
|
||||
exports.init = null;
|
||||
exports.version = babel.version;
|
||||
exports.traverse = babel.traverse;
|
||||
exports.types = babel.types;
|
||||
exports.tokTypes = babel.tokTypes;
|
||||
exports.parseSync = babel.parseSync;
|
||||
exports.loadPartialConfigSync = babel.loadPartialConfigSync;
|
||||
exports.loadPartialConfigAsync = babel.loadPartialConfigAsync;
|
||||
{
|
||||
exports.createConfigItemSync = babel.createConfigItemSync || babel.createConfigItem;
|
||||
}
|
||||
}
|
||||
{
|
||||
initialize(require("@babel/core"));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=babel-core.cjs.map
|
||||
91
tools/eslint/node_modules/@babel/eslint-parser/lib/worker/configuration.cjs
generated
vendored
91
tools/eslint/node_modules/@babel/eslint-parser/lib/worker/configuration.cjs
generated
vendored
|
|
@ -1,91 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.normalizeBabelParseConfig = normalizeBabelParseConfig;
|
||||
exports.normalizeBabelParseConfigSync = normalizeBabelParseConfigSync;
|
||||
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); }); }; }
|
||||
const babel = require("./babel-core.cjs");
|
||||
const ESLINT_VERSION = require("../utils/eslint-version.cjs");
|
||||
function getParserPlugins(babelOptions) {
|
||||
var _babelOptions$parserO, _babelOptions$parserO2;
|
||||
const babelParserPlugins = (_babelOptions$parserO = (_babelOptions$parserO2 = babelOptions.parserOpts) == null ? void 0 : _babelOptions$parserO2.plugins) != null ? _babelOptions$parserO : [];
|
||||
const estreeOptions = {
|
||||
classFeatures: ESLINT_VERSION >= 8
|
||||
};
|
||||
for (const plugin of babelParserPlugins) {
|
||||
if (Array.isArray(plugin) && plugin[0] === "estree") {
|
||||
Object.assign(estreeOptions, plugin[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return [["estree", estreeOptions], ...babelParserPlugins];
|
||||
}
|
||||
function normalizeParserOptions(options) {
|
||||
var _options$allowImportE, _options$ecmaFeatures, _options$ecmaFeatures2;
|
||||
return Object.assign({
|
||||
sourceType: options.sourceType,
|
||||
filename: options.filePath
|
||||
}, options.babelOptions, {
|
||||
parserOpts: Object.assign({}, {
|
||||
allowImportExportEverywhere: (_options$allowImportE = options.allowImportExportEverywhere) != null ? _options$allowImportE : false,
|
||||
allowSuperOutsideMethod: true
|
||||
}, {
|
||||
allowReturnOutsideFunction: (_options$ecmaFeatures = (_options$ecmaFeatures2 = options.ecmaFeatures) == null ? void 0 : _options$ecmaFeatures2.globalReturn) != null ? _options$ecmaFeatures : true
|
||||
}, options.babelOptions.parserOpts, {
|
||||
plugins: getParserPlugins(options.babelOptions),
|
||||
attachComment: false,
|
||||
ranges: true,
|
||||
tokens: true
|
||||
}),
|
||||
caller: Object.assign({
|
||||
name: "@babel/eslint-parser"
|
||||
}, options.babelOptions.caller)
|
||||
});
|
||||
}
|
||||
function validateResolvedConfig(config, options, parseOptions) {
|
||||
if (config !== null) {
|
||||
if (options.requireConfigFile !== false) {
|
||||
if (!config.hasFilesystemConfig()) {
|
||||
let error = `No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.`;
|
||||
if (config.options.filename.includes("node_modules")) {
|
||||
error += `\nIf you have a .babelrc.js file or use package.json#babel, keep in mind that it's not used when parsing dependencies. If you want your config to be applied to your whole app, consider using babel.config.js or babel.config.json instead.`;
|
||||
}
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
if (config.options) return config.options;
|
||||
}
|
||||
return getDefaultParserOptions(parseOptions);
|
||||
}
|
||||
function getDefaultParserOptions(options) {
|
||||
return Object.assign({
|
||||
plugins: []
|
||||
}, options, {
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
browserslistConfigFile: false,
|
||||
ignore: null,
|
||||
only: null
|
||||
});
|
||||
}
|
||||
function normalizeBabelParseConfig(_x) {
|
||||
return _normalizeBabelParseConfig.apply(this, arguments);
|
||||
}
|
||||
function _normalizeBabelParseConfig() {
|
||||
_normalizeBabelParseConfig = _asyncToGenerator(function* (options) {
|
||||
const parseOptions = normalizeParserOptions(options);
|
||||
const config = yield babel.loadPartialConfigAsync(parseOptions);
|
||||
return validateResolvedConfig(config, options, parseOptions);
|
||||
});
|
||||
return _normalizeBabelParseConfig.apply(this, arguments);
|
||||
}
|
||||
function normalizeBabelParseConfigSync(options) {
|
||||
const parseOptions = normalizeParserOptions(options);
|
||||
const config = babel.loadPartialConfigSync(parseOptions);
|
||||
return validateResolvedConfig(config, options, parseOptions);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=configuration.cjs.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user