From 92cc6c4dfb534b94856551bd77177276f317d28d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 29 Nov 2021 16:41:31 -0800 Subject: [PATCH] tools: install and enable JSDoc linting in ESLint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41027 Reviewed-By: Michaël Zasso Reviewed-By: Antoine du Hamel --- .eslintrc.js | 6 +- tools/node_modules/eslint/README.md | 314 -- .../eslint/node_modules/.bin/acorn | 1 + .../eslint/node_modules/.bin/browserslist | 1 + .../eslint/node_modules/.bin/eslint | 1 + .../eslint/node_modules/.bin/js-yaml | 1 + .../eslint/node_modules/.bin/jsesc | 1 + .../eslint/node_modules/.bin/json5 | 1 + .../eslint/node_modules/.bin/node-which | 1 + .../eslint/node_modules/.bin/parser | 1 + .../eslint/node_modules/.bin/rimraf | 1 + .../eslint/node_modules/.bin/semver | 1 + .../node_modules/@babel/code-frame/README.md | 19 - .../eslint/node_modules/@babel/core/README.md | 19 - .../@babel/core/node_modules/.bin/semver | 1 + .../@babel/core/node_modules/semver/README.md | 443 -- .../@babel/eslint-parser/README.md | 124 - .../node_modules/eslint-scope/README.md | 54 - .../eslint-visitor-keys/README.md | 98 - .../node_modules/estraverse/README.md | 153 - .../node_modules/semver/README.md | 443 -- .../node_modules/@babel/generator/README.md | 19 - .../helper-compilation-targets/README.md | 19 - .../node_modules/.bin/semver | 1 + .../node_modules/semver/README.md | 443 -- .../@babel/helper-function-name/README.md | 19 - .../helper-get-function-arity/README.md | 19 - .../@babel/helper-hoist-variables/README.md | 19 - .../README.md | 19 - .../@babel/helper-module-imports/README.md | 19 - .../@babel/helper-module-transforms/README.md | 19 - .../helper-optimise-call-expression/README.md | 19 - .../@babel/helper-plugin-utils/README.md | 19 - .../@babel/helper-replace-supers/README.md | 19 - .../@babel/helper-simple-access/README.md | 19 - .../helper-split-export-declaration/README.md | 19 - .../helper-validator-identifier/README.md | 19 - .../@babel/helper-validator-option/README.md | 19 - .../node_modules/@babel/helpers/README.md | 19 - .../node_modules/@babel/highlight/README.md | 19 - .../node_modules/color-convert/README.md | 68 - .../node_modules/color-name/README.md | 11 - .../node_modules/@babel/parser/README.md | 19 - .../plugin-syntax-import-assertions/README.md | 19 - .../node_modules/@babel/template/README.md | 19 - .../node_modules/@babel/traverse/README.md | 19 - .../node_modules/@babel/types/README.md | 19 - .../@es-joy/jsdoccomment/.babelrc.json | 20 + .../@es-joy/jsdoccomment/LICENSE-MIT.txt | 20 + .../@es-joy/jsdoccomment/dist/index.cjs.cjs | 533 ++ .../node_modules/comment-parser/LICENSE | 21 + .../comment-parser/browser/index.js | 651 +++ .../node_modules/comment-parser/es6/index.js | 30 + .../comment-parser/es6/parser/block-parser.js | 29 + .../comment-parser/es6/parser/index.js | 41 + .../es6/parser/source-parser.js | 46 + .../comment-parser/es6/parser/spec-parser.js | 13 + .../es6/parser/tokenizers/description.js | 46 + .../es6/parser/tokenizers/index.js | 1 + .../es6/parser/tokenizers/name.js | 91 + .../es6/parser/tokenizers/tag.js | 24 + .../es6/parser/tokenizers/type.js | 65 + .../comment-parser/es6/primitives.js | 7 + .../comment-parser/es6/stringifier/index.js | 17 + .../comment-parser/es6/stringifier/inspect.js | 44 + .../comment-parser/es6/transforms/align.js | 93 + .../comment-parser/es6/transforms/crlf.js | 34 + .../comment-parser/es6/transforms/indent.js | 32 + .../comment-parser/es6/transforms/index.js | 3 + .../node_modules/comment-parser/es6/util.js | 52 + .../comment-parser/jest.config.cjs | 207 + .../node_modules/comment-parser/lib/index.cjs | 82 + .../lib/parser/block-parser.cjs | 44 + .../comment-parser/lib/parser/index.cjs | 65 + .../lib/parser/source-parser.cjs | 67 + .../comment-parser/lib/parser/spec-parser.cjs | 29 + .../lib/parser/tokenizers/description.cjs | 61 + .../lib/parser/tokenizers/index.cjs | 6 + .../lib/parser/tokenizers/name.cjs | 109 + .../lib/parser/tokenizers/tag.cjs | 37 + .../lib/parser/tokenizers/type.cjs | 79 + .../comment-parser/lib/primitives.cjs | 15 + .../comment-parser/lib/stringifier/index.cjs | 18 + .../lib/stringifier/inspect.cjs | 72 + .../comment-parser/lib/transforms/align.cjs | 127 + .../comment-parser/lib/transforms/crlf.cjs | 44 + .../comment-parser/lib/transforms/indent.cjs | 58 + .../comment-parser/lib/transforms/index.cjs | 13 + .../node_modules/comment-parser/lib/util.cjs | 113 + .../comment-parser/migrate-1.0.md | 105 + .../node_modules/comment-parser/package.json | 85 + .../comment-parser/tsconfig.node.json | 12 + .../@es-joy/jsdoccomment/package.json | 79 + .../jsdoccomment/src/commentHandler.js | 42 + .../jsdoccomment/src/commentParserToESTree.js | 149 + .../@es-joy/jsdoccomment/src/index.js | 11 + .../@es-joy/jsdoccomment/src/jsdoccomment.js | 247 + .../@es-joy/jsdoccomment/src/parseComment.js | 126 + .../@es-joy/jsdoccomment/src/toCamelCase.js | 9 + .../node_modules/@eslint/eslintrc/README.md | 61 - .../@humanwhocodes/config-array/README.md | 266 - .../@humanwhocodes/object-schema/README.md | 234 - .../node_modules/@types/mdast/README.md | 16 - .../node_modules/@types/unist/README.md | 16 - .../eslint/node_modules/acorn-jsx/README.md | 40 - .../eslint/node_modules/acorn/README.md | 280 -- .../eslint/node_modules/ajv/README.md | 1497 ------ .../node_modules/ajv/lib/dotjs/README.md | 3 - .../eslint/node_modules/ansi-colors/README.md | 315 -- .../eslint/node_modules/argparse/README.md | 84 - .../node_modules/balanced-match/README.md | 97 - .../node_modules/brace-expansion/README.md | 129 - .../node_modules/browserslist/README.md | 66 - .../node_modules/caniuse-lite/README.md | 92 - .../node_modules/color-convert/README.md | 68 - .../eslint/node_modules/color-name/README.md | 11 - .../node_modules/comment-parser/LICENSE | 21 + .../comment-parser/browser/index.js | 653 +++ .../node_modules/comment-parser/es6/index.js | 30 + .../comment-parser/es6/parser/block-parser.js | 29 + .../comment-parser/es6/parser/index.js | 42 + .../es6/parser/source-parser.js | 46 + .../comment-parser/es6/parser/spec-parser.js | 13 + .../es6/parser/tokenizers/description.js | 47 + .../es6/parser/tokenizers/index.js | 1 + .../es6/parser/tokenizers/name.js | 91 + .../es6/parser/tokenizers/tag.js | 24 + .../es6/parser/tokenizers/type.js | 65 + .../comment-parser/es6/primitives.js | 8 + .../comment-parser/es6/stringifier/index.js | 17 + .../comment-parser/es6/stringifier/inspect.js | 44 + .../comment-parser/es6/transforms/align.js | 93 + .../comment-parser/es6/transforms/crlf.js | 34 + .../comment-parser/es6/transforms/indent.js | 32 + .../comment-parser/es6/transforms/index.js | 3 + .../node_modules/comment-parser/es6/util.js | 52 + .../comment-parser/jest.config.cjs | 207 + .../node_modules/comment-parser/lib/index.cjs | 82 + .../lib/parser/block-parser.cjs | 44 + .../comment-parser/lib/parser/index.cjs | 69 + .../lib/parser/source-parser.cjs | 68 + .../comment-parser/lib/parser/spec-parser.cjs | 29 + .../lib/parser/tokenizers/description.cjs | 62 + .../lib/parser/tokenizers/index.cjs | 6 + .../lib/parser/tokenizers/name.cjs | 109 + .../lib/parser/tokenizers/tag.cjs | 37 + .../lib/parser/tokenizers/type.cjs | 79 + .../comment-parser/lib/primitives.cjs | 17 + .../comment-parser/lib/stringifier/index.cjs | 18 + .../lib/stringifier/inspect.cjs | 72 + .../comment-parser/lib/transforms/align.cjs | 127 + .../comment-parser/lib/transforms/crlf.cjs | 44 + .../comment-parser/lib/transforms/indent.cjs | 58 + .../comment-parser/lib/transforms/index.cjs | 13 + .../node_modules/comment-parser/lib/util.cjs | 113 + .../comment-parser/migrate-1.0.md | 105 + .../node_modules/comment-parser/package.json | 86 + .../comment-parser/tsconfig.node.json | 12 + .../node_modules/concat-map/README.markdown | 62 - .../node_modules/convert-source-map/README.md | 120 - .../eslint/node_modules/cross-spawn/README.md | 96 - .../eslint/node_modules/debug/README.md | 478 -- .../node_modules/deep-is/README.markdown | 70 - .../eslint/node_modules/doctrine/README.md | 165 - .../electron-to-chromium/README.md | 186 - .../full-chromium-versions.js | 16 +- .../full-chromium-versions.json | 2 +- .../electron-to-chromium/full-versions.js | 8 +- .../electron-to-chromium/full-versions.json | 2 +- .../electron-to-chromium/package.json | 2 +- .../eslint/node_modules/enquirer/README.md | 1752 ------- .../node_modules/eslint-plugin-jsdoc/LICENSE | 24 + .../eslint-plugin-jsdoc/dist/WarnSettings.js | 37 + .../dist/alignTransform.js | 216 + .../dist/bin/generateRule.js | 212 + .../eslint-plugin-jsdoc/dist/exportParser.js | 619 +++ .../eslint-plugin-jsdoc/dist/generateRule.js | 212 + .../dist/getDefaultTagStructureForMode.js | 167 + .../eslint-plugin-jsdoc/dist/index.js | 215 + .../eslint-plugin-jsdoc/dist/iterateJsdoc.js | 1125 +++++ .../eslint-plugin-jsdoc/dist/jsdocUtils.js | 1350 +++++ .../dist/rules/checkAccess.js | 49 + .../dist/rules/checkAlignment.js | 63 + .../dist/rules/checkExamples.js | 481 ++ .../dist/rules/checkIndentation.js | 72 + .../dist/rules/checkLineAlignment.js | 225 + .../dist/rules/checkParamNames.js | 296 ++ .../dist/rules/checkPropertyNames.js | 115 + .../dist/rules/checkSyntax.js | 42 + .../dist/rules/checkTagNames.js | 129 + .../dist/rules/checkTypes.js | 269 + .../dist/rules/checkValues.js | 128 + .../dist/rules/emptyTags.js | 73 + .../dist/rules/implementsOnClasses.js | 67 + .../dist/rules/matchDescription.js | 208 + .../dist/rules/matchName.js | 139 + .../dist/rules/multilineBlocks.js | 251 + .../dist/rules/newlineAfterDescription.js | 79 + .../dist/rules/noBadBlocks.js | 104 + .../dist/rules/noDefaults.js | 91 + .../dist/rules/noMissingSyntax.js | 144 + .../dist/rules/noMultiAsterisks.js | 99 + .../dist/rules/noRestrictedSyntax.js | 81 + .../eslint-plugin-jsdoc/dist/rules/noTypes.js | 76 + .../dist/rules/noUndefinedTypes.js | 198 + .../dist/rules/requireAsteriskPrefix.js | 167 + .../dist/rules/requireDescription.js | 149 + .../requireDescriptionCompleteSentence.js | 221 + .../dist/rules/requireExample.js | 111 + .../dist/rules/requireFileOverview.js | 147 + .../requireHyphenBeforeParamDescription.js | 127 + .../dist/rules/requireJsdoc.js | 381 ++ .../dist/rules/requireParam.js | 454 ++ .../dist/rules/requireParamDescription.js | 59 + .../dist/rules/requireParamName.js | 59 + .../dist/rules/requireParamType.js | 59 + .../dist/rules/requireProperty.js | 56 + .../dist/rules/requirePropertyDescription.js | 34 + .../dist/rules/requirePropertyName.js | 34 + .../dist/rules/requirePropertyType.js | 34 + .../dist/rules/requireReturns.js | 151 + .../dist/rules/requireReturnsCheck.js | 103 + .../dist/rules/requireReturnsDescription.js | 65 + .../dist/rules/requireReturnsType.js | 59 + .../dist/rules/requireThrows.js | 108 + .../dist/rules/requireYields.js | 186 + .../dist/rules/requireYieldsCheck.js | 153 + .../dist/rules/tagLines.js | 174 + .../dist/rules/validTypes.js | 216 + .../eslint-plugin-jsdoc/dist/tagNames.js | 146 + .../eslint-plugin-jsdoc/package.json | 111 + .../eslint-plugin-markdown/README.md | 362 -- .../node_modules/eslint-scope/README.md | 66 - .../node_modules/eslint-utils/README.md | 38 - .../eslint-visitor-keys/README.md | 98 - .../eslint-visitor-keys/README.md | 107 - .../eslint/node_modules/espree/README.md | 247 - .../eslint/node_modules/esquery/README.md | 27 - .../eslint/node_modules/esrecurse/README.md | 171 - .../eslint/node_modules/estraverse/README.md | 153 - .../eslint/node_modules/esutils/README.md | 174 - .../node_modules/fast-deep-equal/README.md | 96 - .../fast-json-stable-stringify/README.md | 131 - .../node_modules/fast-levenshtein/README.md | 104 - .../node_modules/file-entry-cache/README.md | 112 - .../eslint/node_modules/flat-cache/README.md | 73 - .../eslint/node_modules/flatted/README.md | 111 - .../eslint/node_modules/fs.realpath/README.md | 33 - .../functional-red-black-tree/README.md | 237 - .../eslint/node_modules/gensync/README.md | 196 - .../eslint/node_modules/glob-parent/README.md | 134 - .../eslint/node_modules/glob/README.md | 378 -- .../eslint/node_modules/ignore/README.md | 307 -- .../eslint/node_modules/imurmurhash/README.md | 122 - .../eslint/node_modules/inflight/README.md | 37 - .../eslint/node_modules/inherits/README.md | 42 - .../eslint/node_modules/is-extglob/README.md | 107 - .../eslint/node_modules/is-glob/README.md | 206 - .../eslint/node_modules/isexe/README.md | 51 - .../eslint/node_modules/js-tokens/README.md | 240 - .../eslint/node_modules/js-yaml/README.md | 246 - .../jsdoc-type-pratt-parser/LICENSE | 21 + .../jsdoc-type-pratt-parser/dist/index.js | 2340 +++++++++ .../jsdoc-type-pratt-parser/package.json | 100 + .../eslint/node_modules/jsesc/README.md | 421 -- .../json-schema-traverse/README.md | 83 - .../eslint/node_modules/json5/README.md | 234 - .../eslint/node_modules/json5/lib/cli.js | 0 .../eslint/node_modules/levn/README.md | 196 - .../node_modules/lodash.merge/README.md | 18 - .../eslint/node_modules/lru-cache/README.md | 166 - .../eslint/node_modules/minimatch/README.md | 209 - .../node_modules/natural-compare/README.md | 125 - .../node_modules/node-releases/README.md | 31 - .../eslint/node_modules/once/README.md | 79 - .../eslint/node_modules/optionator/README.md | 238 - .../eslint/node_modules/picocolors/README.md | 21 - .../eslint/node_modules/prelude-ls/README.md | 15 - .../eslint/node_modules/punycode/README.md | 122 - .../eslint/node_modules/regexpp/README.md | 178 - .../node_modules/regextras/LICENSE-MIT.txt | 21 + .../node_modules/regextras/dist/index-es.js | 442 ++ .../regextras/dist/index-es.min.js | 1 + .../regextras/dist/index-generators-es.js | 99 + .../regextras/dist/index-generators-umd.js | 109 + .../node_modules/regextras/dist/index-umd.js | 452 ++ .../regextras/dist/index-umd.min.js | 1 + .../node_modules/regextras/dist/main-es.js | 342 ++ .../node_modules/regextras/dist/main-umd.js | 352 ++ .../regextras/dist/prototype-es.js | 170 + .../regextras/dist/prototype-umd.js | 177 + .../regextras/dist/regexp-prototype-es.js | 250 + .../regextras/dist/regexp-prototype-umd.js | 257 + .../regextras/dist/string-prototype-es.js | 248 + .../regextras/dist/string-prototype-umd.js | 255 + .../eslint/node_modules/regextras/lgtm.yml | 5 + .../node_modules/regextras/package.json | 85 + .../node_modules/regextras/pnpm-lock.yaml | 4437 +++++++++++++++++ .../regextras/src/index-generators.js | 36 + .../node_modules/regextras/src/index.js | 6 + .../eslint/node_modules/regextras/src/main.js | 186 + .../node_modules/regextras/src/mixinRegex.js | 24 + .../node_modules/regextras/src/prototype.js | 116 + .../regextras/src/regexp-prototype.js | 168 + .../regextras/src/string-prototype.js | 169 + .../eslint/node_modules/rimraf/README.md | 101 - .../eslint/node_modules/safe-buffer/README.md | 584 --- .../eslint/node_modules/semver/README.md | 566 --- .../eslint/node_modules/source-map/README.md | 729 --- .../node_modules/spdx-exceptions/index.json | 40 + .../node_modules/spdx-exceptions/package.json | 17 + .../spdx-expression-parse/AUTHORS | 4 + .../spdx-expression-parse/LICENSE | 22 + .../spdx-expression-parse/index.js | 8 + .../spdx-expression-parse/package.json | 39 + .../spdx-expression-parse/parse.js | 138 + .../spdx-expression-parse/scan.js | 131 + .../spdx-license-ids/deprecated.json | 26 + .../node_modules/spdx-license-ids/index.json | 450 ++ .../spdx-license-ids/package.json | 39 + .../eslint/node_modules/type-check/README.md | 210 - .../eslint/node_modules/uri-js/README.md | 203 - .../node_modules/v8-compile-cache/README.md | 55 - .../eslint/node_modules/which/README.md | 54 - .../eslint/node_modules/word-wrap/README.md | 182 - .../eslint/node_modules/wrappy/README.md | 36 - .../eslint/node_modules/yallist/README.md | 204 - tools/node_modules/eslint/package.json | 5 - 328 files changed, 29867 insertions(+), 18292 deletions(-) delete mode 100644 tools/node_modules/eslint/README.md create mode 120000 tools/node_modules/eslint/node_modules/.bin/acorn create mode 120000 tools/node_modules/eslint/node_modules/.bin/browserslist create mode 120000 tools/node_modules/eslint/node_modules/.bin/eslint create mode 120000 tools/node_modules/eslint/node_modules/.bin/js-yaml create mode 120000 tools/node_modules/eslint/node_modules/.bin/jsesc create mode 120000 tools/node_modules/eslint/node_modules/.bin/json5 create mode 120000 tools/node_modules/eslint/node_modules/.bin/node-which create mode 120000 tools/node_modules/eslint/node_modules/.bin/parser create mode 120000 tools/node_modules/eslint/node_modules/.bin/rimraf create mode 120000 tools/node_modules/eslint/node_modules/.bin/semver delete mode 100644 tools/node_modules/eslint/node_modules/@babel/code-frame/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/core/README.md create mode 120000 tools/node_modules/eslint/node_modules/@babel/core/node_modules/.bin/semver delete mode 100644 tools/node_modules/eslint/node_modules/@babel/core/node_modules/semver/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/eslint-parser/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/eslint-scope/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/estraverse/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/semver/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/generator/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/README.md create mode 120000 tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/node_modules/.bin/semver delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/node_modules/semver/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-function-name/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-get-function-arity/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-hoist-variables/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-member-expression-to-functions/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-module-imports/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-module-transforms/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-optimise-call-expression/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-plugin-utils/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-simple-access/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-split-export-declaration/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helper-validator-option/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/helpers/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/parser/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/plugin-syntax-import-assertions/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/template/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/traverse/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@babel/types/README.md create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/.babelrc.json create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/LICENSE-MIT.txt create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/dist/index.cjs.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/LICENSE create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/browser/index.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/index.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/block-parser.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/index.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/source-parser.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/spec-parser.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/description.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/index.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/name.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/tag.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/type.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/primitives.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/stringifier/index.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/stringifier/inspect.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/align.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/crlf.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/indent.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/index.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/util.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/jest.config.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/block-parser.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/source-parser.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/spec-parser.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/description.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/name.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/tag.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/type.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/primitives.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/stringifier/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/stringifier/inspect.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/align.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/crlf.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/indent.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/util.cjs create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/migrate-1.0.md create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/package.json create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/tsconfig.node.json create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/package.json create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/commentHandler.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/commentParserToESTree.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/index.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/jsdoccomment.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/parseComment.js create mode 100644 tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/toCamelCase.js delete mode 100644 tools/node_modules/eslint/node_modules/@eslint/eslintrc/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md delete mode 100644 tools/node_modules/eslint/node_modules/@humanwhocodes/object-schema/README.md delete mode 100755 tools/node_modules/eslint/node_modules/@types/mdast/README.md delete mode 100755 tools/node_modules/eslint/node_modules/@types/unist/README.md delete mode 100644 tools/node_modules/eslint/node_modules/acorn-jsx/README.md delete mode 100644 tools/node_modules/eslint/node_modules/acorn/README.md delete mode 100644 tools/node_modules/eslint/node_modules/ajv/README.md delete mode 100644 tools/node_modules/eslint/node_modules/ajv/lib/dotjs/README.md delete mode 100644 tools/node_modules/eslint/node_modules/ansi-colors/README.md delete mode 100644 tools/node_modules/eslint/node_modules/argparse/README.md delete mode 100644 tools/node_modules/eslint/node_modules/balanced-match/README.md delete mode 100644 tools/node_modules/eslint/node_modules/brace-expansion/README.md delete mode 100644 tools/node_modules/eslint/node_modules/browserslist/README.md delete mode 100644 tools/node_modules/eslint/node_modules/caniuse-lite/README.md delete mode 100644 tools/node_modules/eslint/node_modules/color-convert/README.md delete mode 100644 tools/node_modules/eslint/node_modules/color-name/README.md create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/LICENSE create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/browser/index.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/index.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/block-parser.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/index.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/source-parser.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/spec-parser.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/description.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/index.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/name.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/tag.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/type.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/primitives.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/stringifier/index.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/stringifier/inspect.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/align.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/crlf.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/indent.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/index.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/es6/util.js create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/jest.config.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/block-parser.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/source-parser.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/spec-parser.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/description.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/name.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/tag.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/type.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/primitives.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/stringifier/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/stringifier/inspect.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/align.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/crlf.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/indent.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/index.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/lib/util.cjs create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/migrate-1.0.md create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/package.json create mode 100644 tools/node_modules/eslint/node_modules/comment-parser/tsconfig.node.json delete mode 100644 tools/node_modules/eslint/node_modules/concat-map/README.markdown delete mode 100644 tools/node_modules/eslint/node_modules/convert-source-map/README.md delete mode 100644 tools/node_modules/eslint/node_modules/cross-spawn/README.md delete mode 100644 tools/node_modules/eslint/node_modules/debug/README.md delete mode 100644 tools/node_modules/eslint/node_modules/deep-is/README.markdown delete mode 100644 tools/node_modules/eslint/node_modules/doctrine/README.md delete mode 100644 tools/node_modules/eslint/node_modules/electron-to-chromium/README.md delete mode 100644 tools/node_modules/eslint/node_modules/enquirer/README.md create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/LICENSE create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/WarnSettings.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/alignTransform.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/bin/generateRule.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/exportParser.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/generateRule.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/getDefaultTagStructureForMode.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/index.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/jsdocUtils.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkAccess.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkAlignment.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkIndentation.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkLineAlignment.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkParamNames.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkPropertyNames.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkSyntax.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkTagNames.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkTypes.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkValues.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/emptyTags.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/implementsOnClasses.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/matchDescription.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/matchName.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/multilineBlocks.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/newlineAfterDescription.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noBadBlocks.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noDefaults.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMultiAsterisks.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noRestrictedSyntax.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noTypes.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noUndefinedTypes.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireAsteriskPrefix.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescription.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescriptionCompleteSentence.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireExample.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireFileOverview.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireHyphenBeforeParamDescription.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireJsdoc.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParam.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamDescription.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamName.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamType.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireProperty.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyDescription.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyName.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyType.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturns.js create mode 100755 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsCheck.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsDescription.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsType.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireThrows.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireYields.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireYieldsCheck.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/tagLines.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/validTypes.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/tagNames.js create mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/package.json delete mode 100644 tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md delete mode 100644 tools/node_modules/eslint/node_modules/eslint-scope/README.md delete mode 100644 tools/node_modules/eslint/node_modules/eslint-utils/README.md delete mode 100644 tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md delete mode 100644 tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md delete mode 100644 tools/node_modules/eslint/node_modules/espree/README.md delete mode 100644 tools/node_modules/eslint/node_modules/esquery/README.md delete mode 100644 tools/node_modules/eslint/node_modules/esrecurse/README.md delete mode 100644 tools/node_modules/eslint/node_modules/estraverse/README.md delete mode 100644 tools/node_modules/eslint/node_modules/esutils/README.md delete mode 100644 tools/node_modules/eslint/node_modules/fast-deep-equal/README.md delete mode 100644 tools/node_modules/eslint/node_modules/fast-json-stable-stringify/README.md delete mode 100644 tools/node_modules/eslint/node_modules/fast-levenshtein/README.md delete mode 100644 tools/node_modules/eslint/node_modules/file-entry-cache/README.md delete mode 100644 tools/node_modules/eslint/node_modules/flat-cache/README.md delete mode 100644 tools/node_modules/eslint/node_modules/flatted/README.md delete mode 100644 tools/node_modules/eslint/node_modules/fs.realpath/README.md delete mode 100644 tools/node_modules/eslint/node_modules/functional-red-black-tree/README.md delete mode 100644 tools/node_modules/eslint/node_modules/gensync/README.md delete mode 100644 tools/node_modules/eslint/node_modules/glob-parent/README.md delete mode 100644 tools/node_modules/eslint/node_modules/glob/README.md delete mode 100755 tools/node_modules/eslint/node_modules/ignore/README.md delete mode 100644 tools/node_modules/eslint/node_modules/imurmurhash/README.md delete mode 100644 tools/node_modules/eslint/node_modules/inflight/README.md delete mode 100644 tools/node_modules/eslint/node_modules/inherits/README.md delete mode 100644 tools/node_modules/eslint/node_modules/is-extglob/README.md delete mode 100644 tools/node_modules/eslint/node_modules/is-glob/README.md delete mode 100644 tools/node_modules/eslint/node_modules/isexe/README.md delete mode 100644 tools/node_modules/eslint/node_modules/js-tokens/README.md delete mode 100644 tools/node_modules/eslint/node_modules/js-yaml/README.md create mode 100644 tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/LICENSE create mode 100644 tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/dist/index.js create mode 100644 tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/package.json delete mode 100644 tools/node_modules/eslint/node_modules/jsesc/README.md delete mode 100644 tools/node_modules/eslint/node_modules/json-schema-traverse/README.md delete mode 100644 tools/node_modules/eslint/node_modules/json5/README.md mode change 100644 => 100755 tools/node_modules/eslint/node_modules/json5/lib/cli.js delete mode 100644 tools/node_modules/eslint/node_modules/levn/README.md delete mode 100644 tools/node_modules/eslint/node_modules/lodash.merge/README.md delete mode 100644 tools/node_modules/eslint/node_modules/lru-cache/README.md delete mode 100644 tools/node_modules/eslint/node_modules/minimatch/README.md delete mode 100644 tools/node_modules/eslint/node_modules/natural-compare/README.md delete mode 100644 tools/node_modules/eslint/node_modules/node-releases/README.md delete mode 100644 tools/node_modules/eslint/node_modules/once/README.md delete mode 100644 tools/node_modules/eslint/node_modules/optionator/README.md delete mode 100644 tools/node_modules/eslint/node_modules/picocolors/README.md delete mode 100644 tools/node_modules/eslint/node_modules/prelude-ls/README.md delete mode 100644 tools/node_modules/eslint/node_modules/punycode/README.md delete mode 100644 tools/node_modules/eslint/node_modules/regexpp/README.md create mode 100644 tools/node_modules/eslint/node_modules/regextras/LICENSE-MIT.txt create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/index-es.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/index-es.min.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/index-generators-es.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/index-generators-umd.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/index-umd.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/index-umd.min.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/main-es.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/main-umd.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/prototype-es.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/prototype-umd.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/regexp-prototype-es.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/regexp-prototype-umd.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/string-prototype-es.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/dist/string-prototype-umd.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/lgtm.yml create mode 100644 tools/node_modules/eslint/node_modules/regextras/package.json create mode 100644 tools/node_modules/eslint/node_modules/regextras/pnpm-lock.yaml create mode 100644 tools/node_modules/eslint/node_modules/regextras/src/index-generators.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/src/index.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/src/main.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/src/mixinRegex.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/src/prototype.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/src/regexp-prototype.js create mode 100644 tools/node_modules/eslint/node_modules/regextras/src/string-prototype.js delete mode 100644 tools/node_modules/eslint/node_modules/rimraf/README.md delete mode 100644 tools/node_modules/eslint/node_modules/safe-buffer/README.md delete mode 100644 tools/node_modules/eslint/node_modules/semver/README.md delete mode 100644 tools/node_modules/eslint/node_modules/source-map/README.md create mode 100644 tools/node_modules/eslint/node_modules/spdx-exceptions/index.json create mode 100644 tools/node_modules/eslint/node_modules/spdx-exceptions/package.json create mode 100644 tools/node_modules/eslint/node_modules/spdx-expression-parse/AUTHORS create mode 100644 tools/node_modules/eslint/node_modules/spdx-expression-parse/LICENSE create mode 100644 tools/node_modules/eslint/node_modules/spdx-expression-parse/index.js create mode 100644 tools/node_modules/eslint/node_modules/spdx-expression-parse/package.json create mode 100644 tools/node_modules/eslint/node_modules/spdx-expression-parse/parse.js create mode 100644 tools/node_modules/eslint/node_modules/spdx-expression-parse/scan.js create mode 100644 tools/node_modules/eslint/node_modules/spdx-license-ids/deprecated.json create mode 100644 tools/node_modules/eslint/node_modules/spdx-license-ids/index.json create mode 100644 tools/node_modules/eslint/node_modules/spdx-license-ids/package.json delete mode 100644 tools/node_modules/eslint/node_modules/type-check/README.md delete mode 100755 tools/node_modules/eslint/node_modules/uri-js/README.md delete mode 100644 tools/node_modules/eslint/node_modules/v8-compile-cache/README.md delete mode 100644 tools/node_modules/eslint/node_modules/which/README.md delete mode 100644 tools/node_modules/eslint/node_modules/word-wrap/README.md delete mode 100644 tools/node_modules/eslint/node_modules/wrappy/README.md delete mode 100644 tools/node_modules/eslint/node_modules/yallist/README.md diff --git a/.eslintrc.js b/.eslintrc.js index 1e35e787057e3e..7df64d33af7871 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,6 +15,7 @@ NodePlugin.RULES_DIR = path.resolve(__dirname, 'tools', 'eslint-rules'); const ModuleFindPath = Module._findPath; const hacks = [ 'eslint-plugin-node-core', + 'eslint-plugin-jsdoc', 'eslint-plugin-markdown', '@babel/eslint-parser', '@babel/plugin-syntax-import-assertions', @@ -34,7 +35,7 @@ Module._findPath = (request, paths, isMain) => { module.exports = { root: true, - plugins: ['markdown', 'node-core'], + plugins: ['jsdoc', 'markdown', 'node-core'], parser: '@babel/eslint-parser', parserOptions: { babelOptions: { @@ -336,6 +337,9 @@ module.exports = { 'use-isnan': 'error', 'valid-typeof': ['error', { requireStringLiterals: true }], + // JSDoc rules + 'jsdoc/check-types': 'error', + // Custom rules from eslint-plugin-node-core 'node-core/no-unescaped-regexp-dot': 'error', 'node-core/no-duplicate-requires': 'error', diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md deleted file mode 100644 index bbc74b7ce4d25e..00000000000000 --- a/tools/node_modules/eslint/README.md +++ /dev/null @@ -1,314 +0,0 @@ -[![npm version](https://img.shields.io/npm/v/eslint.svg)](https://www.npmjs.com/package/eslint) -[![Downloads](https://img.shields.io/npm/dm/eslint.svg)](https://www.npmjs.com/package/eslint) -[![Build Status](https://github.com/eslint/eslint/workflows/CI/badge.svg)](https://github.com/eslint/eslint/actions) -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_shield) -
-[![Open Collective Backers](https://img.shields.io/opencollective/backers/eslint)](https://opencollective.com/eslint) -[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/eslint)](https://opencollective.com/eslint) -[![Follow us on Twitter](https://img.shields.io/twitter/follow/geteslint?label=Follow&style=social)](https://twitter.com/intent/user?screen_name=geteslint) - -# ESLint - -[Website](https://eslint.org) | -[Configuring](https://eslint.org/docs/user-guide/configuring) | -[Rules](https://eslint.org/docs/rules/) | -[Contributing](https://eslint.org/docs/developer-guide/contributing) | -[Reporting Bugs](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) | -[Code of Conduct](https://eslint.org/conduct) | -[Twitter](https://twitter.com/geteslint) | -[Mailing List](https://groups.google.com/group/eslint) | -[Chat Room](https://eslint.org/chat) - -ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions: - -* ESLint uses [Espree](https://github.com/eslint/espree) for JavaScript parsing. -* ESLint uses an AST to evaluate patterns in code. -* ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime. - -## Table of Contents - -1. [Installation and Usage](#installation-and-usage) -2. [Configuration](#configuration) -3. [Code of Conduct](#code-of-conduct) -4. [Filing Issues](#filing-issues) -5. [Frequently Asked Questions](#faq) -6. [Releases](#releases) -7. [Security Policy](#security-policy) -8. [Semantic Versioning Policy](#semantic-versioning-policy) -9. [Stylistic Rule Updates](#stylistic-rule-updates) -10. [License](#license) -11. [Team](#team) -12. [Sponsors](#sponsors) -13. [Technology Sponsors](#technology-sponsors) - -## Installation and Usage - -Prerequisites: [Node.js](https://nodejs.org/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.) - -You can install ESLint using npm: - -``` -$ npm install eslint --save-dev -``` - -You should then set up a configuration file: - -``` -$ ./node_modules/.bin/eslint --init -``` - -After that, you can run ESLint on any file or directory like this: - -``` -$ ./node_modules/.bin/eslint yourfile.js -``` - -## Configuration - -After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this: - -```json -{ - "rules": { - "semi": ["error", "always"], - "quotes": ["error", "double"] - } -} -``` - -The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values: - -* `"off"` or `0` - turn the rule off -* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code) -* `"error"` or `2` - turn the rule on as an error (exit code will be 1) - -The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/user-guide/configuring)). - -## Code of Conduct - -ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct). - -## Filing Issues - -Before filing an issue, please be sure to read the guidelines for what you're reporting: - -* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) -* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules) -* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes) -* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes) - -## Frequently Asked Questions - -### I'm using JSCS, should I migrate to ESLint? - -Yes. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life) and is no longer supported. - -We have prepared a [migration guide](https://eslint.org/docs/user-guide/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration. - -We are now at or near 100% compatibility with JSCS. If you try ESLint and believe we are not yet compatible with a JSCS rule/configuration, please create an issue (mentioning that it is a JSCS compatibility issue) and we will evaluate it as per our normal process. - -### Does Prettier replace ESLint? - -No, ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use ESLint for everything, or you can combine both using Prettier to format your code and ESLint to catch possible errors. - -### Why can't ESLint find my plugins? - -* Make sure your plugins (and ESLint) are both in your project's `package.json` as devDependencies (or dependencies, if your project uses ESLint at runtime). -* Make sure you have run `npm install` and all your dependencies are installed. -* Make sure your plugins' peerDependencies have been installed as well. You can use `npm view eslint-plugin-myplugin peerDependencies` to see what peer dependencies `eslint-plugin-myplugin` has. - -### Does ESLint support JSX? - -Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/user-guide/configuring)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics. - -### What ECMAScript versions does ESLint support? - -ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring). - -### What about experimental features? - -ESLint's parser only officially supports the latest final ECMAScript standard. We will make changes to core rules in order to avoid crashes on stage 3 ECMAScript syntax proposals (as long as they are implemented using the correct experimental ESTree syntax). We may make changes to core rules to better work with language extensions (such as JSX, Flow, and TypeScript) on a case-by-case basis. - -In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use the [babel-eslint](https://github.com/babel/babel-eslint) parser and [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) to use any option available in Babel. - -Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature. - -### Where to ask for help? - -Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://eslint.org/chat). - -### Why doesn't ESLint lock dependency versions? - -Lock files like `package-lock.json` are helpful for deployed applications. They ensure that dependencies are consistent between environments and across deployments. - -Packages like `eslint` that get published to the npm registry do not include lock files. `npm install eslint` as a user will respect version constraints in ESLint's `package.json`. ESLint and its dependencies will be included in the user's lock file if one exists, but ESLint's own lock file would not be used. - -We intentionally don't lock dependency versions so that we have the latest compatible dependency versions in development and CI that our users get when installing ESLint in a project. - -The Twilio blog has a [deeper dive](https://www.twilio.com/blog/lockfiles-nodejs) to learn more. - -## Releases - -We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release. - -## Security Policy - -ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). - -## Semantic Versioning Policy - -ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint: - -* Patch release (intended to not break your lint build) - * A bug fix in a rule that results in ESLint reporting fewer linting errors. - * A bug fix to the CLI or core (including formatters). - * Improvements to documentation. - * Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage. - * Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone). -* Minor release (might break your lint build) - * A bug fix in a rule that results in ESLint reporting more linting errors. - * A new rule is created. - * A new option to an existing rule that does not result in ESLint reporting more linting errors by default. - * A new addition to an existing rule to support a newly-added language feature (within the last 12 months) that will result in ESLint reporting more linting errors by default. - * An existing rule is deprecated. - * A new CLI capability is created. - * New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.). - * A new formatter is created. - * `eslint:recommended` is updated and will result in strictly fewer linting errors (e.g., rule removals). -* Major release (likely to break your lint build) - * `eslint:recommended` is updated and may result in new linting errors (e.g., rule additions, most rule option updates). - * A new option to an existing rule that results in ESLint reporting more linting errors by default. - * An existing formatter is removed. - * Part of the public API is removed or changed in an incompatible way. The public API includes: - * Rule schemas - * Configuration schema - * Command-line options - * Node.js API - * Rule, formatter, parser, plugin APIs - -According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds. - -## Stylistic Rule Updates - -Stylistic rules are frozen according to [our policy](https://eslint.org/blog/2020/05/changes-to-rules-policies) on how we evaluate new rules and rule changes. -This means: - -* **Bug fixes**: We will still fix bugs in stylistic rules. -* **New ECMAScript features**: We will also make sure stylistic rules are compatible with new ECMAScript features. -* **New options**: We will **not** add any new options to stylistic rules unless an option is the only way to fix a bug or support a newly-added ECMAScript feature. - -## License - -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_large) - -## Team - -These folks keep the project moving and are resources for help. - - - - - - - -### Technical Steering Committee (TSC) - -The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained. - -
- -
-Nicholas C. Zakas -
-
- -
-Brandon Mills -
-
- -
-Milos Djermanovic -
-
- - -### Reviewers - -The people who review and implement new features. - -
- -
-Toru Nagashima -
-
- -
-唯然 -
-
- - - - -### Committers - -The people who review and fix bugs and help triage issues. - -
- -
-Brett Zamir -
-
- -
-Bryan Mishkin -
-
- -
-Pig Fang -
-
- -
-Anix -
-
- -
-YeonJuan -
-
- -
-Nitin Kumar -
-
- - - - - - - -## Sponsors - -The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website. - - - -

Platinum Sponsors

-

Automattic

Gold Sponsors

-

Nx (by Nrwl) Chrome's Web Framework & Tools Performance Fund Salesforce Airbnb Coinbase American Express Substack

Silver Sponsors

-

Liftoff

Bronze Sponsors

-

launchdarkly TROYPOINT Anagram Solver VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Fire Stick Tricks Practice Ignition

- - -## Technology Sponsors - -* Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com) -* Hosting for ([eslint.org](https://eslint.org)) is sponsored by [Netlify](https://www.netlify.com) -* Password management is sponsored by [1Password](https://www.1password.com) diff --git a/tools/node_modules/eslint/node_modules/.bin/acorn b/tools/node_modules/eslint/node_modules/.bin/acorn new file mode 120000 index 00000000000000..cf76760386200f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/browserslist b/tools/node_modules/eslint/node_modules/.bin/browserslist new file mode 120000 index 00000000000000..3cd991b25889f5 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/browserslist @@ -0,0 +1 @@ +../browserslist/cli.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/eslint b/tools/node_modules/eslint/node_modules/.bin/eslint new file mode 120000 index 00000000000000..810e4bcb32af34 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/eslint @@ -0,0 +1 @@ +../eslint/bin/eslint.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/js-yaml b/tools/node_modules/eslint/node_modules/.bin/js-yaml new file mode 120000 index 00000000000000..9dbd010d470368 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/jsesc b/tools/node_modules/eslint/node_modules/.bin/jsesc new file mode 120000 index 00000000000000..7237604c357fcd --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/jsesc @@ -0,0 +1 @@ +../jsesc/bin/jsesc \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/json5 b/tools/node_modules/eslint/node_modules/.bin/json5 new file mode 120000 index 00000000000000..217f37981d7a98 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/json5 @@ -0,0 +1 @@ +../json5/lib/cli.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/node-which b/tools/node_modules/eslint/node_modules/.bin/node-which new file mode 120000 index 00000000000000..6f8415ec58dffc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/node-which @@ -0,0 +1 @@ +../which/bin/node-which \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/parser b/tools/node_modules/eslint/node_modules/.bin/parser new file mode 120000 index 00000000000000..ce7bf97efb312b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/parser @@ -0,0 +1 @@ +../@babel/parser/bin/babel-parser.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/rimraf b/tools/node_modules/eslint/node_modules/.bin/rimraf new file mode 120000 index 00000000000000..4cd49a49ddfc17 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/.bin/semver b/tools/node_modules/eslint/node_modules/.bin/semver new file mode 120000 index 00000000000000..5aaadf42c4a8b2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/README.md b/tools/node_modules/eslint/node_modules/@babel/code-frame/README.md deleted file mode 100644 index 08cacb0477fb94..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/code-frame/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/code-frame - -> Generate errors that contain a code frame that point to source locations. - -See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/code-frame -``` - -or using yarn: - -```sh -yarn add @babel/code-frame --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/core/README.md b/tools/node_modules/eslint/node_modules/@babel/core/README.md deleted file mode 100644 index 9b3a9503360cbb..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/core/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/core - -> Babel compiler core. - -See our website [@babel/core](https://babeljs.io/docs/en/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/core -``` - -or using yarn: - -```sh -yarn add @babel/core --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/core/node_modules/.bin/semver b/tools/node_modules/eslint/node_modules/@babel/core/node_modules/.bin/semver new file mode 120000 index 00000000000000..5aaadf42c4a8b2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/core/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/core/node_modules/semver/README.md b/tools/node_modules/eslint/node_modules/@babel/core/node_modules/semver/README.md deleted file mode 100644 index 2293a14fdc3579..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/core/node_modules/semver/README.md +++ /dev/null @@ -1,443 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Install - -```bash -npm install semver -```` - -## Usage - -As a node module: - -```js -const semver = require('semver') - -semver.valid('1.2.3') // '1.2.3' -semver.valid('a.b.c') // null -semver.clean(' =v1.2.3 ') // '1.2.3' -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true -semver.gt('1.2.3', '9.8.7') // false -semver.lt('1.2.3', '9.8.7') // true -semver.minVersion('>=1.0.0') // '1.0.0' -semver.valid(semver.coerce('v2')) // '2.0.0' -semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -Note that this behavior can be suppressed (treating all prerelease -versions as if they were normal versions, for the purpose of range -matching) by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any version satisfies) -* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero element in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0` -* `^0.2.3` := `>=0.2.3 <0.3.0` -* `^0.0.3` := `>=0.0.3 <0.0.4` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0` -* `^0.0.x` := `>=0.0.0 <0.1.0` -* `^0.0` := `>=0.0.0 <0.1.0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0` -* `^0.x` := `>=0.0.0 <1.0.0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose` Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease` Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `prerelease(v)`: Returns an array of prerelease components, or null - if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. -* `intersects(r1, r2, loose)`: Return true if the two supplied ranges - or comparators intersect. -* `parse(v)`: Attempt to parse a string as a semantic version, returning either - a `SemVer` object or `null`. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions - are equal. Sorts in ascending order if passed to `Array.sort()`. - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Comparators - -* `intersects(comparator)`: Return true if the comparators intersect - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `minSatisfying(versions, range)`: Return the lowest version in the list - that satisfies the range, or `null` if none of them do. -* `minVersion(range)`: Return the lowest version that can possibly match - the given range. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) -* `intersects(range)`: Return true if any of the ranges comparators intersect - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. - -### Coercion - -* `coerce(version, options)`: Coerces a string to semver if possible - -This aims to provide a very forgiving translation of a non-semver string to -semver. It looks for the first digit in a string, and consumes all -remaining characters which satisfy at least a partial semver (e.g., `1`, -`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer -versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All -surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes -`3.4.0`). Only text which lacks digits will fail coercion (`version one` -is not valid). The maximum length for any semver component considered for -coercion is 16 characters; longer components will be ignored -(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any -semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value -components are invalid (`9999999999999999.4.7.4` is likely invalid). - -If the `options.rtl` flag is set, then `coerce` will return the right-most -coercible tuple that does not share an ending index with a longer coercible -tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not -`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of -any other overlapping SemVer tuple. - -### Clean - -* `clean(version)`: Clean a string to be a valid semver if possible - -This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. - -ex. -* `s.clean(' = v 2.1.5foo')`: `null` -* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean(' = v 2.1.5-foo')`: `null` -* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean('=v2.1.5')`: `'2.1.5'` -* `s.clean(' =v2.1.5')`: `2.1.5` -* `s.clean(' 2.1.5 ')`: `'2.1.5'` -* `s.clean('~1.0.0')`: `null` diff --git a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/README.md b/tools/node_modules/eslint/node_modules/@babel/eslint-parser/README.md deleted file mode 100644 index ca435373ca084c..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# @babel/eslint-parser [![npm](https://img.shields.io/npm/v/@babel/eslint-parser.svg)](https://www.npmjs.com/package/@babel/eslint-parser) [![travis](https://img.shields.io/travis/babel/@babel/eslint-parser/main.svg)](https://travis-ci.org/babel/@babel/eslint-parser) [![npm-downloads](https://img.shields.io/npm/dm/@babel/eslint-parser.svg)](https://www.npmjs.com/package/@babel/eslint-parser) - -**@babel/eslint-parser** allows you to lint **ALL** valid Babel code with the fantastic -[ESLint](https://github.com/eslint/eslint). - -## When should I use @babel/eslint-parser? - -ESLint's default parser and core rules [only support the latest final ECMAScript standard](https://github.com/eslint/eslint/blob/a675c89573836adaf108a932696b061946abf1e6/README.md#what-about-experimental-features) and do not support experimental (such as new features) and non-standard (such as Flow or TypeScript types) syntax provided by Babel. @babel/eslint-parser is a parser that allows ESLint to run on source code that is transformed by Babel. - -**Note:** You only need to use @babel/eslint-parser if you are using Babel to transform your code. If this is not the case, please use the relevant parser for your chosen flavor of ECMAScript (note that the default parser supports all non-experimental syntax as well as JSX). - -## How does it work? - -ESLint allows for the use of [custom parsers](https://eslint.org/docs/developer-guide/working-with-custom-parsers). When using this plugin, your code is parsed by Babel's parser (using the configuration specified in your [Babel configuration file](https://babeljs.io/docs/en/configuration)) and the resulting AST is -transformed into an [ESTree](https://github.com/estree/estree)-compliant structure that ESLint can understand. All location info such as line numbers, -columns is also retained so you can track down errors with ease. - -**Note:** ESLint's core rules do not support experimental syntax and may therefore not work as expected when using `@babel/eslint-parser`. Please use the companion [`@babel/eslint-plugin`](https://github.com/babel/babel/tree/main/eslint/babel-eslint-plugin) plugin for core rules that you have issues with. - -## Usage - -### Installation - -```sh -$ npm install eslint @babel/core @babel/eslint-parser --save-dev -# or -$ yarn add eslint @babel/core @babel/eslint-parser -D -``` - -**Note:** @babel/eslint-parser requires `@babel/core@>=7.2.0` and a valid Babel configuration file to run. If you do not have this already set up, please see the [Babel Usage Guide](https://babeljs.io/docs/en/usage). - -### Setup - -To use @babel/eslint-parser, `"@babel/eslint-parser"` must be specified as the `parser` in your ESLint configuration file (see [here](https://eslint.org/docs/user-guide/configuring/plugins#specifying-parser) for more detailed information). - -**.eslintrc.js** - -```js -module.exports = { - parser: "@babel/eslint-parser", -}; -``` - -With the parser set, your configuration can be configured as described in the [Configuring ESLint](https://eslint.org/docs/user-guide/configuring) documentation. - -**Note:** The `parserOptions` described in the [official documentation](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options) are for the default parser and are not necessarily supported by @babel/eslint-parser. Please see the section directly below for supported `parserOptions`. - -### Additional parser configuration - -Additional configuration options can be set in your ESLint configuration under the `parserOptions` key. Please note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. - -- `requireConfigFile` (default `true`) can be set to `false` to allow @babel/eslint-parser to run on files that do not have a Babel configuration associated with them. This can be useful for linting files that are not transformed by Babel (such as tooling configuration files), though we recommend using the default parser via [glob-based configuration](https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns). Note: @babel/eslint-parser will not parse any experimental syntax when no configuration file is found. -- `sourceType` can be set to `"module"`(default) or `"script"` if your code isn't using ECMAScript modules. - -- `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level. -- `ecmaFeatures.globalReturn` (default `false`) allow return statements in the global scope when used with `sourceType: "script"`. -- `babelOptions` is an object containing Babel configuration [options](https://babeljs.io/docs/en/options) that are passed to Babel's parser at runtime. For cases where users might not want to use a Babel configuration file or are running Babel through another tool (such as Webpack with `babel-loader`). - -**.eslintrc.js** - -```js -module.exports = { - parser: "@babel/eslint-parser", - parserOptions: { - sourceType: "module", - allowImportExportEverywhere: false, - ecmaFeatures: { - globalReturn: false, - }, - babelOptions: { - configFile: "path/to/config.js", - }, - }, -}; -``` - -**.eslintrc.js using glob-based configuration** - -This configuration would use the default parser for all files except for those found by the `"files/transformed/by/babel/*.js"` glob. - -```js -module.exports = { - rules: { - indent: "error", - }, - overrides: [ - { - files: ["files/transformed/by/babel/*.js"], - parser: "@babel/eslint-parser", - }, - ], -}; -``` - -**Monorepo configuration** - -This configuration is useful for monorepo, when you are running ESLint on every package and not from the monorepo root folder, as it avoids to repeat the Babel and ESLint configuration on every package. - -```js -module.exports = { - parser: "@babel/eslint-parser", - parserOptions: { - babelOptions: { - rootMode: "upward", - }, - }, -}; -``` - -### Run - -```sh -$ ./node_modules/.bin/eslint yourfile.js -``` - -## TypeScript - -While [`@babel/eslint-parser`](https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser) can parse TypeScript, we don't currently support linting TypeScript using the rules in [`@babel/eslint-plugin`](https://github.com/babel/babel/tree/main/eslint/babel-eslint-plugin). This is because the TypeScript community has centered around [`@typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint) and we want to avoid duplicate work. Additionally, since [`@typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint) uses TypeScript under the hood, its rules can be made type-aware, which is something Babel doesn't have the ability to do. - -## Questions and support - -If you have an issue, please first check if it can be reproduced with the default parser and with the latest versions of `eslint` and `@babel/eslint-parser`. If it is not reproducible with the default parser, it is most likely an issue with `@babel/eslint-parser`. - -For questions and support please visit the [`#discussion`](https://babeljs.slack.com/messages/discussion/) Babel Slack channel (sign up [here](https://slack.babeljs.io/)) or the [ESLint Discord server](https://eslint.org/chat). diff --git a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/eslint-scope/README.md b/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/eslint-scope/README.md deleted file mode 100644 index 7e7ce0d345cdf2..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/eslint-scope/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# ESLint Scope - -ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). - -## Usage - -Install: - -``` -npm i eslint-scope --save -``` - -Example: - -```js -var eslintScope = require('eslint-scope'); -var espree = require('espree'); -var estraverse = require('estraverse'); - -var ast = espree.parse(code); -var scopeManager = eslintScope.analyze(ast); - -var currentScope = scopeManager.acquire(ast); // global scope - -estraverse.traverse(ast, { - enter: function(node, parent) { - // do stuff - - if (/Function/.test(node.type)) { - currentScope = scopeManager.acquire(node); // get current function scope - } - }, - leave: function(node, parent) { - if (/Function/.test(node.type)) { - currentScope = currentScope.upper; // set to parent scope - } - - // do stuff - } -}); -``` - -## Contributing - -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues). - -## Build Commands - -* `npm test` - run all linting and tests -* `npm run lint` - run all linting - -## License - -ESLint Scope is licensed under a permissive BSD 2-clause license. diff --git a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/README.md b/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/README.md deleted file mode 100644 index d7dbe65fa010bc..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# eslint-visitor-keys - -[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) -[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) -[![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) -[![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) - -Constants and utilities about visitor keys to traverse AST. - -## 💿 Installation - -Use [npm] to install. - -```bash -$ npm install eslint-visitor-keys -``` - -### Requirements - -- [Node.js] 10.0.0 or later. - -## 📖 Usage - -```js -const evk = require("eslint-visitor-keys") -``` - -### evk.KEYS - -> type: `{ [type: string]: string[] | undefined }` - -Visitor keys. This keys are frozen. - -This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. - -For example: - -``` -console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] -``` - -### evk.getKeys(node) - -> type: `(node: object) => string[]` - -Get the visitor keys of a given AST node. - -This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. - -This will be used to traverse unknown nodes. - -For example: - -``` -const node = { - type: "AssignmentExpression", - left: { type: "Identifier", name: "foo" }, - right: { type: "Literal", value: 0 } -} -console.log(evk.getKeys(node)) // → ["type", "left", "right"] -``` - -### evk.unionWith(additionalKeys) - -> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` - -Make the union set with `evk.KEYS` and the given keys. - -- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. -- It removes duplicated keys as keeping the first one. - -For example: - -``` -console.log(evk.unionWith({ - MethodDefinition: ["decorators"] -})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } -``` - -## 📰 Change log - -See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). - -## 🍻 Contributing - -Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). - -### Development commands - -- `npm test` runs tests and measures code coverage. -- `npm run lint` checks source codes with ESLint. -- `npm run coverage` opens the code coverage report of the previous test with your default browser. -- `npm run release` publishes this package to [npm] registory. - - -[npm]: https://www.npmjs.com/ -[Node.js]: https://nodejs.org/en/ -[ESTree]: https://github.com/estree/estree diff --git a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/estraverse/README.md b/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/estraverse/README.md deleted file mode 100644 index ccd3377f3e9449..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/estraverse/README.md +++ /dev/null @@ -1,153 +0,0 @@ -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) - -Estraverse ([estraverse](http://github.com/estools/estraverse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -traversal functions from [esmangle project](http://github.com/estools/esmangle). - -### Documentation - -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -estraverse.traverse(ast, { - enter: function (node, parent) { - if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') - return estraverse.VisitorOption.Skip; - }, - leave: function (node, parent) { - if (node.type == 'VariableDeclarator') - console.log(node.id.name); - } -}); -``` - -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. - -```javascript -estraverse.traverse(ast, { - enter: function (node) { - this.break(); - } -}); -``` - -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. - -```javascript -result = estraverse.replace(tree, { - enter: function (node) { - // Replace it with replaced. - if (node.type === 'Literal') - return replaced; - } -}); -``` - -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Extending the existing traversing rules. - keys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } -}); -``` - -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Iterating the child **nodes** of unknown nodes. - fallback: 'iteration' -}); -``` - -When `visitor.fallback` is a function, we can determine which keys to visit on each node. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Skip the `argument` property of each node - fallback: function(node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument'; - }); - } -}); -``` - -### License - -Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/semver/README.md b/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/semver/README.md deleted file mode 100644 index 2293a14fdc3579..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/eslint-parser/node_modules/semver/README.md +++ /dev/null @@ -1,443 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Install - -```bash -npm install semver -```` - -## Usage - -As a node module: - -```js -const semver = require('semver') - -semver.valid('1.2.3') // '1.2.3' -semver.valid('a.b.c') // null -semver.clean(' =v1.2.3 ') // '1.2.3' -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true -semver.gt('1.2.3', '9.8.7') // false -semver.lt('1.2.3', '9.8.7') // true -semver.minVersion('>=1.0.0') // '1.0.0' -semver.valid(semver.coerce('v2')) // '2.0.0' -semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -Note that this behavior can be suppressed (treating all prerelease -versions as if they were normal versions, for the purpose of range -matching) by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any version satisfies) -* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero element in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0` -* `^0.2.3` := `>=0.2.3 <0.3.0` -* `^0.0.3` := `>=0.0.3 <0.0.4` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0` -* `^0.0.x` := `>=0.0.0 <0.1.0` -* `^0.0` := `>=0.0.0 <0.1.0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0` -* `^0.x` := `>=0.0.0 <1.0.0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose` Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease` Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `prerelease(v)`: Returns an array of prerelease components, or null - if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. -* `intersects(r1, r2, loose)`: Return true if the two supplied ranges - or comparators intersect. -* `parse(v)`: Attempt to parse a string as a semantic version, returning either - a `SemVer` object or `null`. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions - are equal. Sorts in ascending order if passed to `Array.sort()`. - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Comparators - -* `intersects(comparator)`: Return true if the comparators intersect - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `minSatisfying(versions, range)`: Return the lowest version in the list - that satisfies the range, or `null` if none of them do. -* `minVersion(range)`: Return the lowest version that can possibly match - the given range. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) -* `intersects(range)`: Return true if any of the ranges comparators intersect - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. - -### Coercion - -* `coerce(version, options)`: Coerces a string to semver if possible - -This aims to provide a very forgiving translation of a non-semver string to -semver. It looks for the first digit in a string, and consumes all -remaining characters which satisfy at least a partial semver (e.g., `1`, -`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer -versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All -surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes -`3.4.0`). Only text which lacks digits will fail coercion (`version one` -is not valid). The maximum length for any semver component considered for -coercion is 16 characters; longer components will be ignored -(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any -semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value -components are invalid (`9999999999999999.4.7.4` is likely invalid). - -If the `options.rtl` flag is set, then `coerce` will return the right-most -coercible tuple that does not share an ending index with a longer coercible -tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not -`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of -any other overlapping SemVer tuple. - -### Clean - -* `clean(version)`: Clean a string to be a valid semver if possible - -This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. - -ex. -* `s.clean(' = v 2.1.5foo')`: `null` -* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean(' = v 2.1.5-foo')`: `null` -* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean('=v2.1.5')`: `'2.1.5'` -* `s.clean(' =v2.1.5')`: `2.1.5` -* `s.clean(' 2.1.5 ')`: `'2.1.5'` -* `s.clean('~1.0.0')`: `null` diff --git a/tools/node_modules/eslint/node_modules/@babel/generator/README.md b/tools/node_modules/eslint/node_modules/@babel/generator/README.md deleted file mode 100644 index b760238ebc5e89..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/generator/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/generator - -> Turns an AST into code. - -See our website [@babel/generator](https://babeljs.io/docs/en/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/generator -``` - -or using yarn: - -```sh -yarn add @babel/generator --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/README.md deleted file mode 100644 index af386ab08b49f7..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-compilation-targets - -> Helper functions on Babel compilation targets - -See our website [@babel/helper-compilation-targets](https://babeljs.io/docs/en/babel-helper-compilation-targets) for more information. - -## Install - -Using npm: - -```sh -npm install @babel/helper-compilation-targets -``` - -or using yarn: - -```sh -yarn add @babel/helper-compilation-targets -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/node_modules/.bin/semver b/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/node_modules/.bin/semver new file mode 120000 index 00000000000000..5aaadf42c4a8b2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/node_modules/semver/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/node_modules/semver/README.md deleted file mode 100644 index 2293a14fdc3579..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-compilation-targets/node_modules/semver/README.md +++ /dev/null @@ -1,443 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Install - -```bash -npm install semver -```` - -## Usage - -As a node module: - -```js -const semver = require('semver') - -semver.valid('1.2.3') // '1.2.3' -semver.valid('a.b.c') // null -semver.clean(' =v1.2.3 ') // '1.2.3' -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true -semver.gt('1.2.3', '9.8.7') // false -semver.lt('1.2.3', '9.8.7') // true -semver.minVersion('>=1.0.0') // '1.0.0' -semver.valid(semver.coerce('v2')) // '2.0.0' -semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -Note that this behavior can be suppressed (treating all prerelease -versions as if they were normal versions, for the purpose of range -matching) by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any version satisfies) -* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero element in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0` -* `^0.2.3` := `>=0.2.3 <0.3.0` -* `^0.0.3` := `>=0.0.3 <0.0.4` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0` -* `^0.0.x` := `>=0.0.0 <0.1.0` -* `^0.0` := `>=0.0.0 <0.1.0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0` -* `^0.x` := `>=0.0.0 <1.0.0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose` Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease` Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `prerelease(v)`: Returns an array of prerelease components, or null - if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. -* `intersects(r1, r2, loose)`: Return true if the two supplied ranges - or comparators intersect. -* `parse(v)`: Attempt to parse a string as a semantic version, returning either - a `SemVer` object or `null`. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions - are equal. Sorts in ascending order if passed to `Array.sort()`. - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Comparators - -* `intersects(comparator)`: Return true if the comparators intersect - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `minSatisfying(versions, range)`: Return the lowest version in the list - that satisfies the range, or `null` if none of them do. -* `minVersion(range)`: Return the lowest version that can possibly match - the given range. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) -* `intersects(range)`: Return true if any of the ranges comparators intersect - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. - -### Coercion - -* `coerce(version, options)`: Coerces a string to semver if possible - -This aims to provide a very forgiving translation of a non-semver string to -semver. It looks for the first digit in a string, and consumes all -remaining characters which satisfy at least a partial semver (e.g., `1`, -`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer -versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All -surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes -`3.4.0`). Only text which lacks digits will fail coercion (`version one` -is not valid). The maximum length for any semver component considered for -coercion is 16 characters; longer components will be ignored -(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any -semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value -components are invalid (`9999999999999999.4.7.4` is likely invalid). - -If the `options.rtl` flag is set, then `coerce` will return the right-most -coercible tuple that does not share an ending index with a longer coercible -tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not -`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of -any other overlapping SemVer tuple. - -### Clean - -* `clean(version)`: Clean a string to be a valid semver if possible - -This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. - -ex. -* `s.clean(' = v 2.1.5foo')`: `null` -* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean(' = v 2.1.5-foo')`: `null` -* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean('=v2.1.5')`: `'2.1.5'` -* `s.clean(' =v2.1.5')`: `2.1.5` -* `s.clean(' 2.1.5 ')`: `'2.1.5'` -* `s.clean('~1.0.0')`: `null` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-function-name/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-function-name/README.md deleted file mode 100644 index 36a65931b20ebb..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-function-name/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-function-name - -> Helper function to change the property 'name' of every function - -See our website [@babel/helper-function-name](https://babeljs.io/docs/en/babel-helper-function-name) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-function-name -``` - -or using yarn: - -```sh -yarn add @babel/helper-function-name --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-get-function-arity/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-get-function-arity/README.md deleted file mode 100644 index 8fa48c13e71816..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-get-function-arity/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-get-function-arity - -> Helper function to get function arity - -See our website [@babel/helper-get-function-arity](https://babeljs.io/docs/en/babel-helper-get-function-arity) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-get-function-arity -``` - -or using yarn: - -```sh -yarn add @babel/helper-get-function-arity --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-hoist-variables/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-hoist-variables/README.md deleted file mode 100644 index d3eb8fc4c93b69..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-hoist-variables/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-hoist-variables - -> Helper function to hoist variables - -See our website [@babel/helper-hoist-variables](https://babeljs.io/docs/en/babel-helper-hoist-variables) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-hoist-variables -``` - -or using yarn: - -```sh -yarn add @babel/helper-hoist-variables --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-member-expression-to-functions/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-member-expression-to-functions/README.md deleted file mode 100644 index 01c551d6a96030..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-member-expression-to-functions/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-member-expression-to-functions - -> Helper function to replace certain member expressions with function calls - -See our website [@babel/helper-member-expression-to-functions](https://babeljs.io/docs/en/babel-helper-member-expression-to-functions) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-member-expression-to-functions -``` - -or using yarn: - -```sh -yarn add @babel/helper-member-expression-to-functions --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-module-imports/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-module-imports/README.md deleted file mode 100644 index dfc0bb88cf5aa1..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-module-imports/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-module-imports - -> Babel helper functions for inserting module loads - -See our website [@babel/helper-module-imports](https://babeljs.io/docs/en/babel-helper-module-imports) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-module-imports -``` - -or using yarn: - -```sh -yarn add @babel/helper-module-imports --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-module-transforms/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-module-transforms/README.md deleted file mode 100644 index 243ce295d8a1d6..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-module-transforms/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-module-transforms - -> Babel helper functions for implementing ES6 module transformations - -See our website [@babel/helper-module-transforms](https://babeljs.io/docs/en/babel-helper-module-transforms) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-module-transforms -``` - -or using yarn: - -```sh -yarn add @babel/helper-module-transforms --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-optimise-call-expression/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-optimise-call-expression/README.md deleted file mode 100644 index 3fdbc9bf187330..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-optimise-call-expression/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-optimise-call-expression - -> Helper function to optimise call expression - -See our website [@babel/helper-optimise-call-expression](https://babeljs.io/docs/en/babel-helper-optimise-call-expression) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-optimise-call-expression -``` - -or using yarn: - -```sh -yarn add @babel/helper-optimise-call-expression --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-plugin-utils/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-plugin-utils/README.md deleted file mode 100644 index 54975ea774012f..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-plugin-utils/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-plugin-utils - -> General utilities for plugins to use - -See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/en/babel-helper-plugin-utils) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-plugin-utils -``` - -or using yarn: - -```sh -yarn add @babel/helper-plugin-utils --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/README.md deleted file mode 100644 index 774e0fa49bf4e5..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-replace-supers - -> Helper function to replace supers - -See our website [@babel/helper-replace-supers](https://babeljs.io/docs/en/babel-helper-replace-supers) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-replace-supers -``` - -or using yarn: - -```sh -yarn add @babel/helper-replace-supers --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-simple-access/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-simple-access/README.md deleted file mode 100644 index 1e15dfa24d7c72..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-simple-access/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-simple-access - -> Babel helper for ensuring that access to a given value is performed through simple accesses - -See our website [@babel/helper-simple-access](https://babeljs.io/docs/en/babel-helper-simple-access) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-simple-access -``` - -or using yarn: - -```sh -yarn add @babel/helper-simple-access --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-split-export-declaration/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-split-export-declaration/README.md deleted file mode 100644 index a6f54046044463..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-split-export-declaration/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-split-export-declaration - -> - -See our website [@babel/helper-split-export-declaration](https://babeljs.io/docs/en/babel-helper-split-export-declaration) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-split-export-declaration -``` - -or using yarn: - -```sh -yarn add @babel/helper-split-export-declaration --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/README.md deleted file mode 100644 index 6733576a8ce76b..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-validator-identifier - -> Validate identifier/keywords name - -See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-validator-identifier -``` - -or using yarn: - -```sh -yarn add @babel/helper-validator-identifier --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-option/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-validator-option/README.md deleted file mode 100644 index b8b9e854b38839..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-option/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-validator-option - -> Validate plugin/preset options - -See our website [@babel/helper-validator-option](https://babeljs.io/docs/en/babel-helper-validator-option) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-validator-option -``` - -or using yarn: - -```sh -yarn add @babel/helper-validator-option --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/helpers/README.md b/tools/node_modules/eslint/node_modules/@babel/helpers/README.md deleted file mode 100644 index 3b79dbf5509cf2..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/helpers/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helpers - -> Collection of helper functions used by Babel transforms. - -See our website [@babel/helpers](https://babeljs.io/docs/en/babel-helpers) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helpers -``` - -or using yarn: - -```sh -yarn add @babel/helpers --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/README.md deleted file mode 100644 index f8887ad2ca470c..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/highlight - -> Syntax highlight JavaScript strings for output in terminals. - -See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/highlight -``` - -or using yarn: - -```sh -yarn add @babel/highlight --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md deleted file mode 100644 index d4b08fc369948d..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# color-convert - -[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) - -Color-convert is a color conversion library for JavaScript and node. -It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): - -```js -var convert = require('color-convert'); - -convert.rgb.hsl(140, 200, 100); // [96, 48, 59] -convert.keyword.rgb('blue'); // [0, 0, 255] - -var rgbChannels = convert.rgb.channels; // 3 -var cmykChannels = convert.cmyk.channels; // 4 -var ansiChannels = convert.ansi16.channels; // 1 -``` - -# Install - -```console -$ npm install color-convert -``` - -# API - -Simply get the property of the _from_ and _to_ conversion that you're looking for. - -All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. - -All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). - -```js -var convert = require('color-convert'); - -// Hex to LAB -convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] -convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] - -// RGB to CMYK -convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] -convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] -``` - -### Arrays -All functions that accept multiple arguments also support passing an array. - -Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) - -```js -var convert = require('color-convert'); - -convert.rgb.hex(123, 45, 67); // '7B2D43' -convert.rgb.hex([123, 45, 67]); // '7B2D43' -``` - -## Routing - -Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). - -Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). - -# Contribute - -If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. - -# License -Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md deleted file mode 100644 index 932b979176f33b..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md +++ /dev/null @@ -1,11 +0,0 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - - diff --git a/tools/node_modules/eslint/node_modules/@babel/parser/README.md b/tools/node_modules/eslint/node_modules/@babel/parser/README.md deleted file mode 100644 index 513748c3706dee..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/parser/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/parser - -> A JavaScript parser - -See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/parser -``` - -or using yarn: - -```sh -yarn add @babel/parser --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/plugin-syntax-import-assertions/README.md b/tools/node_modules/eslint/node_modules/@babel/plugin-syntax-import-assertions/README.md deleted file mode 100644 index 2215629030c2ed..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/plugin-syntax-import-assertions/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-import-assertions - -> Allow parsing of the module assertion attributes in the import statement - -See our website [@babel/plugin-syntax-import-assertions](https://babeljs.io/docs/en/babel-plugin-syntax-import-assertions) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-import-assertions -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-import-assertions --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/template/README.md b/tools/node_modules/eslint/node_modules/@babel/template/README.md deleted file mode 100644 index 759c65aa6b1bce..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/template/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/template - -> Generate an AST from a string template. - -See our website [@babel/template](https://babeljs.io/docs/en/babel-template) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20template%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/template -``` - -or using yarn: - -```sh -yarn add @babel/template --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/traverse/README.md b/tools/node_modules/eslint/node_modules/@babel/traverse/README.md deleted file mode 100644 index e478f16fb1c630..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/traverse/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/traverse - -> The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes - -See our website [@babel/traverse](https://babeljs.io/docs/en/babel-traverse) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20traverse%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/traverse -``` - -or using yarn: - -```sh -yarn add @babel/traverse --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@babel/types/README.md b/tools/node_modules/eslint/node_modules/@babel/types/README.md deleted file mode 100644 index 0071bd7a9bc537..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/types/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/types - -> Babel Types is a Lodash-esque utility library for AST nodes - -See our website [@babel/types](https://babeljs.io/docs/en/babel-types) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/types -``` - -or using yarn: - -```sh -yarn add @babel/types --dev -``` diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/.babelrc.json b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/.babelrc.json new file mode 100644 index 00000000000000..2bffce2ed1414f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/.babelrc.json @@ -0,0 +1,20 @@ +{ + "plugins": [ + "@babel/plugin-syntax-class-properties" + ], + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": 10 + } + } + ] + ], + "env": { + "test": { + "plugins": [ "istanbul" ] + } + } +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/LICENSE-MIT.txt b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/LICENSE-MIT.txt new file mode 100644 index 00000000000000..bdc5f00c160c72 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors, https://js.foundation +Copyright (c) 2021 Brett Zamir + +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. diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/dist/index.cjs.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/dist/index.cjs.cjs new file mode 100644 index 00000000000000..eba7a7df9c60b7 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/dist/index.cjs.cjs @@ -0,0 +1,533 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var jsdocTypePrattParser = require('jsdoc-type-pratt-parser'); +var esquery = require('esquery'); +var commentParser = require('comment-parser'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var esquery__default = /*#__PURE__*/_interopDefaultLegacy(esquery); + +const stripEncapsulatingBrackets = (container, isArr) => { + if (isArr) { + const firstItem = container[0]; + firstItem.rawType = firstItem.rawType.replace(/^\{/u, ''); + const lastItem = container[container.length - 1]; + lastItem.rawType = lastItem.rawType.replace(/\}$/u, ''); + return; + } + + container.rawType = container.rawType.replace(/^\{/u, '').replace(/\}$/u, ''); +}; + +const commentParserToESTree = (jsdoc, mode) => { + const { + tokens: { + delimiter: delimiterRoot, + lineEnd: lineEndRoot, + postDelimiter: postDelimiterRoot, + end: endRoot, + description: descriptionRoot + } + } = jsdoc.source[0]; + const ast = { + delimiter: delimiterRoot, + description: descriptionRoot, + descriptionLines: [], + // `end` will be overwritten if there are other entries + end: endRoot, + postDelimiter: postDelimiterRoot, + lineEnd: lineEndRoot, + type: 'JsdocBlock' + }; + const tags = []; + let lastDescriptionLine; + let lastTag = null; + jsdoc.source.slice(1).forEach((info, idx) => { + const { + tokens + } = info; + const { + delimiter, + description, + postDelimiter, + start, + tag, + end, + type: rawType + } = tokens; + + if (tag || end) { + if (lastDescriptionLine === undefined) { + lastDescriptionLine = idx; + } // Clean-up with last tag before end or new tag + + + if (lastTag) { + // Strip out `}` that encapsulates and is not part of + // the type + stripEncapsulatingBrackets(lastTag); + + if (lastTag.typeLines.length) { + stripEncapsulatingBrackets(lastTag.typeLines, true); + } // With even a multiline type now in full, add parsing + + + let parsedType = null; + + try { + parsedType = jsdocTypePrattParser.parse(lastTag.rawType, mode); + } catch {// Ignore + } + + lastTag.parsedType = parsedType; + } + + if (end) { + ast.end = end; + return; + } + + const { + end: ed, + ...tkns + } = tokens; + const tagObj = { ...tkns, + descriptionLines: [], + rawType: '', + type: 'JsdocTag', + typeLines: [] + }; + tagObj.tag = tagObj.tag.replace(/^@/u, ''); + lastTag = tagObj; + tags.push(tagObj); + } + + if (rawType) { + // Will strip rawType brackets after this tag + lastTag.typeLines.push({ + delimiter, + postDelimiter, + rawType, + start, + type: 'JsdocTypeLine' + }); + lastTag.rawType += rawType; + } + + if (description) { + const holder = lastTag || ast; + holder.descriptionLines.push({ + delimiter, + description, + postDelimiter, + start, + type: 'JsdocDescriptionLine' + }); + holder.description += holder.description ? '\n' + description : description; + } + }); + ast.lastDescriptionLine = lastDescriptionLine; + ast.tags = tags; + return ast; +}; + +const jsdocVisitorKeys = { + JsdocBlock: ['tags', 'descriptionLines'], + JsdocDescriptionLine: [], + JsdocTypeLine: [], + JsdocTag: ['descriptionLines', 'typeLines', 'parsedType'] +}; + +/** + * @callback CommentHandler + * @param {string} commentSelector + * @param {Node} jsdoc + * @returns {boolean} + */ + +/** + * @param {Settings} settings + * @returns {CommentHandler} + */ + +const commentHandler = settings => { + /** + * @type {CommentHandler} + */ + return (commentSelector, jsdoc) => { + const { + mode + } = settings; + const selector = esquery__default["default"].parse(commentSelector); + const ast = commentParserToESTree(jsdoc, mode); + return esquery__default["default"].matches(ast, selector, null, { + visitorKeys: { ...jsdocTypePrattParser.visitorKeys, + ...jsdocVisitorKeys + } + }); + }; +}; + +const toCamelCase = str => { + return str.toLowerCase().replace(/^[a-z]/gu, init => { + return init.toUpperCase(); + }).replace(/_(?[a-z])/gu, (_, n1, o, s, { + wordInit + }) => { + return wordInit.toUpperCase(); + }); +}; + +/* eslint-disable prefer-named-capture-group -- Temporary */ +const { + seedBlock, + seedTokens +} = commentParser.util; +const { + name: nameTokenizer, + tag: tagTokenizer, + type: typeTokenizer, + description: descriptionTokenizer +} = commentParser.tokenizers; +const hasSeeWithLink = spec => { + return spec.tag === 'see' && /\{@link.+?\}/u.test(spec.source[0].source); +}; +const defaultNoTypes = ['default', 'defaultvalue', 'see']; +const defaultNoNames = ['access', 'author', 'default', 'defaultvalue', 'description', 'example', 'exception', 'license', 'return', 'returns', 'since', 'summary', 'throws', 'version', 'variation']; + +const getTokenizers = ({ + noTypes = defaultNoTypes, + noNames = defaultNoNames +} = {}) => { + // trim + return [// Tag + tagTokenizer(), // Type + spec => { + if (noTypes.includes(spec.tag)) { + return spec; + } + + return typeTokenizer()(spec); + }, // Name + spec => { + if (spec.tag === 'template') { + // const preWS = spec.postTag; + const remainder = spec.source[0].tokens.description; + const pos = remainder.search(/(? -1) { + [, postName, description, lineEnd] = extra.match(/(\s*)([^\r]*)(\r)?/u); + } + + spec.name = name; + spec.optional = false; + const { + tokens + } = spec.source[0]; + tokens.name = name; + tokens.postName = postName; + tokens.description = description; + tokens.lineEnd = lineEnd || ''; + return spec; + } + + if (noNames.includes(spec.tag) || hasSeeWithLink(spec)) { + return spec; + } + + return nameTokenizer()(spec); + }, // Description + spec => { + return descriptionTokenizer('preserve')(spec); + }]; +}; +/** + * + * @param {PlainObject} commentNode + * @param {string} indent Whitespace + * @returns {PlainObject} + */ + + +const parseComment = (commentNode, indent) => { + // Preserve JSDoc block start/end indentation. + return commentParser.parse(`/*${commentNode.value}*/`, { + // @see https://github.com/yavorskiy/comment-parser/issues/21 + tokenizers: getTokenizers() + })[0] || seedBlock({ + source: [{ + number: 0, + tokens: seedTokens({ + delimiter: '/**' + }) + }, { + number: 1, + tokens: seedTokens({ + end: '*/', + start: indent + ' ' + }) + }] + }); +}; + +/** + * Obtained originally from {@link https://github.com/eslint/eslint/blob/master/lib/util/source-code.js#L313}. + * + * @license MIT + */ + +/** + * Checks if the given token is a comment token or not. + * + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +const isCommentToken = token => { + return token.type === 'Line' || token.type === 'Block' || token.type === 'Shebang'; +}; + +const getDecorator = node => { + var _node$declaration, _node$declaration$dec, _node$decorators, _node$parent, _node$parent$decorato; + + return (node === null || node === void 0 ? void 0 : (_node$declaration = node.declaration) === null || _node$declaration === void 0 ? void 0 : (_node$declaration$dec = _node$declaration.decorators) === null || _node$declaration$dec === void 0 ? void 0 : _node$declaration$dec[0]) || (node === null || node === void 0 ? void 0 : (_node$decorators = node.decorators) === null || _node$decorators === void 0 ? void 0 : _node$decorators[0]) || (node === null || node === void 0 ? void 0 : (_node$parent = node.parent) === null || _node$parent === void 0 ? void 0 : (_node$parent$decorato = _node$parent.decorators) === null || _node$parent$decorato === void 0 ? void 0 : _node$parent$decorato[0]); +}; +/** + * Check to see if its a ES6 export declaration. + * + * @param {ASTNode} astNode An AST node. + * @returns {boolean} whether the given node represents an export declaration. + * @private + */ + + +const looksLikeExport = function (astNode) { + return astNode.type === 'ExportDefaultDeclaration' || astNode.type === 'ExportNamedDeclaration' || astNode.type === 'ExportAllDeclaration' || astNode.type === 'ExportSpecifier'; +}; + +const getTSFunctionComment = function (astNode) { + const { + parent + } = astNode; + const grandparent = parent.parent; + const greatGrandparent = grandparent.parent; + const greatGreatGrandparent = greatGrandparent && greatGrandparent.parent; // istanbul ignore if + + if (parent.type !== 'TSTypeAnnotation') { + return astNode; + } + + switch (grandparent.type) { + case 'PropertyDefinition': + case 'ClassProperty': + case 'TSDeclareFunction': + case 'TSMethodSignature': + case 'TSPropertySignature': + return grandparent; + + case 'ArrowFunctionExpression': + // istanbul ignore else + if (greatGrandparent.type === 'VariableDeclarator' // && greatGreatGrandparent.parent.type === 'VariableDeclaration' + ) { + return greatGreatGrandparent.parent; + } // istanbul ignore next + + + return astNode; + + case 'FunctionExpression': + // istanbul ignore else + if (greatGrandparent.type === 'MethodDefinition') { + return greatGrandparent; + } + + // Fallthrough + + default: + // istanbul ignore if + if (grandparent.type !== 'Identifier') { + // istanbul ignore next + return astNode; + } + + } // istanbul ignore next + + + switch (greatGrandparent.type) { + case 'ArrowFunctionExpression': + // istanbul ignore else + if (greatGreatGrandparent.type === 'VariableDeclarator' && greatGreatGrandparent.parent.type === 'VariableDeclaration') { + return greatGreatGrandparent.parent; + } // istanbul ignore next + + + return astNode; + + case 'FunctionDeclaration': + return greatGrandparent; + + case 'VariableDeclarator': + // istanbul ignore else + if (greatGreatGrandparent.type === 'VariableDeclaration') { + return greatGreatGrandparent; + } + + // Fallthrough + + default: + // istanbul ignore next + return astNode; + } +}; + +const invokedExpression = new Set(['CallExpression', 'OptionalCallExpression', 'NewExpression']); +const allowableCommentNode = new Set(['VariableDeclaration', 'ExpressionStatement', 'MethodDefinition', 'Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition']); +/** + * Reduces the provided node to the appropriate node for evaluating + * JSDoc comment status. + * + * @param {ASTNode} node An AST node. + * @param {SourceCode} sourceCode The ESLint SourceCode. + * @returns {ASTNode} The AST node that can be evaluated for appropriate + * JSDoc comments. + * @private + */ + +const getReducedASTNode = function (node, sourceCode) { + let { + parent + } = node; + + switch (node.type) { + case 'TSFunctionType': + return getTSFunctionComment(node); + + case 'TSInterfaceDeclaration': + case 'TSTypeAliasDeclaration': + case 'TSEnumDeclaration': + case 'ClassDeclaration': + case 'FunctionDeclaration': + return looksLikeExport(parent) ? parent : node; + + case 'TSDeclareFunction': + case 'ClassExpression': + case 'ObjectExpression': + case 'ArrowFunctionExpression': + case 'TSEmptyBodyFunctionExpression': + case 'FunctionExpression': + if (!invokedExpression.has(parent.type)) { + while (!sourceCode.getCommentsBefore(parent).length && !/Function/u.test(parent.type) && !allowableCommentNode.has(parent.type)) { + ({ + parent + } = parent); + + if (!parent) { + break; + } + } + + if (parent && parent.type !== 'FunctionDeclaration' && parent.type !== 'Program') { + if (parent.parent && parent.parent.type === 'ExportNamedDeclaration') { + return parent.parent; + } + + return parent; + } + } + + return node; + + default: + return node; + } +}; +/** + * Checks for the presence of a JSDoc comment for the given node and returns it. + * + * @param {ASTNode} astNode The AST node to get the comment for. + * @param {SourceCode} sourceCode + * @param {{maxLines: Integer, minLines: Integer}} settings + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @private + */ + + +const findJSDocComment = (astNode, sourceCode, settings) => { + const { + minLines, + maxLines + } = settings; + let currentNode = astNode; + let tokenBefore = null; + + while (currentNode) { + const decorator = getDecorator(currentNode); + + if (decorator) { + currentNode = decorator; + } + + tokenBefore = sourceCode.getTokenBefore(currentNode, { + includeComments: true + }); + + if (!tokenBefore || !isCommentToken(tokenBefore)) { + return null; + } + + if (tokenBefore.type === 'Line') { + currentNode = tokenBefore; + continue; + } + + break; + } + + if (tokenBefore.type === 'Block' && tokenBefore.value.charAt(0) === '*' && currentNode.loc.start.line - tokenBefore.loc.end.line >= minLines && currentNode.loc.start.line - tokenBefore.loc.end.line <= maxLines) { + return tokenBefore; + } + + return null; +}; +/** + * Retrieves the JSDoc comment for a given node. + * + * @param {SourceCode} sourceCode The ESLint SourceCode + * @param {ASTNode} node The AST node to get the comment for. + * @param {PlainObject} settings The settings in context + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @public + */ + + +const getJSDocComment = function (sourceCode, node, settings) { + const reducedNode = getReducedASTNode(node, sourceCode); + return findJSDocComment(reducedNode, sourceCode, settings); +}; + +Object.defineProperty(exports, 'jsdocTypeVisitorKeys', { + enumerable: true, + get: function () { return jsdocTypePrattParser.visitorKeys; } +}); +exports.commentHandler = commentHandler; +exports.commentParserToESTree = commentParserToESTree; +exports.defaultNoNames = defaultNoNames; +exports.defaultNoTypes = defaultNoTypes; +exports.findJSDocComment = findJSDocComment; +exports.getDecorator = getDecorator; +exports.getJSDocComment = getJSDocComment; +exports.getReducedASTNode = getReducedASTNode; +exports.getTokenizers = getTokenizers; +exports.hasSeeWithLink = hasSeeWithLink; +exports.jsdocVisitorKeys = jsdocVisitorKeys; +exports.parseComment = parseComment; +exports.toCamelCase = toCamelCase; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/LICENSE b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/LICENSE new file mode 100644 index 00000000000000..c91d3e722ea663 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Sergii Iavorskyi + +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. \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/browser/index.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/browser/index.js new file mode 100644 index 00000000000000..b76551a72af95f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/browser/index.js @@ -0,0 +1,651 @@ +var CommentParser = (function (exports) { + 'use strict'; + + function isSpace(source) { + return /^\s+$/.test(source); + } + function splitCR(source) { + const matches = source.match(/\r+$/); + return matches == null + ? ['', source] + : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)]; + } + function splitSpace(source) { + const matches = source.match(/^\s+/); + return matches == null + ? ['', source] + : [source.slice(0, matches[0].length), source.slice(matches[0].length)]; + } + function splitLines(source) { + return source.split(/\n/); + } + function seedBlock(block = {}) { + return Object.assign({ description: '', tags: [], source: [], problems: [] }, block); + } + function seedSpec(spec = {}) { + return Object.assign({ tag: '', name: '', type: '', optional: false, description: '', problems: [], source: [] }, spec); + } + function seedTokens(tokens = {}) { + return Object.assign({ start: '', delimiter: '', postDelimiter: '', tag: '', postTag: '', name: '', postName: '', type: '', postType: '', description: '', end: '', lineEnd: '' }, tokens); + } + /** + * Assures Block.tags[].source contains references to the Block.source items, + * using Block.source as a source of truth. This is a counterpart of rewireSpecs + * @param block parsed coments block + */ + function rewireSource(block) { + const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map()); + for (const spec of block.tags) { + spec.source = spec.source.map((line) => source.get(line.number)); + } + return block; + } + /** + * Assures Block.source contains references to the Block.tags[].source items, + * using Block.tags[].source as a source of truth. This is a counterpart of rewireSource + * @param block parsed coments block + */ + function rewireSpecs(block) { + const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map()); + block.source = block.source.map((line) => source.get(line.number) || line); + return block; + } + + const reTag = /^@\S+/; + /** + * Creates configured `Parser` + * @param {Partial} options + */ + function getParser$3({ fence = '```', } = {}) { + const fencer = getFencer(fence); + const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced; + return function parseBlock(source) { + // start with description section + const sections = [[]]; + let isFenced = false; + for (const line of source) { + if (reTag.test(line.tokens.description) && !isFenced) { + sections.push([line]); + } + else { + sections[sections.length - 1].push(line); + } + isFenced = toggleFence(line.tokens.description, isFenced); + } + return sections; + }; + } + function getFencer(fence) { + if (typeof fence === 'string') + return (source) => source.split(fence).length % 2 === 0; + return fence; + } + + exports.Markers = void 0; + (function (Markers) { + Markers["start"] = "/**"; + Markers["nostart"] = "/***"; + Markers["delim"] = "*"; + Markers["end"] = "*/"; + })(exports.Markers || (exports.Markers = {})); + + function getParser$2({ startLine = 0, } = {}) { + let block = null; + let num = startLine; + return function parseSource(source) { + let rest = source; + const tokens = seedTokens(); + [tokens.lineEnd, rest] = splitCR(rest); + [tokens.start, rest] = splitSpace(rest); + if (block === null && + rest.startsWith(exports.Markers.start) && + !rest.startsWith(exports.Markers.nostart)) { + block = []; + tokens.delimiter = rest.slice(0, exports.Markers.start.length); + rest = rest.slice(exports.Markers.start.length); + [tokens.postDelimiter, rest] = splitSpace(rest); + } + if (block === null) { + num++; + return null; + } + const isClosed = rest.trimRight().endsWith(exports.Markers.end); + if (tokens.delimiter === '' && + rest.startsWith(exports.Markers.delim) && + !rest.startsWith(exports.Markers.end)) { + tokens.delimiter = exports.Markers.delim; + rest = rest.slice(exports.Markers.delim.length); + [tokens.postDelimiter, rest] = splitSpace(rest); + } + if (isClosed) { + const trimmed = rest.trimRight(); + tokens.end = rest.slice(trimmed.length - exports.Markers.end.length); + rest = trimmed.slice(0, -exports.Markers.end.length); + } + tokens.description = rest; + block.push({ number: num, source, tokens }); + num++; + if (isClosed) { + const result = block.slice(); + block = null; + return result; + } + return null; + }; + } + + function getParser$1({ tokenizers }) { + return function parseSpec(source) { + var _a; + let spec = seedSpec({ source }); + for (const tokenize of tokenizers) { + spec = tokenize(spec); + if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical) + break; + } + return spec; + }; + } + + /** + * Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token, + * and populates `spec.tag` + */ + function tagTokenizer() { + return (spec) => { + const { tokens } = spec.source[0]; + const match = tokens.description.match(/\s*(@(\S+))(\s*)/); + if (match === null) { + spec.problems.push({ + code: 'spec:tag:prefix', + message: 'tag should start with "@" symbol', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + tokens.tag = match[1]; + tokens.postTag = match[3]; + tokens.description = tokens.description.slice(match[0].length); + spec.tag = match[2]; + return spec; + }; + } + + /** + * Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description` + * tokens and populates Spec.type` + * + * @param {Spacing} spacing tells how to deal with a whitespace + * for type values going over multiple lines + */ + function typeTokenizer(spacing = 'compact') { + const join = getJoiner$1(spacing); + return (spec) => { + let curlies = 0; + let lines = []; + for (const [i, { tokens }] of spec.source.entries()) { + let type = ''; + if (i === 0 && tokens.description[0] !== '{') + return spec; + for (const ch of tokens.description) { + if (ch === '{') + curlies++; + if (ch === '}') + curlies--; + type += ch; + if (curlies === 0) + break; + } + lines.push([tokens, type]); + if (curlies === 0) + break; + } + if (curlies !== 0) { + spec.problems.push({ + code: 'spec:type:unpaired-curlies', + message: 'unpaired curlies', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + const parts = []; + const offset = lines[0][0].postDelimiter.length; + for (const [i, [tokens, type]] of lines.entries()) { + tokens.type = type; + if (i > 0) { + tokens.type = tokens.postDelimiter.slice(offset) + type; + tokens.postDelimiter = tokens.postDelimiter.slice(0, offset); + } + [tokens.postType, tokens.description] = splitSpace(tokens.description.slice(type.length)); + parts.push(tokens.type); + } + parts[0] = parts[0].slice(1); + parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1); + spec.type = join(parts); + return spec; + }; + } + const trim = (x) => x.trim(); + function getJoiner$1(spacing) { + if (spacing === 'compact') + return (t) => t.map(trim).join(''); + else if (spacing === 'preserve') + return (t) => t.join('\n'); + else + return spacing; + } + + const isQuoted = (s) => s && s.startsWith('"') && s.endsWith('"'); + /** + * Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens, + * and populates the `spec.name` + */ + function nameTokenizer() { + const typeEnd = (num, { tokens }, i) => tokens.type === '' ? num : i; + return (spec) => { + // look for the name in the line where {type} ends + const { tokens } = spec.source[spec.source.reduce(typeEnd, 0)]; + const source = tokens.description.trimLeft(); + const quotedGroups = source.split('"'); + // if it starts with quoted group, assume it is a literal + if (quotedGroups.length > 1 && + quotedGroups[0] === '' && + quotedGroups.length % 2 === 1) { + spec.name = quotedGroups[1]; + tokens.name = `"${quotedGroups[1]}"`; + [tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length)); + return spec; + } + let brackets = 0; + let name = ''; + let optional = false; + let defaultValue; + // assume name is non-space string or anything wrapped into brackets + for (const ch of source) { + if (brackets === 0 && isSpace(ch)) + break; + if (ch === '[') + brackets++; + if (ch === ']') + brackets--; + name += ch; + } + if (brackets !== 0) { + spec.problems.push({ + code: 'spec:name:unpaired-brackets', + message: 'unpaired brackets', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + const nameToken = name; + if (name[0] === '[' && name[name.length - 1] === ']') { + optional = true; + name = name.slice(1, -1); + const parts = name.split('='); + name = parts[0].trim(); + if (parts[1] !== undefined) + defaultValue = parts.slice(1).join('=').trim(); + if (name === '') { + spec.problems.push({ + code: 'spec:name:empty-name', + message: 'empty name', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + if (defaultValue === '') { + spec.problems.push({ + code: 'spec:name:empty-default', + message: 'empty default value', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + // has "=" and is not a string, except for "=>" + if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) { + spec.problems.push({ + code: 'spec:name:invalid-default', + message: 'invalid default value syntax', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + } + spec.optional = optional; + spec.name = name; + tokens.name = nameToken; + if (defaultValue !== undefined) + spec.default = defaultValue; + [tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length)); + return spec; + }; + } + + /** + * Makes no changes to `spec.lines[].tokens` but joins them into `spec.description` + * following given spacing srtategy + * @param {Spacing} spacing tells how to handle the whitespace + */ + function descriptionTokenizer(spacing = 'compact') { + const join = getJoiner(spacing); + return (spec) => { + spec.description = join(spec.source); + return spec; + }; + } + function getJoiner(spacing) { + if (spacing === 'compact') + return compactJoiner; + if (spacing === 'preserve') + return preserveJoiner; + return spacing; + } + function compactJoiner(lines) { + return lines + .map(({ tokens: { description } }) => description.trim()) + .filter((description) => description !== '') + .join(' '); + } + const lineNo = (num, { tokens }, i) => tokens.type === '' ? num : i; + const getDescription = ({ tokens }) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) + + tokens.description; + function preserveJoiner(lines) { + if (lines.length === 0) + return ''; + // skip the opening line with no description + if (lines[0].tokens.description === '' && + lines[0].tokens.delimiter === exports.Markers.start) + lines = lines.slice(1); + // skip the closing line with no description + const lastLine = lines[lines.length - 1]; + if (lastLine !== undefined && + lastLine.tokens.description === '' && + lastLine.tokens.end.endsWith(exports.Markers.end)) + lines = lines.slice(0, -1); + // description starts at the last line of type definition + lines = lines.slice(lines.reduce(lineNo, 0)); + return lines.map(getDescription).join('\n'); + } + + function getParser({ startLine = 0, fence = '```', spacing = 'compact', tokenizers = [ + tagTokenizer(), + typeTokenizer(spacing), + nameTokenizer(), + descriptionTokenizer(spacing), + ], } = {}) { + if (startLine < 0 || startLine % 1 > 0) + throw new Error('Invalid startLine'); + const parseSource = getParser$2({ startLine }); + const parseBlock = getParser$3({ fence }); + const parseSpec = getParser$1({ tokenizers }); + const joinDescription = getJoiner(spacing); + const notEmpty = (line) => line.tokens.description.trim() != ''; + return function (source) { + const blocks = []; + for (const line of splitLines(source)) { + const lines = parseSource(line); + if (lines === null) + continue; + if (lines.find(notEmpty) === undefined) + continue; + const sections = parseBlock(lines); + const specs = sections.slice(1).map(parseSpec); + blocks.push({ + description: joinDescription(sections[0]), + tags: specs, + source: lines, + problems: specs.reduce((acc, spec) => acc.concat(spec.problems), []), + }); + } + return blocks; + }; + } + + function join(tokens) { + return (tokens.start + + tokens.delimiter + + tokens.postDelimiter + + tokens.tag + + tokens.postTag + + tokens.type + + tokens.postType + + tokens.name + + tokens.postName + + tokens.description + + tokens.end + + tokens.lineEnd); + } + function getStringifier() { + return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n'); + } + + var __rest$2 = (window && window.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + const zeroWidth$1 = { + start: 0, + tag: 0, + type: 0, + name: 0, + }; + const getWidth = (w, { tokens: t }) => ({ + start: t.delimiter === exports.Markers.start ? t.start.length : w.start, + tag: Math.max(w.tag, t.tag.length), + type: Math.max(w.type, t.type.length), + name: Math.max(w.name, t.name.length), + }); + const space = (len) => ''.padStart(len, ' '); + function align$1() { + let intoTags = false; + let w; + function update(line) { + const tokens = Object.assign({}, line.tokens); + if (tokens.tag !== '') + intoTags = true; + const isEmpty = tokens.tag === '' && + tokens.name === '' && + tokens.type === '' && + tokens.description === ''; + // dangling '*/' + if (tokens.end === exports.Markers.end && isEmpty) { + tokens.start = space(w.start + 1); + return Object.assign(Object.assign({}, line), { tokens }); + } + switch (tokens.delimiter) { + case exports.Markers.start: + tokens.start = space(w.start); + break; + case exports.Markers.delim: + tokens.start = space(w.start + 1); + break; + default: + tokens.delimiter = ''; + tokens.start = space(w.start + 2); // compensate delimiter + } + if (!intoTags) { + tokens.postDelimiter = tokens.description === '' ? '' : ' '; + return Object.assign(Object.assign({}, line), { tokens }); + } + const nothingAfter = { + delim: false, + tag: false, + type: false, + name: false, + }; + if (tokens.description === '') { + nothingAfter.name = true; + tokens.postName = ''; + if (tokens.name === '') { + nothingAfter.type = true; + tokens.postType = ''; + if (tokens.type === '') { + nothingAfter.tag = true; + tokens.postTag = ''; + if (tokens.tag === '') { + nothingAfter.delim = true; + } + } + } + } + tokens.postDelimiter = nothingAfter.delim ? '' : ' '; + if (!nothingAfter.tag) + tokens.postTag = space(w.tag - tokens.tag.length + 1); + if (!nothingAfter.type) + tokens.postType = space(w.type - tokens.type.length + 1); + if (!nothingAfter.name) + tokens.postName = space(w.name - tokens.name.length + 1); + return Object.assign(Object.assign({}, line), { tokens }); + } + return (_a) => { + var { source } = _a, fields = __rest$2(_a, ["source"]); + w = source.reduce(getWidth, Object.assign({}, zeroWidth$1)); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; + } + + var __rest$1 = (window && window.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + const pull = (offset) => (str) => str.slice(offset); + const push = (offset) => { + const space = ''.padStart(offset, ' '); + return (str) => str + space; + }; + function indent(pos) { + let shift; + const pad = (start) => { + if (shift === undefined) { + const offset = pos - start.length; + shift = offset > 0 ? push(offset) : pull(-offset); + } + return shift(start); + }; + const update = (line) => (Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { start: pad(line.tokens.start) }) })); + return (_a) => { + var { source } = _a, fields = __rest$1(_a, ["source"]); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; + } + + var __rest = (window && window.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + function crlf(ending) { + function update(line) { + return Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { lineEnd: ending === 'LF' ? '' : '\r' }) }); + } + return (_a) => { + var { source } = _a, fields = __rest(_a, ["source"]); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; + } + + function flow(...transforms) { + return (block) => transforms.reduce((block, t) => t(block), block); + } + + const zeroWidth = { + line: 0, + start: 0, + delimiter: 0, + postDelimiter: 0, + tag: 0, + postTag: 0, + name: 0, + postName: 0, + type: 0, + postType: 0, + description: 0, + end: 0, + lineEnd: 0, + }; + const headers = { lineEnd: 'CR' }; + const fields = Object.keys(zeroWidth); + const repr = (x) => (isSpace(x) ? `{${x.length}}` : x); + const frame = (line) => '|' + line.join('|') + '|'; + const align = (width, tokens) => Object.keys(tokens).map((k) => repr(tokens[k]).padEnd(width[k])); + function inspect({ source }) { + var _a, _b; + if (source.length === 0) + return ''; + const width = Object.assign({}, zeroWidth); + for (const f of fields) + width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length; + for (const { number, tokens } of source) { + width.line = Math.max(width.line, number.toString().length); + for (const k in tokens) + width[k] = Math.max(width[k], repr(tokens[k]).length); + } + const lines = [[], []]; + for (const f of fields) + lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f])); + for (const f of fields) + lines[1].push('-'.padEnd(width[f], '-')); + for (const { number, tokens } of source) { + const line = number.toString().padStart(width.line); + lines.push([line, ...align(width, tokens)]); + } + return lines.map(frame).join('\n'); + } + + function parse(source, options = {}) { + return getParser(options)(source); + } + const stringify = getStringifier(); + const transforms = { + flow: flow, + align: align$1, + indent: indent, + crlf: crlf, + }; + const tokenizers = { + tag: tagTokenizer, + type: typeTokenizer, + name: nameTokenizer, + description: descriptionTokenizer, + }; + const util = { rewireSpecs, rewireSource, seedBlock, seedTokens }; + + exports.inspect = inspect; + exports.parse = parse; + exports.stringify = stringify; + exports.tokenizers = tokenizers; + exports.transforms = transforms; + exports.util = util; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +}({})); diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/index.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/index.js new file mode 100644 index 00000000000000..6b6c4751396e20 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/index.js @@ -0,0 +1,30 @@ +import getParser from './parser/index.js'; +import descriptionTokenizer from './parser/tokenizers/description.js'; +import nameTokenizer from './parser/tokenizers/name.js'; +import tagTokenizer from './parser/tokenizers/tag.js'; +import typeTokenizer from './parser/tokenizers/type.js'; +import getStringifier from './stringifier/index.js'; +import alignTransform from './transforms/align.js'; +import indentTransform from './transforms/indent.js'; +import crlfTransform from './transforms/crlf.js'; +import { flow as flowTransform } from './transforms/index.js'; +import { rewireSpecs, rewireSource, seedBlock, seedTokens } from './util.js'; +export * from './primitives.js'; +export function parse(source, options = {}) { + return getParser(options)(source); +} +export const stringify = getStringifier(); +export { default as inspect } from './stringifier/inspect.js'; +export const transforms = { + flow: flowTransform, + align: alignTransform, + indent: indentTransform, + crlf: crlfTransform, +}; +export const tokenizers = { + tag: tagTokenizer, + type: typeTokenizer, + name: nameTokenizer, + description: descriptionTokenizer, +}; +export const util = { rewireSpecs, rewireSource, seedBlock, seedTokens }; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/block-parser.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/block-parser.js new file mode 100644 index 00000000000000..9c4a62bc845d13 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/block-parser.js @@ -0,0 +1,29 @@ +const reTag = /^@\S+/; +/** + * Creates configured `Parser` + * @param {Partial} options + */ +export default function getParser({ fence = '```', } = {}) { + const fencer = getFencer(fence); + const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced; + return function parseBlock(source) { + // start with description section + const sections = [[]]; + let isFenced = false; + for (const line of source) { + if (reTag.test(line.tokens.description) && !isFenced) { + sections.push([line]); + } + else { + sections[sections.length - 1].push(line); + } + isFenced = toggleFence(line.tokens.description, isFenced); + } + return sections; + }; +} +function getFencer(fence) { + if (typeof fence === 'string') + return (source) => source.split(fence).length % 2 === 0; + return fence; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/index.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/index.js new file mode 100644 index 00000000000000..5ad7383a926727 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/index.js @@ -0,0 +1,41 @@ +import { splitLines } from '../util.js'; +import blockParser from './block-parser.js'; +import sourceParser from './source-parser.js'; +import specParser from './spec-parser.js'; +import tokenizeTag from './tokenizers/tag.js'; +import tokenizeType from './tokenizers/type.js'; +import tokenizeName from './tokenizers/name.js'; +import tokenizeDescription, { getJoiner as getDescriptionJoiner, } from './tokenizers/description.js'; +export default function getParser({ startLine = 0, fence = '```', spacing = 'compact', tokenizers = [ + tokenizeTag(), + tokenizeType(spacing), + tokenizeName(), + tokenizeDescription(spacing), +], } = {}) { + if (startLine < 0 || startLine % 1 > 0) + throw new Error('Invalid startLine'); + const parseSource = sourceParser({ startLine }); + const parseBlock = blockParser({ fence }); + const parseSpec = specParser({ tokenizers }); + const joinDescription = getDescriptionJoiner(spacing); + const notEmpty = (line) => line.tokens.description.trim() != ''; + return function (source) { + const blocks = []; + for (const line of splitLines(source)) { + const lines = parseSource(line); + if (lines === null) + continue; + if (lines.find(notEmpty) === undefined) + continue; + const sections = parseBlock(lines); + const specs = sections.slice(1).map(parseSpec); + blocks.push({ + description: joinDescription(sections[0]), + tags: specs, + source: lines, + problems: specs.reduce((acc, spec) => acc.concat(spec.problems), []), + }); + } + return blocks; + }; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/source-parser.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/source-parser.js new file mode 100644 index 00000000000000..3a2acd6514cac0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/source-parser.js @@ -0,0 +1,46 @@ +import { Markers } from '../primitives.js'; +import { seedTokens, splitSpace, splitCR } from '../util.js'; +export default function getParser({ startLine = 0, } = {}) { + let block = null; + let num = startLine; + return function parseSource(source) { + let rest = source; + const tokens = seedTokens(); + [tokens.lineEnd, rest] = splitCR(rest); + [tokens.start, rest] = splitSpace(rest); + if (block === null && + rest.startsWith(Markers.start) && + !rest.startsWith(Markers.nostart)) { + block = []; + tokens.delimiter = rest.slice(0, Markers.start.length); + rest = rest.slice(Markers.start.length); + [tokens.postDelimiter, rest] = splitSpace(rest); + } + if (block === null) { + num++; + return null; + } + const isClosed = rest.trimRight().endsWith(Markers.end); + if (tokens.delimiter === '' && + rest.startsWith(Markers.delim) && + !rest.startsWith(Markers.end)) { + tokens.delimiter = Markers.delim; + rest = rest.slice(Markers.delim.length); + [tokens.postDelimiter, rest] = splitSpace(rest); + } + if (isClosed) { + const trimmed = rest.trimRight(); + tokens.end = rest.slice(trimmed.length - Markers.end.length); + rest = trimmed.slice(0, -Markers.end.length); + } + tokens.description = rest; + block.push({ number: num, source, tokens }); + num++; + if (isClosed) { + const result = block.slice(); + block = null; + return result; + } + return null; + }; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/spec-parser.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/spec-parser.js new file mode 100644 index 00000000000000..934e009052c5fc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/spec-parser.js @@ -0,0 +1,13 @@ +import { seedSpec } from '../util.js'; +export default function getParser({ tokenizers }) { + return function parseSpec(source) { + var _a; + let spec = seedSpec({ source }); + for (const tokenize of tokenizers) { + spec = tokenize(spec); + if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical) + break; + } + return spec; + }; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/description.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/description.js new file mode 100644 index 00000000000000..440ccc50dfdf84 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/description.js @@ -0,0 +1,46 @@ +import { Markers } from '../../primitives.js'; +/** + * Makes no changes to `spec.lines[].tokens` but joins them into `spec.description` + * following given spacing srtategy + * @param {Spacing} spacing tells how to handle the whitespace + */ +export default function descriptionTokenizer(spacing = 'compact') { + const join = getJoiner(spacing); + return (spec) => { + spec.description = join(spec.source); + return spec; + }; +} +export function getJoiner(spacing) { + if (spacing === 'compact') + return compactJoiner; + if (spacing === 'preserve') + return preserveJoiner; + return spacing; +} +function compactJoiner(lines) { + return lines + .map(({ tokens: { description } }) => description.trim()) + .filter((description) => description !== '') + .join(' '); +} +const lineNo = (num, { tokens }, i) => tokens.type === '' ? num : i; +const getDescription = ({ tokens }) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) + + tokens.description; +function preserveJoiner(lines) { + if (lines.length === 0) + return ''; + // skip the opening line with no description + if (lines[0].tokens.description === '' && + lines[0].tokens.delimiter === Markers.start) + lines = lines.slice(1); + // skip the closing line with no description + const lastLine = lines[lines.length - 1]; + if (lastLine !== undefined && + lastLine.tokens.description === '' && + lastLine.tokens.end.endsWith(Markers.end)) + lines = lines.slice(0, -1); + // description starts at the last line of type definition + lines = lines.slice(lines.reduce(lineNo, 0)); + return lines.map(getDescription).join('\n'); +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/index.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/index.js new file mode 100644 index 00000000000000..cb0ff5c3b541f6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/index.js @@ -0,0 +1 @@ +export {}; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/name.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/name.js new file mode 100644 index 00000000000000..ec1b44717bccb6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/name.js @@ -0,0 +1,91 @@ +import { splitSpace, isSpace } from '../../util.js'; +const isQuoted = (s) => s && s.startsWith('"') && s.endsWith('"'); +/** + * Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens, + * and populates the `spec.name` + */ +export default function nameTokenizer() { + const typeEnd = (num, { tokens }, i) => tokens.type === '' ? num : i; + return (spec) => { + // look for the name in the line where {type} ends + const { tokens } = spec.source[spec.source.reduce(typeEnd, 0)]; + const source = tokens.description.trimLeft(); + const quotedGroups = source.split('"'); + // if it starts with quoted group, assume it is a literal + if (quotedGroups.length > 1 && + quotedGroups[0] === '' && + quotedGroups.length % 2 === 1) { + spec.name = quotedGroups[1]; + tokens.name = `"${quotedGroups[1]}"`; + [tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length)); + return spec; + } + let brackets = 0; + let name = ''; + let optional = false; + let defaultValue; + // assume name is non-space string or anything wrapped into brackets + for (const ch of source) { + if (brackets === 0 && isSpace(ch)) + break; + if (ch === '[') + brackets++; + if (ch === ']') + brackets--; + name += ch; + } + if (brackets !== 0) { + spec.problems.push({ + code: 'spec:name:unpaired-brackets', + message: 'unpaired brackets', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + const nameToken = name; + if (name[0] === '[' && name[name.length - 1] === ']') { + optional = true; + name = name.slice(1, -1); + const parts = name.split('='); + name = parts[0].trim(); + if (parts[1] !== undefined) + defaultValue = parts.slice(1).join('=').trim(); + if (name === '') { + spec.problems.push({ + code: 'spec:name:empty-name', + message: 'empty name', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + if (defaultValue === '') { + spec.problems.push({ + code: 'spec:name:empty-default', + message: 'empty default value', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + // has "=" and is not a string, except for "=>" + if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) { + spec.problems.push({ + code: 'spec:name:invalid-default', + message: 'invalid default value syntax', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + } + spec.optional = optional; + spec.name = name; + tokens.name = nameToken; + if (defaultValue !== undefined) + spec.default = defaultValue; + [tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length)); + return spec; + }; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/tag.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/tag.js new file mode 100644 index 00000000000000..4696b00dab08a0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/tag.js @@ -0,0 +1,24 @@ +/** + * Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token, + * and populates `spec.tag` + */ +export default function tagTokenizer() { + return (spec) => { + const { tokens } = spec.source[0]; + const match = tokens.description.match(/\s*(@(\S+))(\s*)/); + if (match === null) { + spec.problems.push({ + code: 'spec:tag:prefix', + message: 'tag should start with "@" symbol', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + tokens.tag = match[1]; + tokens.postTag = match[3]; + tokens.description = tokens.description.slice(match[0].length); + spec.tag = match[2]; + return spec; + }; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/type.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/type.js new file mode 100644 index 00000000000000..b084603d76314c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/parser/tokenizers/type.js @@ -0,0 +1,65 @@ +import { splitSpace } from '../../util.js'; +/** + * Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description` + * tokens and populates Spec.type` + * + * @param {Spacing} spacing tells how to deal with a whitespace + * for type values going over multiple lines + */ +export default function typeTokenizer(spacing = 'compact') { + const join = getJoiner(spacing); + return (spec) => { + let curlies = 0; + let lines = []; + for (const [i, { tokens }] of spec.source.entries()) { + let type = ''; + if (i === 0 && tokens.description[0] !== '{') + return spec; + for (const ch of tokens.description) { + if (ch === '{') + curlies++; + if (ch === '}') + curlies--; + type += ch; + if (curlies === 0) + break; + } + lines.push([tokens, type]); + if (curlies === 0) + break; + } + if (curlies !== 0) { + spec.problems.push({ + code: 'spec:type:unpaired-curlies', + message: 'unpaired curlies', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + const parts = []; + const offset = lines[0][0].postDelimiter.length; + for (const [i, [tokens, type]] of lines.entries()) { + tokens.type = type; + if (i > 0) { + tokens.type = tokens.postDelimiter.slice(offset) + type; + tokens.postDelimiter = tokens.postDelimiter.slice(0, offset); + } + [tokens.postType, tokens.description] = splitSpace(tokens.description.slice(type.length)); + parts.push(tokens.type); + } + parts[0] = parts[0].slice(1); + parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1); + spec.type = join(parts); + return spec; + }; +} +const trim = (x) => x.trim(); +function getJoiner(spacing) { + if (spacing === 'compact') + return (t) => t.map(trim).join(''); + else if (spacing === 'preserve') + return (t) => t.join('\n'); + else + return spacing; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/primitives.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/primitives.js new file mode 100644 index 00000000000000..7dc7f5d80c083d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/primitives.js @@ -0,0 +1,7 @@ +export var Markers; +(function (Markers) { + Markers["start"] = "/**"; + Markers["nostart"] = "/***"; + Markers["delim"] = "*"; + Markers["end"] = "*/"; +})(Markers || (Markers = {})); diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/stringifier/index.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/stringifier/index.js new file mode 100644 index 00000000000000..60b46ca4f59575 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/stringifier/index.js @@ -0,0 +1,17 @@ +function join(tokens) { + return (tokens.start + + tokens.delimiter + + tokens.postDelimiter + + tokens.tag + + tokens.postTag + + tokens.type + + tokens.postType + + tokens.name + + tokens.postName + + tokens.description + + tokens.end + + tokens.lineEnd); +} +export default function getStringifier() { + return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n'); +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/stringifier/inspect.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/stringifier/inspect.js new file mode 100644 index 00000000000000..4569f3ccfe1273 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/stringifier/inspect.js @@ -0,0 +1,44 @@ +import { isSpace } from '../util.js'; +const zeroWidth = { + line: 0, + start: 0, + delimiter: 0, + postDelimiter: 0, + tag: 0, + postTag: 0, + name: 0, + postName: 0, + type: 0, + postType: 0, + description: 0, + end: 0, + lineEnd: 0, +}; +const headers = { lineEnd: 'CR' }; +const fields = Object.keys(zeroWidth); +const repr = (x) => (isSpace(x) ? `{${x.length}}` : x); +const frame = (line) => '|' + line.join('|') + '|'; +const align = (width, tokens) => Object.keys(tokens).map((k) => repr(tokens[k]).padEnd(width[k])); +export default function inspect({ source }) { + var _a, _b; + if (source.length === 0) + return ''; + const width = Object.assign({}, zeroWidth); + for (const f of fields) + width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length; + for (const { number, tokens } of source) { + width.line = Math.max(width.line, number.toString().length); + for (const k in tokens) + width[k] = Math.max(width[k], repr(tokens[k]).length); + } + const lines = [[], []]; + for (const f of fields) + lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f])); + for (const f of fields) + lines[1].push('-'.padEnd(width[f], '-')); + for (const { number, tokens } of source) { + const line = number.toString().padStart(width.line); + lines.push([line, ...align(width, tokens)]); + } + return lines.map(frame).join('\n'); +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/align.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/align.js new file mode 100644 index 00000000000000..c66570531c3364 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/align.js @@ -0,0 +1,93 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import { Markers } from '../primitives.js'; +import { rewireSource } from '../util.js'; +const zeroWidth = { + start: 0, + tag: 0, + type: 0, + name: 0, +}; +const getWidth = (w, { tokens: t }) => ({ + start: t.delimiter === Markers.start ? t.start.length : w.start, + tag: Math.max(w.tag, t.tag.length), + type: Math.max(w.type, t.type.length), + name: Math.max(w.name, t.name.length), +}); +const space = (len) => ''.padStart(len, ' '); +export default function align() { + let intoTags = false; + let w; + function update(line) { + const tokens = Object.assign({}, line.tokens); + if (tokens.tag !== '') + intoTags = true; + const isEmpty = tokens.tag === '' && + tokens.name === '' && + tokens.type === '' && + tokens.description === ''; + // dangling '*/' + if (tokens.end === Markers.end && isEmpty) { + tokens.start = space(w.start + 1); + return Object.assign(Object.assign({}, line), { tokens }); + } + switch (tokens.delimiter) { + case Markers.start: + tokens.start = space(w.start); + break; + case Markers.delim: + tokens.start = space(w.start + 1); + break; + default: + tokens.delimiter = ''; + tokens.start = space(w.start + 2); // compensate delimiter + } + if (!intoTags) { + tokens.postDelimiter = tokens.description === '' ? '' : ' '; + return Object.assign(Object.assign({}, line), { tokens }); + } + const nothingAfter = { + delim: false, + tag: false, + type: false, + name: false, + }; + if (tokens.description === '') { + nothingAfter.name = true; + tokens.postName = ''; + if (tokens.name === '') { + nothingAfter.type = true; + tokens.postType = ''; + if (tokens.type === '') { + nothingAfter.tag = true; + tokens.postTag = ''; + if (tokens.tag === '') { + nothingAfter.delim = true; + } + } + } + } + tokens.postDelimiter = nothingAfter.delim ? '' : ' '; + if (!nothingAfter.tag) + tokens.postTag = space(w.tag - tokens.tag.length + 1); + if (!nothingAfter.type) + tokens.postType = space(w.type - tokens.type.length + 1); + if (!nothingAfter.name) + tokens.postName = space(w.name - tokens.name.length + 1); + return Object.assign(Object.assign({}, line), { tokens }); + } + return (_a) => { + var { source } = _a, fields = __rest(_a, ["source"]); + w = source.reduce(getWidth, Object.assign({}, zeroWidth)); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/crlf.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/crlf.js new file mode 100644 index 00000000000000..f876f949cb19bf --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/crlf.js @@ -0,0 +1,34 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import { rewireSource } from '../util.js'; +const order = [ + 'end', + 'description', + 'postType', + 'type', + 'postName', + 'name', + 'postTag', + 'tag', + 'postDelimiter', + 'delimiter', + 'start', +]; +export default function crlf(ending) { + function update(line) { + return Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { lineEnd: ending === 'LF' ? '' : '\r' }) }); + } + return (_a) => { + var { source } = _a, fields = __rest(_a, ["source"]); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/indent.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/indent.js new file mode 100644 index 00000000000000..ca24b854026b6a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/indent.js @@ -0,0 +1,32 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import { rewireSource } from '../util.js'; +const pull = (offset) => (str) => str.slice(offset); +const push = (offset) => { + const space = ''.padStart(offset, ' '); + return (str) => str + space; +}; +export default function indent(pos) { + let shift; + const pad = (start) => { + if (shift === undefined) { + const offset = pos - start.length; + shift = offset > 0 ? push(offset) : pull(-offset); + } + return shift(start); + }; + const update = (line) => (Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { start: pad(line.tokens.start) }) })); + return (_a) => { + var { source } = _a, fields = __rest(_a, ["source"]); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/index.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/index.js new file mode 100644 index 00000000000000..af165719fb822b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/transforms/index.js @@ -0,0 +1,3 @@ +export function flow(...transforms) { + return (block) => transforms.reduce((block, t) => t(block), block); +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/util.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/util.js new file mode 100644 index 00000000000000..4476e26f2711fc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/es6/util.js @@ -0,0 +1,52 @@ +export function isSpace(source) { + return /^\s+$/.test(source); +} +export function hasCR(source) { + return /\r$/.test(source); +} +export function splitCR(source) { + const matches = source.match(/\r+$/); + return matches == null + ? ['', source] + : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)]; +} +export function splitSpace(source) { + const matches = source.match(/^\s+/); + return matches == null + ? ['', source] + : [source.slice(0, matches[0].length), source.slice(matches[0].length)]; +} +export function splitLines(source) { + return source.split(/\n/); +} +export function seedBlock(block = {}) { + return Object.assign({ description: '', tags: [], source: [], problems: [] }, block); +} +export function seedSpec(spec = {}) { + return Object.assign({ tag: '', name: '', type: '', optional: false, description: '', problems: [], source: [] }, spec); +} +export function seedTokens(tokens = {}) { + return Object.assign({ start: '', delimiter: '', postDelimiter: '', tag: '', postTag: '', name: '', postName: '', type: '', postType: '', description: '', end: '', lineEnd: '' }, tokens); +} +/** + * Assures Block.tags[].source contains references to the Block.source items, + * using Block.source as a source of truth. This is a counterpart of rewireSpecs + * @param block parsed coments block + */ +export function rewireSource(block) { + const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map()); + for (const spec of block.tags) { + spec.source = spec.source.map((line) => source.get(line.number)); + } + return block; +} +/** + * Assures Block.source contains references to the Block.tags[].source items, + * using Block.tags[].source as a source of truth. This is a counterpart of rewireSource + * @param block parsed coments block + */ +export function rewireSpecs(block) { + const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map()); + block.source = block.source.map((line) => source.get(line.number) || line); + return block; +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/jest.config.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/jest.config.cjs new file mode 100644 index 00000000000000..a90258738198a4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/jest.config.cjs @@ -0,0 +1,207 @@ +// For a detailed explanation regarding each configuration property, visit: +// https://jestjs.io/docs/en/configuration.html + +const { compilerOptions: tsconfig } = JSON.parse( + require('fs').readFileSync('./tsconfig.node.json') +); + +module.exports = { + globals: { + 'ts-jest': { + tsconfig, + }, + }, + + // All imported modules in your tests should be mocked automatically + // automock: false, + + // Stop running tests after `n` failures + // bail: 0, + + // The directory where Jest should store its cached dependency information + // cacheDirectory: "/private/var/folders/_g/g97k3tbx31x08qqy2z18kxq80000gn/T/jest_dx", + + // Automatically clear mock calls and instances between every test + // clearMocks: false, + + // Indicates whether the coverage information should be collected while executing the test + collectCoverage: true, + + // An array of glob patterns indicating a set of files for which coverage information should be collected + // collectCoverageFrom: undefined, + + // The directory where Jest should output its coverage files + // coverageDirectory: ".coverage", + + // An array of regexp pattern strings used to skip coverage collection + coveragePathIgnorePatterns: ['/node_modules/', '/lib/', '/tests/'], + + // Indicates which provider should be used to instrument code for coverage + coverageProvider: 'v8', + + // A list of reporter names that Jest uses when writing coverage reports + // coverageReporters: [ + // "json", + // "text", + // "lcov", + // "clover" + // ], + + // An object that configures minimum threshold enforcement for coverage results + // coverageThreshold: { + // global : { + // branches: 85, + // functions: 85, + // lines: 85, + // statements: 85 + // } + // }, + + // A path to a custom dependency extractor + // dependencyExtractor: undefined, + + // Make calling deprecated APIs throw helpful error messages + // errorOnDeprecated: false, + + // Force coverage collection from ignored files using an array of glob patterns + // forceCoverageMatch: [], + + // A path to a module which exports an async function that is triggered once before all test suites + // globalSetup: undefined, + + // A path to a module which exports an async function that is triggered once after all test suites + // globalTeardown: undefined, + + // A set of global variables that need to be available in all test environments + // globals: {}, + + // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. + // maxWorkers: "50%", + + // An array of directory names to be searched recursively up from the requiring module's location + // moduleDirectories: [ + // "node_modules" + // ], + + // An array of file extensions your modules use + // moduleFileExtensions: [ + // "js", + // "json", + // "jsx", + // "ts", + // "tsx", + // "node" + // ], + + // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module + // moduleNameMapper: {}, + + // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader + // modulePathIgnorePatterns: [], + + // Activates notifications for test results + // notify: false, + + // An enum that specifies notification mode. Requires { notify: true } + // notifyMode: "failure-change", + + // A preset that is used as a base for Jest's configuration + preset: 'ts-jest', + + // Run tests from one or more projects + // projects: undefined, + + // Use this configuration option to add custom reporters to Jest + // reporters: undefined, + + // Automatically reset mock state between every test + // resetMocks: false, + + // Reset the module registry before running each individual test + // resetModules: false, + + // A path to a custom resolver + // resolver: undefined, + + // Automatically restore mock state between every test + // restoreMocks: false, + + // The root directory that Jest should scan for tests and modules within + // rootDir: undefined, + + // A list of paths to directories that Jest should use to search for files in + roots: ['/tests/'], + + // Allows you to use a custom runner instead of Jest's default test runner + // runner: "jest-runner", + + // The paths to modules that run some code to configure or set up the testing environment before each test + // setupFiles: [], + + // A list of paths to modules that run some code to configure or set up the testing framework before each test + // setupFilesAfterEnv: [], + + // The number of seconds after which a test is considered as slow and reported as such in the results. + // slowTestThreshold: 5, + + // A list of paths to snapshot serializer modules Jest should use for snapshot testing + // snapshotSerializers: [], + + // The test environment that will be used for testing + testEnvironment: 'node', + + // Options that will be passed to the testEnvironment + // testEnvironmentOptions: {}, + + // Adds a location field to test results + // testLocationInResults: false, + + // The glob patterns Jest uses to detect test files + // testMatch: [ + // "**/__tests__/**/*.[jt]s?(x)", + // "**/?(*.)+(spec|test).[tj]s?(x)" + // ], + + // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped + // testPathIgnorePatterns: [ + // "/node_modules/" + // ], + + // The regexp pattern or array of patterns that Jest uses to detect test files + // testRegex: [], + + // This option allows the use of a custom results processor + // testResultsProcessor: undefined, + + // This option allows use of a custom test runner + // testRunner: "jasmine2", + + // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href + // testURL: "http://localhost", + + // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" + // timers: "real", + + // A map from regular expressions to paths to transformers + transform: { + '^.+\\.ts$': 'ts-jest', + }, + + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + // transformIgnorePatterns: [ + // "/node_modules/", + // "\\.pnp\\.[^\\/]+$" + // ], + + // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them + // unmockedModulePathPatterns: undefined, + + // Indicates whether each individual test should be reported during the run + // verbose: undefined, + + // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode + // watchPathIgnorePatterns: [], + + // Whether to use watchman for file crawling + // watchman: true, +}; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/index.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/index.cjs new file mode 100644 index 00000000000000..f7970b41e547e8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/index.cjs @@ -0,0 +1,82 @@ +"use strict"; + +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +var __exportStar = this && this.__exportStar || function (m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.util = exports.tokenizers = exports.transforms = exports.inspect = exports.stringify = exports.parse = void 0; + +const index_1 = require("./parser/index.cjs"); + +const description_1 = require("./parser/tokenizers/description.cjs"); + +const name_1 = require("./parser/tokenizers/name.cjs"); + +const tag_1 = require("./parser/tokenizers/tag.cjs"); + +const type_1 = require("./parser/tokenizers/type.cjs"); + +const index_2 = require("./stringifier/index.cjs"); + +const align_1 = require("./transforms/align.cjs"); + +const indent_1 = require("./transforms/indent.cjs"); + +const crlf_1 = require("./transforms/crlf.cjs"); + +const index_3 = require("./transforms/index.cjs"); + +const util_1 = require("./util.cjs"); + +__exportStar(require("./primitives.cjs"), exports); + +function parse(source, options = {}) { + return index_1.default(options)(source); +} + +exports.parse = parse; +exports.stringify = index_2.default(); + +var inspect_1 = require("./stringifier/inspect.cjs"); + +Object.defineProperty(exports, "inspect", { + enumerable: true, + get: function () { + return inspect_1.default; + } +}); +exports.transforms = { + flow: index_3.flow, + align: align_1.default, + indent: indent_1.default, + crlf: crlf_1.default +}; +exports.tokenizers = { + tag: tag_1.default, + type: type_1.default, + name: name_1.default, + description: description_1.default +}; +exports.util = { + rewireSpecs: util_1.rewireSpecs, + rewireSource: util_1.rewireSource, + seedBlock: util_1.seedBlock, + seedTokens: util_1.seedTokens +}; +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/block-parser.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/block-parser.cjs new file mode 100644 index 00000000000000..b81ecd79c4fe59 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/block-parser.cjs @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +const reTag = /^@\S+/; +/** + * Creates configured `Parser` + * @param {Partial} options + */ + +function getParser({ + fence = '```' +} = {}) { + const fencer = getFencer(fence); + + const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced; + + return function parseBlock(source) { + // start with description section + const sections = [[]]; + let isFenced = false; + + for (const line of source) { + if (reTag.test(line.tokens.description) && !isFenced) { + sections.push([line]); + } else { + sections[sections.length - 1].push(line); + } + + isFenced = toggleFence(line.tokens.description, isFenced); + } + + return sections; + }; +} + +exports.default = getParser; + +function getFencer(fence) { + if (typeof fence === 'string') return source => source.split(fence).length % 2 === 0; + return fence; +} +//# sourceMappingURL=block-parser.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/index.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/index.cjs new file mode 100644 index 00000000000000..ea12ad1b17dd49 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/index.cjs @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +const block_parser_1 = require("./block-parser.cjs"); + +const source_parser_1 = require("./source-parser.cjs"); + +const spec_parser_1 = require("./spec-parser.cjs"); + +const tag_1 = require("./tokenizers/tag.cjs"); + +const type_1 = require("./tokenizers/type.cjs"); + +const name_1 = require("./tokenizers/name.cjs"); + +const description_1 = require("./tokenizers/description.cjs"); + +function getParser({ + startLine = 0, + fence = '```', + spacing = 'compact', + tokenizers = [tag_1.default(), type_1.default(spacing), name_1.default(), description_1.default(spacing)] +} = {}) { + if (startLine < 0 || startLine % 1 > 0) throw new Error('Invalid startLine'); + const parseSource = source_parser_1.default({ + startLine + }); + const parseBlock = block_parser_1.default({ + fence + }); + const parseSpec = spec_parser_1.default({ + tokenizers + }); + const joinDescription = description_1.getJoiner(spacing); + + const notEmpty = line => line.tokens.description.trim() != ''; + + return function (source) { + const blocks = []; + + for (const line of util_1.splitLines(source)) { + const lines = parseSource(line); + if (lines === null) continue; + if (lines.find(notEmpty) === undefined) continue; + const sections = parseBlock(lines); + const specs = sections.slice(1).map(parseSpec); + blocks.push({ + description: joinDescription(sections[0]), + tags: specs, + source: lines, + problems: specs.reduce((acc, spec) => acc.concat(spec.problems), []) + }); + } + + return blocks; + }; +} + +exports.default = getParser; +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/source-parser.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/source-parser.cjs new file mode 100644 index 00000000000000..da970c1b6e6f16 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/source-parser.cjs @@ -0,0 +1,67 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const primitives_1 = require("../primitives.cjs"); + +const util_1 = require("../util.cjs"); + +function getParser({ + startLine = 0 +} = {}) { + let block = null; + let num = startLine; + return function parseSource(source) { + let rest = source; + const tokens = util_1.seedTokens(); + [tokens.lineEnd, rest] = util_1.splitCR(rest); + [tokens.start, rest] = util_1.splitSpace(rest); + + if (block === null && rest.startsWith(primitives_1.Markers.start) && !rest.startsWith(primitives_1.Markers.nostart)) { + block = []; + tokens.delimiter = rest.slice(0, primitives_1.Markers.start.length); + rest = rest.slice(primitives_1.Markers.start.length); + [tokens.postDelimiter, rest] = util_1.splitSpace(rest); + } + + if (block === null) { + num++; + return null; + } + + const isClosed = rest.trimRight().endsWith(primitives_1.Markers.end); + + if (tokens.delimiter === '' && rest.startsWith(primitives_1.Markers.delim) && !rest.startsWith(primitives_1.Markers.end)) { + tokens.delimiter = primitives_1.Markers.delim; + rest = rest.slice(primitives_1.Markers.delim.length); + [tokens.postDelimiter, rest] = util_1.splitSpace(rest); + } + + if (isClosed) { + const trimmed = rest.trimRight(); + tokens.end = rest.slice(trimmed.length - primitives_1.Markers.end.length); + rest = trimmed.slice(0, -primitives_1.Markers.end.length); + } + + tokens.description = rest; + block.push({ + number: num, + source, + tokens + }); + num++; + + if (isClosed) { + const result = block.slice(); + block = null; + return result; + } + + return null; + }; +} + +exports.default = getParser; +//# sourceMappingURL=source-parser.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/spec-parser.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/spec-parser.cjs new file mode 100644 index 00000000000000..6857828236e402 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/spec-parser.cjs @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +function getParser({ + tokenizers +}) { + return function parseSpec(source) { + var _a; + + let spec = util_1.seedSpec({ + source + }); + + for (const tokenize of tokenizers) { + spec = tokenize(spec); + if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical) break; + } + + return spec; + }; +} + +exports.default = getParser; +//# sourceMappingURL=spec-parser.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/description.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/description.cjs new file mode 100644 index 00000000000000..0338b3acc8b6f8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/description.cjs @@ -0,0 +1,61 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getJoiner = void 0; + +const primitives_1 = require("../../primitives.cjs"); +/** + * Makes no changes to `spec.lines[].tokens` but joins them into `spec.description` + * following given spacing srtategy + * @param {Spacing} spacing tells how to handle the whitespace + */ + + +function descriptionTokenizer(spacing = 'compact') { + const join = getJoiner(spacing); + return spec => { + spec.description = join(spec.source); + return spec; + }; +} + +exports.default = descriptionTokenizer; + +function getJoiner(spacing) { + if (spacing === 'compact') return compactJoiner; + if (spacing === 'preserve') return preserveJoiner; + return spacing; +} + +exports.getJoiner = getJoiner; + +function compactJoiner(lines) { + return lines.map(({ + tokens: { + description + } + }) => description.trim()).filter(description => description !== '').join(' '); +} + +const lineNo = (num, { + tokens +}, i) => tokens.type === '' ? num : i; + +const getDescription = ({ + tokens +}) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) + tokens.description; + +function preserveJoiner(lines) { + if (lines.length === 0) return ''; // skip the opening line with no description + + if (lines[0].tokens.description === '' && lines[0].tokens.delimiter === primitives_1.Markers.start) lines = lines.slice(1); // skip the closing line with no description + + const lastLine = lines[lines.length - 1]; + if (lastLine !== undefined && lastLine.tokens.description === '' && lastLine.tokens.end.endsWith(primitives_1.Markers.end)) lines = lines.slice(0, -1); // description starts at the last line of type definition + + lines = lines.slice(lines.reduce(lineNo, 0)); + return lines.map(getDescription).join('\n'); +} +//# sourceMappingURL=description.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/index.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/index.cjs new file mode 100644 index 00000000000000..203880fed84ce2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/index.cjs @@ -0,0 +1,6 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/name.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/name.cjs new file mode 100644 index 00000000000000..613740b9428a97 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/name.cjs @@ -0,0 +1,109 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../../util.cjs"); + +const isQuoted = s => s && s.startsWith('"') && s.endsWith('"'); +/** + * Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens, + * and populates the `spec.name` + */ + + +function nameTokenizer() { + const typeEnd = (num, { + tokens + }, i) => tokens.type === '' ? num : i; + + return spec => { + // look for the name in the line where {type} ends + const { + tokens + } = spec.source[spec.source.reduce(typeEnd, 0)]; + const source = tokens.description.trimLeft(); + const quotedGroups = source.split('"'); // if it starts with quoted group, assume it is a literal + + if (quotedGroups.length > 1 && quotedGroups[0] === '' && quotedGroups.length % 2 === 1) { + spec.name = quotedGroups[1]; + tokens.name = `"${quotedGroups[1]}"`; + [tokens.postName, tokens.description] = util_1.splitSpace(source.slice(tokens.name.length)); + return spec; + } + + let brackets = 0; + let name = ''; + let optional = false; + let defaultValue; // assume name is non-space string or anything wrapped into brackets + + for (const ch of source) { + if (brackets === 0 && util_1.isSpace(ch)) break; + if (ch === '[') brackets++; + if (ch === ']') brackets--; + name += ch; + } + + if (brackets !== 0) { + spec.problems.push({ + code: 'spec:name:unpaired-brackets', + message: 'unpaired brackets', + line: spec.source[0].number, + critical: true + }); + return spec; + } + + const nameToken = name; + + if (name[0] === '[' && name[name.length - 1] === ']') { + optional = true; + name = name.slice(1, -1); + const parts = name.split('='); + name = parts[0].trim(); + if (parts[1] !== undefined) defaultValue = parts.slice(1).join('=').trim(); + + if (name === '') { + spec.problems.push({ + code: 'spec:name:empty-name', + message: 'empty name', + line: spec.source[0].number, + critical: true + }); + return spec; + } + + if (defaultValue === '') { + spec.problems.push({ + code: 'spec:name:empty-default', + message: 'empty default value', + line: spec.source[0].number, + critical: true + }); + return spec; + } // has "=" and is not a string, except for "=>" + + + if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) { + spec.problems.push({ + code: 'spec:name:invalid-default', + message: 'invalid default value syntax', + line: spec.source[0].number, + critical: true + }); + return spec; + } + } + + spec.optional = optional; + spec.name = name; + tokens.name = nameToken; + if (defaultValue !== undefined) spec.default = defaultValue; + [tokens.postName, tokens.description] = util_1.splitSpace(source.slice(tokens.name.length)); + return spec; + }; +} + +exports.default = nameTokenizer; +//# sourceMappingURL=name.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/tag.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/tag.cjs new file mode 100644 index 00000000000000..55aec566c6f644 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/tag.cjs @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token, + * and populates `spec.tag` + */ + +function tagTokenizer() { + return spec => { + const { + tokens + } = spec.source[0]; + const match = tokens.description.match(/\s*(@(\S+))(\s*)/); + + if (match === null) { + spec.problems.push({ + code: 'spec:tag:prefix', + message: 'tag should start with "@" symbol', + line: spec.source[0].number, + critical: true + }); + return spec; + } + + tokens.tag = match[1]; + tokens.postTag = match[3]; + tokens.description = tokens.description.slice(match[0].length); + spec.tag = match[2]; + return spec; + }; +} + +exports.default = tagTokenizer; +//# sourceMappingURL=tag.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/type.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/type.cjs new file mode 100644 index 00000000000000..0018ec59c4ecc7 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/parser/tokenizers/type.cjs @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../../util.cjs"); +/** + * Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description` + * tokens and populates Spec.type` + * + * @param {Spacing} spacing tells how to deal with a whitespace + * for type values going over multiple lines + */ + + +function typeTokenizer(spacing = 'compact') { + const join = getJoiner(spacing); + return spec => { + let curlies = 0; + let lines = []; + + for (const [i, { + tokens + }] of spec.source.entries()) { + let type = ''; + if (i === 0 && tokens.description[0] !== '{') return spec; + + for (const ch of tokens.description) { + if (ch === '{') curlies++; + if (ch === '}') curlies--; + type += ch; + if (curlies === 0) break; + } + + lines.push([tokens, type]); + if (curlies === 0) break; + } + + if (curlies !== 0) { + spec.problems.push({ + code: 'spec:type:unpaired-curlies', + message: 'unpaired curlies', + line: spec.source[0].number, + critical: true + }); + return spec; + } + + const parts = []; + const offset = lines[0][0].postDelimiter.length; + + for (const [i, [tokens, type]] of lines.entries()) { + tokens.type = type; + + if (i > 0) { + tokens.type = tokens.postDelimiter.slice(offset) + type; + tokens.postDelimiter = tokens.postDelimiter.slice(0, offset); + } + + [tokens.postType, tokens.description] = util_1.splitSpace(tokens.description.slice(type.length)); + parts.push(tokens.type); + } + + parts[0] = parts[0].slice(1); + parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1); + spec.type = join(parts); + return spec; + }; +} + +exports.default = typeTokenizer; + +const trim = x => x.trim(); + +function getJoiner(spacing) { + if (spacing === 'compact') return t => t.map(trim).join('');else if (spacing === 'preserve') return t => t.join('\n');else return spacing; +} +//# sourceMappingURL=type.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/primitives.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/primitives.cjs new file mode 100644 index 00000000000000..01343ccae69256 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/primitives.cjs @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Markers = void 0; +var Markers; + +(function (Markers) { + Markers["start"] = "/**"; + Markers["nostart"] = "/***"; + Markers["delim"] = "*"; + Markers["end"] = "*/"; +})(Markers = exports.Markers || (exports.Markers = {})); +//# sourceMappingURL=primitives.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/stringifier/index.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/stringifier/index.cjs new file mode 100644 index 00000000000000..26214cb1d0d0b4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/stringifier/index.cjs @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function join(tokens) { + return tokens.start + tokens.delimiter + tokens.postDelimiter + tokens.tag + tokens.postTag + tokens.type + tokens.postType + tokens.name + tokens.postName + tokens.description + tokens.end + tokens.lineEnd; +} + +function getStringifier() { + return block => block.source.map(({ + tokens + }) => join(tokens)).join('\n'); +} + +exports.default = getStringifier; +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/stringifier/inspect.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/stringifier/inspect.cjs new file mode 100644 index 00000000000000..ee3473a036f225 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/stringifier/inspect.cjs @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +const zeroWidth = { + line: 0, + start: 0, + delimiter: 0, + postDelimiter: 0, + tag: 0, + postTag: 0, + name: 0, + postName: 0, + type: 0, + postType: 0, + description: 0, + end: 0, + lineEnd: 0 +}; +const headers = { + lineEnd: 'CR' +}; +const fields = Object.keys(zeroWidth); + +const repr = x => util_1.isSpace(x) ? `{${x.length}}` : x; + +const frame = line => '|' + line.join('|') + '|'; + +const align = (width, tokens) => Object.keys(tokens).map(k => repr(tokens[k]).padEnd(width[k])); + +function inspect({ + source +}) { + var _a, _b; + + if (source.length === 0) return ''; + const width = Object.assign({}, zeroWidth); + + for (const f of fields) width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length; + + for (const { + number, + tokens + } of source) { + width.line = Math.max(width.line, number.toString().length); + + for (const k in tokens) width[k] = Math.max(width[k], repr(tokens[k]).length); + } + + const lines = [[], []]; + + for (const f of fields) lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f])); + + for (const f of fields) lines[1].push('-'.padEnd(width[f], '-')); + + for (const { + number, + tokens + } of source) { + const line = number.toString().padStart(width.line); + lines.push([line, ...align(width, tokens)]); + } + + return lines.map(frame).join('\n'); +} + +exports.default = inspect; +//# sourceMappingURL=inspect.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/align.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/align.cjs new file mode 100644 index 00000000000000..7d65e23c37f157 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/align.cjs @@ -0,0 +1,127 @@ +"use strict"; + +var __rest = this && this.__rest || function (s, e) { + var t = {}; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +}; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const primitives_1 = require("../primitives.cjs"); + +const util_1 = require("../util.cjs"); + +const zeroWidth = { + start: 0, + tag: 0, + type: 0, + name: 0 +}; + +const getWidth = (w, { + tokens: t +}) => ({ + start: t.delimiter === primitives_1.Markers.start ? t.start.length : w.start, + tag: Math.max(w.tag, t.tag.length), + type: Math.max(w.type, t.type.length), + name: Math.max(w.name, t.name.length) +}); + +const space = len => ''.padStart(len, ' '); + +function align() { + let intoTags = false; + let w; + + function update(line) { + const tokens = Object.assign({}, line.tokens); + if (tokens.tag !== '') intoTags = true; + const isEmpty = tokens.tag === '' && tokens.name === '' && tokens.type === '' && tokens.description === ''; // dangling '*/' + + if (tokens.end === primitives_1.Markers.end && isEmpty) { + tokens.start = space(w.start + 1); + return Object.assign(Object.assign({}, line), { + tokens + }); + } + + switch (tokens.delimiter) { + case primitives_1.Markers.start: + tokens.start = space(w.start); + break; + + case primitives_1.Markers.delim: + tokens.start = space(w.start + 1); + break; + + default: + tokens.delimiter = ''; + tokens.start = space(w.start + 2); + // compensate delimiter + } + + if (!intoTags) { + tokens.postDelimiter = tokens.description === '' ? '' : ' '; + return Object.assign(Object.assign({}, line), { + tokens + }); + } + + const nothingAfter = { + delim: false, + tag: false, + type: false, + name: false + }; + + if (tokens.description === '') { + nothingAfter.name = true; + tokens.postName = ''; + + if (tokens.name === '') { + nothingAfter.type = true; + tokens.postType = ''; + + if (tokens.type === '') { + nothingAfter.tag = true; + tokens.postTag = ''; + + if (tokens.tag === '') { + nothingAfter.delim = true; + } + } + } + } + + tokens.postDelimiter = nothingAfter.delim ? '' : ' '; + if (!nothingAfter.tag) tokens.postTag = space(w.tag - tokens.tag.length + 1); + if (!nothingAfter.type) tokens.postType = space(w.type - tokens.type.length + 1); + if (!nothingAfter.name) tokens.postName = space(w.name - tokens.name.length + 1); + return Object.assign(Object.assign({}, line), { + tokens + }); + } + + return _a => { + var { + source + } = _a, + fields = __rest(_a, ["source"]); + + w = source.reduce(getWidth, Object.assign({}, zeroWidth)); + return util_1.rewireSource(Object.assign(Object.assign({}, fields), { + source: source.map(update) + })); + }; +} + +exports.default = align; +//# sourceMappingURL=align.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/crlf.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/crlf.cjs new file mode 100644 index 00000000000000..c653c48bef6a65 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/crlf.cjs @@ -0,0 +1,44 @@ +"use strict"; + +var __rest = this && this.__rest || function (s, e) { + var t = {}; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +}; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +const order = ['end', 'description', 'postType', 'type', 'postName', 'name', 'postTag', 'tag', 'postDelimiter', 'delimiter', 'start']; + +function crlf(ending) { + function update(line) { + return Object.assign(Object.assign({}, line), { + tokens: Object.assign(Object.assign({}, line.tokens), { + lineEnd: ending === 'LF' ? '' : '\r' + }) + }); + } + + return _a => { + var { + source + } = _a, + fields = __rest(_a, ["source"]); + + return util_1.rewireSource(Object.assign(Object.assign({}, fields), { + source: source.map(update) + })); + }; +} + +exports.default = crlf; +//# sourceMappingURL=crlf.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/indent.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/indent.cjs new file mode 100644 index 00000000000000..3ce279b800d7a9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/indent.cjs @@ -0,0 +1,58 @@ +"use strict"; + +var __rest = this && this.__rest || function (s, e) { + var t = {}; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +}; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +const pull = offset => str => str.slice(offset); + +const push = offset => { + const space = ''.padStart(offset, ' '); + return str => str + space; +}; + +function indent(pos) { + let shift; + + const pad = start => { + if (shift === undefined) { + const offset = pos - start.length; + shift = offset > 0 ? push(offset) : pull(-offset); + } + + return shift(start); + }; + + const update = line => Object.assign(Object.assign({}, line), { + tokens: Object.assign(Object.assign({}, line.tokens), { + start: pad(line.tokens.start) + }) + }); + + return _a => { + var { + source + } = _a, + fields = __rest(_a, ["source"]); + + return util_1.rewireSource(Object.assign(Object.assign({}, fields), { + source: source.map(update) + })); + }; +} + +exports.default = indent; +//# sourceMappingURL=indent.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/index.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/index.cjs new file mode 100644 index 00000000000000..767083ae35d7be --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/transforms/index.cjs @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.flow = void 0; + +function flow(...transforms) { + return block => transforms.reduce((block, t) => t(block), block); +} + +exports.flow = flow; +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/util.cjs b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/util.cjs new file mode 100644 index 00000000000000..5d94c0a5d82d21 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/lib/util.cjs @@ -0,0 +1,113 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rewireSpecs = exports.rewireSource = exports.seedTokens = exports.seedSpec = exports.seedBlock = exports.splitLines = exports.splitSpace = exports.splitCR = exports.hasCR = exports.isSpace = void 0; + +function isSpace(source) { + return /^\s+$/.test(source); +} + +exports.isSpace = isSpace; + +function hasCR(source) { + return /\r$/.test(source); +} + +exports.hasCR = hasCR; + +function splitCR(source) { + const matches = source.match(/\r+$/); + return matches == null ? ['', source] : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)]; +} + +exports.splitCR = splitCR; + +function splitSpace(source) { + const matches = source.match(/^\s+/); + return matches == null ? ['', source] : [source.slice(0, matches[0].length), source.slice(matches[0].length)]; +} + +exports.splitSpace = splitSpace; + +function splitLines(source) { + return source.split(/\n/); +} + +exports.splitLines = splitLines; + +function seedBlock(block = {}) { + return Object.assign({ + description: '', + tags: [], + source: [], + problems: [] + }, block); +} + +exports.seedBlock = seedBlock; + +function seedSpec(spec = {}) { + return Object.assign({ + tag: '', + name: '', + type: '', + optional: false, + description: '', + problems: [], + source: [] + }, spec); +} + +exports.seedSpec = seedSpec; + +function seedTokens(tokens = {}) { + return Object.assign({ + start: '', + delimiter: '', + postDelimiter: '', + tag: '', + postTag: '', + name: '', + postName: '', + type: '', + postType: '', + description: '', + end: '', + lineEnd: '' + }, tokens); +} + +exports.seedTokens = seedTokens; +/** + * Assures Block.tags[].source contains references to the Block.source items, + * using Block.source as a source of truth. This is a counterpart of rewireSpecs + * @param block parsed coments block + */ + +function rewireSource(block) { + const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map()); + + for (const spec of block.tags) { + spec.source = spec.source.map(line => source.get(line.number)); + } + + return block; +} + +exports.rewireSource = rewireSource; +/** + * Assures Block.source contains references to the Block.tags[].source items, + * using Block.tags[].source as a source of truth. This is a counterpart of rewireSource + * @param block parsed coments block + */ + +function rewireSpecs(block) { + const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map()); + block.source = block.source.map(line => source.get(line.number) || line); + return block; +} + +exports.rewireSpecs = rewireSpecs; +//# sourceMappingURL=util.cjs.map diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/migrate-1.0.md b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/migrate-1.0.md new file mode 100644 index 00000000000000..bd815b678299c2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/migrate-1.0.md @@ -0,0 +1,105 @@ +# Migrating 0.x to 1.x + +## Parser + +0.x can be mostly translated into 1.x one way or another. The idea behind the new config structure is to handle only the most common cases, and provide the fallback for alternative implementation. + +### `dotted_names: boolean` + +> By default dotted names like `name.subname.subsubname` will be expanded into nested sections, this can be prevented by passing opts.dotted_names = false. + +**Removed** This feature is removed but still can be done on top of the `parse()` output. Please post a request or contribute a PR if you need it. + +### `trim: boolean` + +> Set this to false to avoid the default of trimming whitespace at the start and end of each line. + +In the new parser all original spacing is kept along with comment lines in `.source`. Description lines are joined together depending on `spacing` option + +**New option:** + +- `spacing: "compact"` lines concatenated with a single space and no line breaks +- `spacing: "preserve"` keeps line breaks and space around as is. Indentation space counts from `*` delimiter or from the start of the line if the delimiter is omitted +- `spacing: (lines: Line[]) => string` completely freeform joining strategy, since all original spacing can be accessed, there is no limit to how this can be implemented. See [primitives.ts](./src/primitives.ts) and [spacer.ts](./src/parser/spacer.ts) + +### `join: string | number | boolean` + +> If the following lines of a multiline comment do not start with a star, `join` will have the following effect on tag source (and description) when joining the lines together: +> +> - If a string, use that string in place of the leading whitespace (and avoid newlines). +> - If a non-zero number (e.g., 1), do no trimming and avoid newlines. +> - If undefined, false, or 0, use the default behavior of not trimming but adding a newline. +> - Otherwise (e.g., if join is true), replace any leading whitespace with a single space and avoid newlines. +> +> Note that if a multi-line comment has lines that start with a star, these will be appended with initial whitespace as is and with newlines regardless of the join setting. + +See the `spacing` option above, all the variations can be fine-tunned with `spacing: (lines: Line[]) => string` + +### `fence: string | RegExp | ((source: string) => boolean)` + +> Set to a string or regular expression to toggle state upon finding an odd number of matches within a line. Defaults to ```. +> +> If set to a function, it should return true to toggle fenced state; upon returning true the first time, this will prevent subsequent lines from being interpreted as starting a new jsdoc tag until such time as the function returns true again to indicate that the state has toggled back. + +This is mostly kept the same + +**New optoins:** + +- ```` fence: '```' ```` same as 0.x +- `fencer: (source: string) => boolean` same as 0.x, see [parser/block-parser.ts](./src/parser/block-parser.ts) + +### `parsers: Parser[]` + +> In case you need to parse tags in different way you can pass opts.parsers = [parser1, ..., parserN], where each parser is function name(str:String, data:Object):{source:String, data:Object}. +> ... + +**New options:** + +- `tokenizers: []Tokenizer` is a list of functions extracting the `tag`, `type`, `name` and `description` tokens from this string. See [parser/spec-parser.ts](./src/parser/spec-parser.ts) and [primitives.ts](./src/primitives.ts) + +Default tokenizers chain is + +```js +[ + tagTokenizer(), + typeTokenizer(), + nameTokenizer(), + descriptionTokenizer(getSpacer(spacing)), +] +``` + +where + +```ts +type Tokenizer = (spec: Spec) => Spec + +interface Spec { + tag: string; + name: string; + default?: string; + type: string; + optional: boolean; + description: string; + problems: Problem[]; + source: Line[]; +} +``` + +chain starts with blank `Spec` and each tokenizer fulfills a piece using `.source` input + +## Stringifier + +> One may also convert comment-parser JSON structures back into strings using the stringify method (stringify(o: (object|Array) [, opts: object]): string). +> ... + +Stringifier config follows the same strategy – a couple of common cases, and freeform formatter as a fallback + +**New Options:** + +- `format: "none"` re-assembles the source with original spacing and delimiters preserved +- `format: "align"` aligns tag, name, type, and descriptions into fixed-width columns +- `format: (tokens: Tokens) => string[]` do what you like, resulting lines will be concatenated into the output. Despite the simple interface, this can be turned into a complex stateful formatter, see `"align"` implementation in [transforms/align.ts](./src/transforms/align.ts) + +## Stream + +Work in progress diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/package.json b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/package.json new file mode 100644 index 00000000000000..32f8b49368aa8f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/package.json @@ -0,0 +1,85 @@ +{ + "name": "comment-parser", + "version": "1.2.4", + "description": "Generic JSDoc-like comment parser", + "type": "module", + "main": "lib/index.cjs", + "exports": { + ".": { + "import": "./es6/index.js", + "require": "./lib/index.cjs" + }, + "./primitives": { + "import": "./es6/primitives.js", + "require": "./lib/primitives.cjs" + }, + "./util": { + "import": "./es6/util.js", + "require": "./lib/util.cjs" + }, + "./parser/*": { + "import": "./es6/parser/*.js", + "require": "./lib/parser/*.cjs" + }, + "./stringifier/*": { + "import": "./es6/stringifier/*.js", + "require": "./lib/stringifier/*.cjs" + }, + "./transforms/*": { + "import": "./es6/transforms/*.js", + "require": "./lib/transforms/*.cjs" + } + }, + "types": "lib/index.d.ts", + "directories": { + "test": "tests" + }, + "devDependencies": { + "@types/jest": "^26.0.23", + "convert-extension": "^0.3.0", + "jest": "^27.0.5", + "prettier": "2.3.1", + "replace": "^1.2.1", + "rimraf": "^3.0.2", + "rollup": "^2.52.2", + "ts-jest": "^27.0.3", + "typescript": "^4.3.4" + }, + "engines": { + "node": ">= 12.0.0" + }, + "scripts": { + "build": "rimraf lib es6 browser; tsc -p tsconfig.json && tsc -p tsconfig.node.json && rollup -o browser/index.js -f iife --context window -n CommentParser es6/index.js && convert-extension cjs lib/ && cd es6 && replace \"from '(\\.[^']*)'\" \"from '\\$1.js'\" * -r --include=\"*.js\"", + "format": "prettier --write src tests", + "pretest": "rimraf coverage; npm run build", + "test": "prettier --check src tests && jest --verbose", + "preversion": "npm run build" + }, + "repository": { + "type": "git", + "url": "git@github.com:yavorskiy/comment-parser.git" + }, + "keywords": [ + "jsdoc", + "comments", + "parser" + ], + "author": "Sergiy Yavorsky (https://github.com/syavorsky)", + "contributors": [ + "Alexej Yaroshevich (https://github.com/zxqfox)", + "Andre Wachsmuth (https://github.com/blutorange)", + "Brett Zamir (https://github.com/brettz9)", + "Dieter Oberkofler (https://github.com/doberkofler)", + "Evgeny Reznichenko (https://github.com/zxcabs)", + "Javier \"Ciberma\" Mora (https://github.com/jhm-ciberman)", + "Jordan Harband (https://github.com/ljharb)", + "tengattack (https://github.com/tengattack)", + "Jayden Seric (https://github.com/jaydenseric)" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/syavorsky/comment-parser/issues" + }, + "homepage": "https://github.com/syavorsky/comment-parser", + "dependencies": {} +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/tsconfig.node.json b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/tsconfig.node.json new file mode 100644 index 00000000000000..9a05436b7a8fa1 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/node_modules/comment-parser/tsconfig.node.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es2015", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + "outDir": "./lib", + "lib": ["es2016", "es5"] + }, + "include": ["src"], + "exclude": ["node_modules"] +} diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/package.json b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/package.json new file mode 100644 index 00000000000000..b17e73804b5da4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/package.json @@ -0,0 +1,79 @@ +{ + "name": "@es-joy/jsdoccomment", + "version": "0.12.0", + "author": "Brett Zamir ", + "contributors": [], + "description": "Maintained replacement for ESLint's deprecated SourceCode#getJSDocComment along with other jsdoc utilities", + "license": "MIT", + "keywords": [ + "eslint", + "sourcecode" + ], + "type": "module", + "main": "./dist/index.cjs.cjs", + "exports": { + "import": "./src/index.js", + "require": "./dist/index.cjs.cjs" + }, + "c8": { + "checkCoverage": true, + "branches": 100, + "statements": 100, + "lines": 100, + "functions": 100 + }, + "browserslist": [ + "cover 100%" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/es-joy/jsdoccomment.git" + }, + "bugs": { + "url": "https://github.com/es-joy/jsdoccomment/issues" + }, + "homepage": "https://github.com/es-joy/jsdoccomment", + "engines": { + "node": "^12 || ^14 || ^16 || ^17" + }, + "dependencies": { + "comment-parser": "1.2.4", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "2.0.0" + }, + "devDependencies": { + "@babel/core": "^7.15.8", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/preset-env": "^7.15.8", + "@brettz9/eslint-plugin": "^1.0.3", + "@rollup/plugin-babel": "^5.3.0", + "c8": "^7.10.0", + "chai": "^4.3.4", + "eslint": "^8.0.1", + "eslint-config-ash-nazg": "31.2.2", + "eslint-config-standard": "^16.0.3", + "eslint-plugin-array-func": "^3.1.7", + "eslint-plugin-compat": "^3.13.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-html": "^6.2.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-jsdoc": "^36.1.1", + "eslint-plugin-markdown": "^2.2.1", + "eslint-plugin-no-unsanitized": "^3.2.0", + "eslint-plugin-no-use-extend-native": "^0.5.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-sonarjs": "^0.10.0", + "eslint-plugin-unicorn": "^37.0.1", + "mocha": "^9.1.3", + "rollup": "^2.58.0" + }, + "scripts": { + "rollup": "rollup -c", + "eslint": "eslint --ext=js,cjs,md,html .", + "lint": "npm run eslint", + "mocha": "mocha --parallel", + "c8": "c8 npm run mocha", + "test": "npm run lint && npm run rollup && npm run c8" + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/commentHandler.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/commentHandler.js new file mode 100644 index 00000000000000..1d174c99b7c1b7 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/commentHandler.js @@ -0,0 +1,42 @@ +import esquery from 'esquery'; + +import { + visitorKeys as jsdocTypePrattParserVisitorKeys +} from 'jsdoc-type-pratt-parser'; + +import { + commentParserToESTree, jsdocVisitorKeys +} from './commentParserToESTree.js'; + +/** + * @callback CommentHandler + * @param {string} commentSelector + * @param {Node} jsdoc + * @returns {boolean} + */ + +/** + * @param {Settings} settings + * @returns {CommentHandler} + */ +const commentHandler = (settings) => { + /** + * @type {CommentHandler} + */ + return (commentSelector, jsdoc) => { + const {mode} = settings; + + const selector = esquery.parse(commentSelector); + + const ast = commentParserToESTree(jsdoc, mode); + + return esquery.matches(ast, selector, null, { + visitorKeys: { + ...jsdocTypePrattParserVisitorKeys, + ...jsdocVisitorKeys + } + }); + }; +}; + +export default commentHandler; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/commentParserToESTree.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/commentParserToESTree.js new file mode 100644 index 00000000000000..41823dd2f23649 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/commentParserToESTree.js @@ -0,0 +1,149 @@ +import {parse as jsdocTypePrattParse} from 'jsdoc-type-pratt-parser'; + +const stripEncapsulatingBrackets = (container, isArr) => { + if (isArr) { + const firstItem = container[0]; + firstItem.rawType = firstItem.rawType.replace( + /^\{/u, '' + ); + + const lastItem = container[container.length - 1]; + lastItem.rawType = lastItem.rawType.replace(/\}$/u, ''); + + return; + } + container.rawType = container.rawType.replace( + /^\{/u, '' + ).replace(/\}$/u, ''); +}; + +const commentParserToESTree = (jsdoc, mode) => { + const {tokens: { + delimiter: delimiterRoot, + lineEnd: lineEndRoot, + postDelimiter: postDelimiterRoot, + end: endRoot, + description: descriptionRoot + }} = jsdoc.source[0]; + const ast = { + delimiter: delimiterRoot, + description: descriptionRoot, + + descriptionLines: [], + + // `end` will be overwritten if there are other entries + end: endRoot, + postDelimiter: postDelimiterRoot, + lineEnd: lineEndRoot, + + type: 'JsdocBlock' + }; + + const tags = []; + let lastDescriptionLine; + let lastTag = null; + jsdoc.source.slice(1).forEach((info, idx) => { + const {tokens} = info; + const { + delimiter, + description, + postDelimiter, + start, + tag, + end, + type: rawType + } = tokens; + + if (tag || end) { + if (lastDescriptionLine === undefined) { + lastDescriptionLine = idx; + } + + // Clean-up with last tag before end or new tag + if (lastTag) { + // Strip out `}` that encapsulates and is not part of + // the type + stripEncapsulatingBrackets(lastTag); + if (lastTag.typeLines.length) { + stripEncapsulatingBrackets(lastTag.typeLines, true); + } + + // With even a multiline type now in full, add parsing + let parsedType = null; + try { + parsedType = jsdocTypePrattParse(lastTag.rawType, mode); + } catch { + // Ignore + } + + lastTag.parsedType = parsedType; + } + + if (end) { + ast.end = end; + + return; + } + + const { + end: ed, + ...tkns + } = tokens; + + const tagObj = { + ...tkns, + descriptionLines: [], + rawType: '', + type: 'JsdocTag', + typeLines: [] + }; + tagObj.tag = tagObj.tag.replace(/^@/u, ''); + + lastTag = tagObj; + + tags.push(tagObj); + } + + if (rawType) { + // Will strip rawType brackets after this tag + lastTag.typeLines.push( + { + delimiter, + postDelimiter, + rawType, + start, + type: 'JsdocTypeLine' + } + ); + lastTag.rawType += rawType; + } + + if (description) { + const holder = lastTag || ast; + holder.descriptionLines.push({ + delimiter, + description, + postDelimiter, + start, + type: 'JsdocDescriptionLine' + }); + holder.description += holder.description + ? '\n' + description + : description; + } + }); + + ast.lastDescriptionLine = lastDescriptionLine; + ast.tags = tags; + + return ast; +}; + +const jsdocVisitorKeys = { + JsdocBlock: ['tags', 'descriptionLines'], + JsdocDescriptionLine: [], + JsdocTypeLine: [], + JsdocTag: ['descriptionLines', 'typeLines', 'parsedType'] +}; + +export {commentParserToESTree, jsdocVisitorKeys}; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/index.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/index.js new file mode 100644 index 00000000000000..6fc1bed9d58c9b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/index.js @@ -0,0 +1,11 @@ +export {visitorKeys as jsdocTypeVisitorKeys} from 'jsdoc-type-pratt-parser'; + +export {default as commentHandler} from './commentHandler.js'; + +export {default as toCamelCase} from './toCamelCase.js'; + +export * from './parseComment.js'; + +export * from './commentParserToESTree.js'; + +export * from './jsdoccomment.js'; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/jsdoccomment.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/jsdoccomment.js new file mode 100644 index 00000000000000..96674fd9f53458 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/jsdoccomment.js @@ -0,0 +1,247 @@ +/** + * Obtained originally from {@link https://github.com/eslint/eslint/blob/master/lib/util/source-code.js#L313}. + * + * @license MIT + */ + +/** + * Checks if the given token is a comment token or not. + * + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +const isCommentToken = (token) => { + return token.type === 'Line' || token.type === 'Block' || + token.type === 'Shebang'; +}; + +const getDecorator = (node) => { + return node?.declaration?.decorators?.[0] || node?.decorators?.[0] || + node?.parent?.decorators?.[0]; +}; + +/** + * Check to see if its a ES6 export declaration. + * + * @param {ASTNode} astNode An AST node. + * @returns {boolean} whether the given node represents an export declaration. + * @private + */ +const looksLikeExport = function (astNode) { + return astNode.type === 'ExportDefaultDeclaration' || + astNode.type === 'ExportNamedDeclaration' || + astNode.type === 'ExportAllDeclaration' || + astNode.type === 'ExportSpecifier'; +}; + +const getTSFunctionComment = function (astNode) { + const {parent} = astNode; + const grandparent = parent.parent; + const greatGrandparent = grandparent.parent; + const greatGreatGrandparent = greatGrandparent && greatGrandparent.parent; + + // istanbul ignore if + if (parent.type !== 'TSTypeAnnotation') { + return astNode; + } + + switch (grandparent.type) { + case 'PropertyDefinition': + case 'ClassProperty': + case 'TSDeclareFunction': + case 'TSMethodSignature': + case 'TSPropertySignature': + return grandparent; + case 'ArrowFunctionExpression': + // istanbul ignore else + if ( + greatGrandparent.type === 'VariableDeclarator' + + // && greatGreatGrandparent.parent.type === 'VariableDeclaration' + ) { + return greatGreatGrandparent.parent; + } + + // istanbul ignore next + return astNode; + case 'FunctionExpression': + // istanbul ignore else + if (greatGrandparent.type === 'MethodDefinition') { + return greatGrandparent; + } + + // Fallthrough + default: + // istanbul ignore if + if (grandparent.type !== 'Identifier') { + // istanbul ignore next + return astNode; + } + } + + // istanbul ignore next + switch (greatGrandparent.type) { + case 'ArrowFunctionExpression': + // istanbul ignore else + if ( + greatGreatGrandparent.type === 'VariableDeclarator' && + greatGreatGrandparent.parent.type === 'VariableDeclaration' + ) { + return greatGreatGrandparent.parent; + } + + // istanbul ignore next + return astNode; + case 'FunctionDeclaration': + return greatGrandparent; + case 'VariableDeclarator': + // istanbul ignore else + if (greatGreatGrandparent.type === 'VariableDeclaration') { + return greatGreatGrandparent; + } + + // Fallthrough + default: + // istanbul ignore next + return astNode; + } +}; + +const invokedExpression = new Set( + ['CallExpression', 'OptionalCallExpression', 'NewExpression'] +); +const allowableCommentNode = new Set([ + 'VariableDeclaration', + 'ExpressionStatement', + 'MethodDefinition', + 'Property', + 'ObjectProperty', + 'ClassProperty', + 'PropertyDefinition' +]); + +/** + * Reduces the provided node to the appropriate node for evaluating + * JSDoc comment status. + * + * @param {ASTNode} node An AST node. + * @param {SourceCode} sourceCode The ESLint SourceCode. + * @returns {ASTNode} The AST node that can be evaluated for appropriate + * JSDoc comments. + * @private + */ +const getReducedASTNode = function (node, sourceCode) { + let {parent} = node; + + switch (node.type) { + case 'TSFunctionType': + return getTSFunctionComment(node); + case 'TSInterfaceDeclaration': + case 'TSTypeAliasDeclaration': + case 'TSEnumDeclaration': + case 'ClassDeclaration': + case 'FunctionDeclaration': + return looksLikeExport(parent) ? parent : node; + + case 'TSDeclareFunction': + case 'ClassExpression': + case 'ObjectExpression': + case 'ArrowFunctionExpression': + case 'TSEmptyBodyFunctionExpression': + case 'FunctionExpression': + if ( + !invokedExpression.has(parent.type) + ) { + while ( + !sourceCode.getCommentsBefore(parent).length && + !(/Function/u).test(parent.type) && + !allowableCommentNode.has(parent.type) + ) { + ({parent} = parent); + + if (!parent) { + break; + } + } + if (parent && parent.type !== 'FunctionDeclaration' && + parent.type !== 'Program' + ) { + if (parent.parent && parent.parent.type === 'ExportNamedDeclaration') { + return parent.parent; + } + + return parent; + } + } + + return node; + + default: + return node; + } +}; + +/** + * Checks for the presence of a JSDoc comment for the given node and returns it. + * + * @param {ASTNode} astNode The AST node to get the comment for. + * @param {SourceCode} sourceCode + * @param {{maxLines: Integer, minLines: Integer}} settings + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @private + */ +const findJSDocComment = (astNode, sourceCode, settings) => { + const {minLines, maxLines} = settings; + let currentNode = astNode; + let tokenBefore = null; + + while (currentNode) { + const decorator = getDecorator(currentNode); + if (decorator) { + currentNode = decorator; + } + tokenBefore = sourceCode.getTokenBefore( + currentNode, {includeComments: true} + ); + if (!tokenBefore || !isCommentToken(tokenBefore)) { + return null; + } + if (tokenBefore.type === 'Line') { + currentNode = tokenBefore; + continue; + } + break; + } + + if ( + tokenBefore.type === 'Block' && + tokenBefore.value.charAt(0) === '*' && + currentNode.loc.start.line - tokenBefore.loc.end.line >= minLines && + currentNode.loc.start.line - tokenBefore.loc.end.line <= maxLines + ) { + return tokenBefore; + } + + return null; +}; + +/** + * Retrieves the JSDoc comment for a given node. + * + * @param {SourceCode} sourceCode The ESLint SourceCode + * @param {ASTNode} node The AST node to get the comment for. + * @param {PlainObject} settings The settings in context + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @public + */ +const getJSDocComment = function (sourceCode, node, settings) { + const reducedNode = getReducedASTNode(node, sourceCode); + + return findJSDocComment(reducedNode, sourceCode, settings); +}; + +export { + getReducedASTNode, getJSDocComment, getDecorator, findJSDocComment +}; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/parseComment.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/parseComment.js new file mode 100644 index 00000000000000..868931d74cd6b8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/parseComment.js @@ -0,0 +1,126 @@ +/* eslint-disable prefer-named-capture-group -- Temporary */ +import { + parse as commentParser, + tokenizers, + util +} from 'comment-parser'; + +const { + seedBlock, + seedTokens +} = util; + +const { + name: nameTokenizer, + tag: tagTokenizer, + type: typeTokenizer, + description: descriptionTokenizer +} = tokenizers; + +export const hasSeeWithLink = (spec) => { + return spec.tag === 'see' && (/\{@link.+?\}/u).test(spec.source[0].source); +}; + +export const defaultNoTypes = ['default', 'defaultvalue', 'see']; + +export const defaultNoNames = [ + 'access', 'author', + 'default', 'defaultvalue', + 'description', + 'example', 'exception', + 'license', + 'return', 'returns', + 'since', 'summary', + 'throws', + 'version', 'variation' +]; + +const getTokenizers = ({ + noTypes = defaultNoTypes, + noNames = defaultNoNames +} = {}) => { + // trim + return [ + // Tag + tagTokenizer(), + + // Type + (spec) => { + if (noTypes.includes(spec.tag)) { + return spec; + } + + return typeTokenizer()(spec); + }, + + // Name + (spec) => { + if (spec.tag === 'template') { + // const preWS = spec.postTag; + const remainder = spec.source[0].tokens.description; + + const pos = remainder.search(/(? -1) { + [, postName, description, lineEnd] = extra.match(/(\s*)([^\r]*)(\r)?/u); + } + + spec.name = name; + spec.optional = false; + const {tokens} = spec.source[0]; + tokens.name = name; + tokens.postName = postName; + tokens.description = description; + tokens.lineEnd = lineEnd || ''; + + return spec; + } + + if (noNames.includes(spec.tag) || hasSeeWithLink(spec)) { + return spec; + } + + return nameTokenizer()(spec); + }, + + // Description + (spec) => { + return descriptionTokenizer('preserve')(spec); + } + ]; +}; + +/** + * + * @param {PlainObject} commentNode + * @param {string} indent Whitespace + * @returns {PlainObject} + */ +const parseComment = (commentNode, indent) => { + // Preserve JSDoc block start/end indentation. + return commentParser(`/*${commentNode.value}*/`, { + // @see https://github.com/yavorskiy/comment-parser/issues/21 + tokenizers: getTokenizers() + })[0] || seedBlock({ + source: [ + { + number: 0, + tokens: seedTokens({ + delimiter: '/**' + }) + }, + { + number: 1, + tokens: seedTokens({ + end: '*/', + start: indent + ' ' + }) + } + ] + }); +}; + +export {getTokenizers, parseComment}; diff --git a/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/toCamelCase.js b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/toCamelCase.js new file mode 100644 index 00000000000000..7790620c3f145d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/toCamelCase.js @@ -0,0 +1,9 @@ +const toCamelCase = (str) => { + return str.toLowerCase().replace(/^[a-z]/gu, (init) => { + return init.toUpperCase(); + }).replace(/_(?[a-z])/gu, (_, n1, o, s, {wordInit}) => { + return wordInit.toUpperCase(); + }); +}; + +export default toCamelCase; diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/README.md b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/README.md deleted file mode 100644 index 11ff46ec04dfc6..00000000000000 --- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# ESLintRC Library - -This repository contains the legacy ESLintRC configuration file format for ESLint. - -**Note:** This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs. - -## Installation - -You can install the package as follows: - -``` -npm install @eslint/eslintrc --save-dev - -# or - -yarn add @eslint/eslintrc -D -``` - -## Future Usage - -**Note:** This package is not intended for public use at this time. The following is an example of how it will be used in the future. - -The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file: - -```js -import { FlatCompat } from "@eslint/eslintrc"; - -const compat = new FlatCompat(); - -export default [ - - // mimic ESLintRC-style extends - compat.extends("standard", "example"), - - // mimic environments - compat.env({ - es2020: true, - node: true - }), - - // mimic plugins - compat.plugins("airbnb", "react"), - - // translate an entire config - compat.config({ - plugins: ["airbnb", "react"], - extends: "standard", - env: { - es2020: true, - node: true - }, - rules: { - semi: "error" - } - }) -]; -``` - -## License - -MIT License diff --git a/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md b/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md deleted file mode 100644 index 53dce470e75747..00000000000000 --- a/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md +++ /dev/null @@ -1,266 +0,0 @@ -# Config Array - -by [Nicholas C. Zakas](https://humanwhocodes.com) - -If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). - -## Description - -A config array is a way of managing configurations that are based on glob pattern matching of filenames. Each config array contains the information needed to determine the correct configuration for any file based on the filename. - -## Background - -In 2019, I submitted an [ESLint RFC](https://github.com/eslint/rfcs/pull/9) proposing a new way of configuring ESLint. The goal was to streamline what had become an increasingly complicated configuration process. Over several iterations, this proposal was eventually born. - -The basic idea is that all configuration, including overrides, can be represented by a single array where each item in the array is a config object. Config objects appearing later in the array override config objects appearing earlier in the array. You can calculate a config for a given file by traversing all config objects in the array to find the ones that match the filename. Matching is done by specifying glob patterns in `files` and `ignores` properties on each config object. Here's an example: - -```js -export default [ - - // match all JSON files - { - name: "JSON Handler", - files: ["**/*.json"], - handler: jsonHandler - }, - - // match only package.json - { - name: "package.json Handler", - files: ["package.json"], - handler: packageJsonHandler - } -]; -``` - -In this example, there are two config objects: the first matches all JSON files in all directories and the second matches just `package.json` in the base path directory (all the globs are evaluated as relative to a base path that can be specified). When you retrieve a configuration for `foo.json`, only the first config object matches so `handler` is equal to `jsonHandler`; when you retrieve a configuration for `package.json`, `handler` is equal to `packageJsonHandler` (because both config objects match, the second one wins). - -## Installation - -You can install the package using npm or Yarn: - -```bash -npm install @humanwhocodes/config-array --save - -# or - -yarn add @humanwhocodes/config-array -``` - -## Usage - -First, import the `ConfigArray` constructor: - -```js -import { ConfigArray } from "@humanwhocodes/config-array"; - -// or using CommonJS - -const { ConfigArray } = require("@humanwhocodes/config-array"); -``` - -When you create a new instance of `ConfigArray`, you must pass in two arguments: an array of configs and an options object. The array of configs is most likely read in from a configuration file, so here's a typical example: - -```js -const configFilename = path.resolve(process.cwd(), "my.config.js"); -const { default: rawConfigs } = await import(configFilename); -const configs = new ConfigArray(rawConfigs, { - - // the path to match filenames from - basePath: process.cwd(), - - // additional items in each config - schema: mySchema -}); -``` - -This example reads in an object or array from `my.config.js` and passes it into the `ConfigArray` constructor as the first argument. The second argument is an object specifying the `basePath` (the directoy in which `my.config.js` is found) and a `schema` to define the additional properties of a config object beyond `files`, `ignores`, and `name`. - -### Specifying a Schema - -The `schema` option is required for you to use additional properties in config objects. The schema is object that follows the format of an [`ObjectSchema`](https://npmjs.com/package/@humanwhocodes/object-schema). The schema specifies both validation and merge rules that the `ConfigArray` instance needs to combine configs when there are multiple matches. Here's an example: - -```js -const configFilename = path.resolve(process.cwd(), "my.config.js"); -const { default: rawConfigs } = await import(configFilename); - -const mySchema = { - - // define the handler key in configs - handler: { - required: true, - merge(a, b) { - if (!b) return a; - if (!a) return b; - }, - validate(value) { - if (typeof value !== "function") { - throw new TypeError("Function expected."); - } - } - } -}; - -const configs = new ConfigArray(rawConfigs, { - - // the path to match filenames from - basePath: process.cwd(), - - // additional items in each config - schema: mySchema -}); -``` - -### Config Arrays - -Config arrays can be multidimensional, so it's possible for a config array to contain another config array, such as: - -```js -export default [ - - // JS config - { - files: ["**/*.js"], - handler: jsHandler - }, - - // JSON configs - [ - - // match all JSON files - { - name: "JSON Handler", - files: ["**/*.json"], - handler: jsonHandler - }, - - // match only package.json - { - name: "package.json Handler", - files: ["package.json"], - handler: packageJsonHandler - } - ], - - // filename must match function - { - files: [ filePath => filePath.endsWith(".md") ], - handler: markdownHandler - }, - - // filename must match all patterns in subarray - { - files: [ ["*.test.*", "*.js"] ], - handler: jsTestHandler - }, - - // filename must not match patterns beginning with ! - { - name: "Non-JS files", - files: ["!*.js"], - settings: { - js: false - } - } -]; -``` - -In this example, the array contains both config objects and a config array. When a config array is normalized (see details below), it is flattened so only config objects remain. However, the order of evaluation remains the same. - -If the `files` array contains a function, then that function is called with the absolute path of the file and is expected to return `true` if there is a match and `false` if not. (The `ignores` array can also contain functions.) - -If the `files` array contains an item that is an array of strings and functions, then all patterns must match in order for the config to match. In the preceding examples, both `*.test.*` and `*.js` must match in order for the config object to be used. - -If a pattern in the files array begins with `!` then it excludes that pattern. In the preceding example, any filename that doesn't end with `.js` will automatically getting a `settings.js` property set to `false`. - -### Config Functions - -Config arrays can also include config functions. A config function accepts a single parameter, `context` (defined by you), and must return either a config object or a config array (it cannot return another function). Config functions allow end users to execute code in the creation of appropriate config objects. Here's an example: - -```js -export default [ - - // JS config - { - files: ["**/*.js"], - handler: jsHandler - }, - - // JSON configs - function (context) { - return [ - - // match all JSON files - { - name: context.name + " JSON Handler", - files: ["**/*.json"], - handler: jsonHandler - }, - - // match only package.json - { - name: context.name + " package.json Handler", - files: ["package.json"], - handler: packageJsonHandler - } - ]; - } -]; -``` - -When a config array is normalized, each function is executed and replaced in the config array with the return value. - -**Note:** Config functions can also be async. - -### Normalizing Config Arrays - -Once a config array has been created and loaded with all of the raw config data, it must be normalized before it can be used. The normalization process goes through and flattens the config array as well as executing all config functions to get their final values. - -To normalize a config array, call the `normalize()` method and pass in a context object: - -```js -await configs.normalize({ - name: "MyApp" -}); -``` - -The `normalize()` method returns a promise, so be sure to use the `await` operator. The config array instance is normalized in-place, so you don't need to create a new variable. - -If you want to disallow async config functions, you can call `normalizeSync()` instead. This method is completely synchronous and does not require using the `await` operator as it does not return a promise: - -```js -await configs.normalizeSync({ - name: "MyApp" -}); -``` - -**Important:** Once a `ConfigArray` is normalized, it cannot be changed further. You can, however, create a new `ConfigArray` and pass in the normalized instance to create an unnormalized copy. - -### Getting Config for a File - -To get the config for a file, use the `getConfig()` method on a normalized config array and pass in the filename to get a config for: - -```js -// pass in absolute filename -const fileConfig = configs.getConfig(path.resolve(process.cwd(), "package.json")); -``` - -The config array always returns an object, even if there are no configs matching the given filename. You can then inspect the returned config object to determine how to proceed. - -A few things to keep in mind: - -* You must pass in the absolute filename to get a config for. -* The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified. -* The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation. - -## Acknowledgements - -The design of this project was influenced by feedback on the ESLint RFC, and incorporates ideas from: - -* Teddy Katz (@not-an-aardvark) -* Toru Nagashima (@mysticatea) -* Kai Cataldo (@kaicataldo) - -## License - -Apache 2.0 diff --git a/tools/node_modules/eslint/node_modules/@humanwhocodes/object-schema/README.md b/tools/node_modules/eslint/node_modules/@humanwhocodes/object-schema/README.md deleted file mode 100644 index 2163797f8fe15a..00000000000000 --- a/tools/node_modules/eslint/node_modules/@humanwhocodes/object-schema/README.md +++ /dev/null @@ -1,234 +0,0 @@ -# JavaScript ObjectSchema Package - -by [Nicholas C. Zakas](https://humanwhocodes.com) - -If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). - -## Overview - -A JavaScript object merge/validation utility where you can define a different merge and validation strategy for each key. This is helpful when you need to validate complex data structures and then merge them in a way that is more complex than `Object.assign()`. - -## Installation - -You can install using either npm: - -``` -npm install @humanwhocodes/object-schema -``` - -Or Yarn: - -``` -yarn add @humanwhocodes/object-schema -``` - -## Usage - -Use CommonJS to get access to the `ObjectSchema` constructor: - -```js -const { ObjectSchema } = require("@humanwhocodes/object-schema"); - -const schema = new ObjectSchema({ - - // define a definition for the "downloads" key - downloads: { - required: true, - merge(value1, value2) { - return value1 + value2; - }, - validate(value) { - if (typeof value !== "number") { - throw new Error("Expected downloads to be a number."); - } - } - }, - - // define a strategy for the "versions" key - version: { - required: true, - merge(value1, value2) { - return value1.concat(value2); - }, - validate(value) { - if (!Array.isArray(value)) { - throw new Error("Expected versions to be an array."); - } - } - } -}); - -const record1 = { - downloads: 25, - versions: [ - "v1.0.0", - "v1.1.0", - "v1.2.0" - ] -}; - -const record2 = { - downloads: 125, - versions: [ - "v2.0.0", - "v2.1.0", - "v3.0.0" - ] -}; - -// make sure the records are valid -schema.validate(record1); -schema.validate(record2); - -// merge together (schema.merge() accepts any number of objects) -const result = schema.merge(record1, record2); - -// result looks like this: - -const result = { - downloads: 75, - versions: [ - "v1.0.0", - "v1.1.0", - "v1.2.0", - "v2.0.0", - "v2.1.0", - "v3.0.0" - ] -}; -``` - -## Tips and Tricks - -### Named merge strategies - -Instead of specifying a `merge()` method, you can specify one of the following strings to use a default merge strategy: - -* `"assign"` - use `Object.assign()` to merge the two values into one object. -* `"overwrite"` - the second value always replaces the first. -* `"replace"` - the second value replaces the first if the second is not `undefined`. - -For example: - -```js -const schema = new ObjectSchema({ - name: { - merge: "replace", - validate() {} - } -}); -``` - -### Named validation strategies - -Instead of specifying a `validate()` method, you can specify one of the following strings to use a default validation strategy: - -* `"array"` - value must be an array. -* `"boolean"` - value must be a boolean. -* `"number"` - value must be a number. -* `"object"` - value must be an object. -* `"object?"` - value must be an object or null. -* `"string"` - value must be a string. -* `"string!"` - value must be a non-empty string. - -For example: - -```js -const schema = new ObjectSchema({ - name: { - merge: "replace", - validate: "string" - } -}); -``` - -### Subschemas - -If you are defining a key that is, itself, an object, you can simplify the process by using a subschema. Instead of defining `merge()` and `validate()`, assign a `schema` key that contains a schema definition, like this: - -```js -const schema = new ObjectSchema({ - name: { - schema: { - first: { - merge: "replace", - validate: "string" - }, - last: { - merge: "replace", - validate: "string" - } - } - } -}); - -schema.validate({ - name: { - first: "n", - last: "z" - } -}); -``` - -### Remove Keys During Merge - -If the merge strategy for a key returns `undefined`, then the key will not appear in the final object. For example: - -```js -const schema = new ObjectSchema({ - date: { - merge() { - return undefined; - }, - validate(value) { - Date.parse(value); // throws an error when invalid - } - } -}); - -const object1 = { date: "5/5/2005" }; -const object2 = { date: "6/6/2006" }; - -const result = schema.merge(object1, object2); - -console.log("date" in result); // false -``` - -### Requiring Another Key Be Present - -If you'd like the presence of one key to require the presence of another key, you can use the `requires` property to specify an array of other properties that any key requires. For example: - -```js -const schema = new ObjectSchema(); - -const schema = new ObjectSchema({ - date: { - merge() { - return undefined; - }, - validate(value) { - Date.parse(value); // throws an error when invalid - } - }, - time: { - requires: ["date"], - merge(first, second) { - return second; - }, - validate(value) { - // ... - } - } -}); - -// throws error: Key "time" requires keys "date" -schema.validate({ - time: "13:45" -}); -``` - -In this example, even though `date` is an optional key, it is required to be present whenever `time` is present. - -## License - -BSD 3-Clause diff --git a/tools/node_modules/eslint/node_modules/@types/mdast/README.md b/tools/node_modules/eslint/node_modules/@types/mdast/README.md deleted file mode 100755 index 45df54e56ec302..00000000000000 --- a/tools/node_modules/eslint/node_modules/@types/mdast/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/mdast` - -# Summary -This package contains type definitions for Mdast (https://github.com/syntax-tree/mdast). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast. - -### Additional Details - * Last updated: Mon, 23 Aug 2021 20:18:29 GMT - * Dependencies: [@types/unist](https://npmjs.com/package/@types/unist) - * Global values: none - -# Credits -These definitions were written by [Christian Murphy](https://github.com/ChristianMurphy), [Jun Lu](https://github.com/lujun2), [Remco Haszing](https://github.com/remcohaszing), and [Titus Wormer](https://github.com/wooorm). diff --git a/tools/node_modules/eslint/node_modules/@types/unist/README.md b/tools/node_modules/eslint/node_modules/@types/unist/README.md deleted file mode 100755 index 283ae4d3bfed1c..00000000000000 --- a/tools/node_modules/eslint/node_modules/@types/unist/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/unist` - -# Summary -This package contains type definitions for Unist (https://github.com/syntax-tree/unist). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. - -### Additional Details - * Last updated: Thu, 15 Jul 2021 00:31:23 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), and [JounQin](https://github.com/JounQin). diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/README.md b/tools/node_modules/eslint/node_modules/acorn-jsx/README.md deleted file mode 100644 index 317c3ac4a5534e..00000000000000 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Acorn-JSX - -[![Build Status](https://travis-ci.org/acornjs/acorn-jsx.svg?branch=master)](https://travis-ci.org/acornjs/acorn-jsx) -[![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx) - -This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. - -It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools. - -## Transpiler - -Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood. - -## Usage - -Requiring this module provides you with an Acorn plugin that you can use like this: - -```javascript -var acorn = require("acorn"); -var jsx = require("acorn-jsx"); -acorn.Parser.extend(jsx()).parse("my(, 'code');"); -``` - -Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in ``, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option: - -```javascript -acorn.Parser.extend(jsx({ allowNamespacedObjects: true })) -``` - -Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely: - -```javascript -acorn.Parser.extend(jsx({ allowNamespaces: false })) -``` - -Note that by default `allowNamespaces` is enabled for spec compliancy. - -## License - -This plugin is issued under the [MIT license](./LICENSE). diff --git a/tools/node_modules/eslint/node_modules/acorn/README.md b/tools/node_modules/eslint/node_modules/acorn/README.md deleted file mode 100644 index 601e86c8fddfdb..00000000000000 --- a/tools/node_modules/eslint/node_modules/acorn/README.md +++ /dev/null @@ -1,280 +0,0 @@ -# Acorn - -A tiny, fast JavaScript parser written in JavaScript. - -## Community - -Acorn is open source software released under an -[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE). - -You are welcome to -[report bugs](https://github.com/acornjs/acorn/issues) or create pull -requests on [github](https://github.com/acornjs/acorn). For questions -and discussion, please use the -[Tern discussion forum](https://discuss.ternjs.net). - -## Installation - -The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): - -```sh -npm install acorn -``` - -Alternately, you can download the source and build acorn yourself: - -```sh -git clone https://github.com/acornjs/acorn.git -cd acorn -npm install -``` - -## Interface - -**parse**`(input, options)` is the main interface to the library. The -`input` parameter is a string, `options` must be an object setting -some of the options listed below. The return value will be an abstract -syntax tree object as specified by the [ESTree -spec](https://github.com/estree/estree). - -```javascript -let acorn = require("acorn"); -console.log(acorn.parse("1 + 1", {ecmaVersion: 2020})); -``` - -When encountering a syntax error, the parser will raise a -`SyntaxError` object with a meaningful message. The error object will -have a `pos` property that indicates the string offset at which the -error occurred, and a `loc` object that contains a `{line, column}` -object referring to that same position. - -Options are provided by in a second argument, which should be an -object containing any of these fields (only `ecmaVersion` is -required): - -- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be - either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019), - 11 (2020), 12 (2021), 13 (2022, partial support) - or `"latest"` (the latest the library supports). This influences - support for strict mode, the set of reserved words, and support - for new syntax features. - - **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being - implemented by Acorn. Other proposed new features must be - implemented through plugins. - -- **sourceType**: Indicate the mode the code should be parsed in. Can be - either `"script"` or `"module"`. This influences global strict mode - and parsing of `import` and `export` declarations. - - **NOTE**: If set to `"module"`, then static `import` / `export` syntax - will be valid, even if `ecmaVersion` is less than 6. - -- **onInsertedSemicolon**: If given a callback, that callback will be - called whenever a missing semicolon is inserted by the parser. The - callback will be given the character offset of the point where the - semicolon is inserted as argument, and if `locations` is on, also a - `{line, column}` object representing this position. - -- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing - commas. - -- **allowReserved**: If `false`, using a reserved word will generate - an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher - versions. When given the value `"never"`, reserved words and - keywords can also not be used as property names (as in Internet - Explorer's old parser). - -- **allowReturnOutsideFunction**: By default, a return statement at - the top level raises an error. Set this to `true` to accept such - code. - -- **allowImportExportEverywhere**: By default, `import` and `export` - declarations can only appear at a program's top level. Setting this - option to `true` allows them anywhere where a statement is allowed, - and also allows `import.meta` expressions to appear in scripts - (when `sourceType` is not `"module"`). - -- **allowAwaitOutsideFunction**: If `false`, `await` expressions can - only appear inside `async` functions. Defaults to `true` for - `ecmaVersion` 2022 and later, `false` for lower versions. Setting this option to - `true` allows to have top-level `await` expressions. They are - still not allowed in non-`async` functions, though. - -- **allowSuperOutsideMethod**: By default, `super` outside a method - raises an error. Set this to `true` to accept such code. - -- **allowHashBang**: When this is enabled (off by default), if the - code starts with the characters `#!` (as in a shellscript), the - first line will be treated as a comment. - -- **locations**: When `true`, each node has a `loc` object attached - with `start` and `end` subobjects, each of which contains the - one-based line and zero-based column numbers in `{line, column}` - form. Default is `false`. - -- **onToken**: If a function is passed for this option, each found - token will be passed in same format as tokens returned from - `tokenizer().getToken()`. - - If array is passed, each found token is pushed to it. - - Note that you are not allowed to call the parser from the - callback—that will corrupt its internal state. - -- **onComment**: If a function is passed for this option, whenever a - comment is encountered the function will be called with the - following parameters: - - - `block`: `true` if the comment is a block comment, false if it - is a line comment. - - `text`: The content of the comment. - - `start`: Character offset of the start of the comment. - - `end`: Character offset of the end of the comment. - - When the `locations` options is on, the `{line, column}` locations - of the comment’s start and end are passed as two additional - parameters. - - If array is passed for this option, each found comment is pushed - to it as object in Esprima format: - - ```javascript - { - "type": "Line" | "Block", - "value": "comment text", - "start": Number, - "end": Number, - // If `locations` option is on: - "loc": { - "start": {line: Number, column: Number} - "end": {line: Number, column: Number} - }, - // If `ranges` option is on: - "range": [Number, Number] - } - ``` - - Note that you are not allowed to call the parser from the - callback—that will corrupt its internal state. - -- **ranges**: Nodes have their start and end characters offsets - recorded in `start` and `end` properties (directly on the node, - rather than the `loc` object, which holds line/column data. To also - add a - [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678) - `range` property holding a `[start, end]` array with the same - numbers, set the `ranges` option to `true`. - -- **program**: It is possible to parse multiple files into a single - AST by passing the tree produced by parsing the first file as the - `program` option in subsequent parses. This will add the toplevel - forms of the parsed file to the "Program" (top) node of an existing - parse tree. - -- **sourceFile**: When the `locations` option is `true`, you can pass - this option to add a `source` attribute in every node’s `loc` - object. Note that the contents of this option are not examined or - processed in any way; you are free to use whatever format you - choose. - -- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property - will be added (regardless of the `location` option) directly to the - nodes, rather than the `loc` object. - -- **preserveParens**: If this option is `true`, parenthesized expressions - are represented by (non-standard) `ParenthesizedExpression` nodes - that have a single `expression` property containing the expression - inside parentheses. - -**parseExpressionAt**`(input, offset, options)` will parse a single -expression in a string, and return its AST. It will not complain if -there is more of the string left after the expression. - -**tokenizer**`(input, options)` returns an object with a `getToken` -method that can be called repeatedly to get the next token, a `{start, -end, type, value}` object (with added `loc` property when the -`locations` option is enabled and `range` property when the `ranges` -option is enabled). When the token's type is `tokTypes.eof`, you -should stop calling the method, since it will keep returning that same -token forever. - -In ES6 environment, returned result can be used as any other -protocol-compliant iterable: - -```javascript -for (let token of acorn.tokenizer(str)) { - // iterate over the tokens -} - -// transform code to array of tokens: -var tokens = [...acorn.tokenizer(str)]; -``` - -**tokTypes** holds an object mapping names to the token type objects -that end up in the `type` properties of tokens. - -**getLineInfo**`(input, offset)` can be used to get a `{line, -column}` object for a given program string and offset. - -### The `Parser` class - -Instances of the **`Parser`** class contain all the state and logic -that drives a parse. It has static methods `parse`, -`parseExpressionAt`, and `tokenizer` that match the top-level -functions by the same name. - -When extending the parser with plugins, you need to call these methods -on the extended version of the class. To extend a parser with plugins, -you can use its static `extend` method. - -```javascript -var acorn = require("acorn"); -var jsx = require("acorn-jsx"); -var JSXParser = acorn.Parser.extend(jsx()); -JSXParser.parse("foo()", {ecmaVersion: 2020}); -``` - -The `extend` method takes any number of plugin values, and returns a -new `Parser` class that includes the extra parser logic provided by -the plugins. - -## Command line interface - -The `bin/acorn` utility can be used to parse a file from the command -line. It accepts as arguments its input file and the following -options: - -- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version - to parse. Default is version 9. - -- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. - -- `--locations`: Attaches a "loc" object to each node with "start" and - "end" subobjects, each of which contains the one-based line and - zero-based column numbers in `{line, column}` form. - -- `--allow-hash-bang`: If the code starts with the characters #! (as - in a shellscript), the first line will be treated as a comment. - -- `--allow-await-outside-function`: Allows top-level `await` expressions. - See the `allowAwaitOutsideFunction` option for more information. - -- `--compact`: No whitespace is used in the AST output. - -- `--silent`: Do not output the AST, just return the exit status. - -- `--help`: Print the usage information and quit. - -The utility spits out the syntax tree as JSON data. - -## Existing plugins - - - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) - -Plugins for ECMAScript proposals: - - - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: - - [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields) - - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) - - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n diff --git a/tools/node_modules/eslint/node_modules/ajv/README.md b/tools/node_modules/eslint/node_modules/ajv/README.md deleted file mode 100644 index 5aa2078d8920b4..00000000000000 --- a/tools/node_modules/eslint/node_modules/ajv/README.md +++ /dev/null @@ -1,1497 +0,0 @@ -Ajv logo - -# Ajv: Another JSON Schema Validator - -The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07. - -[![Build Status](https://travis-ci.org/ajv-validator/ajv.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv) -[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) -[![npm (beta)](https://img.shields.io/npm/v/ajv/beta)](https://www.npmjs.com/package/ajv/v/7.0.0-beta.0) -[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) -[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) -[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) -[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) - - -## Ajv v7 beta is released - -[Ajv version 7.0.0-beta.0](https://github.com/ajv-validator/ajv/tree/v7-beta) is released with these changes: - -- to reduce the mistakes in JSON schemas and unexpected validation results, [strict mode](./docs/strict-mode.md) is added - it prohibits ignored or ambiguous JSON Schema elements. -- to make code injection from untrusted schemas impossible, [code generation](./docs/codegen.md) is fully re-written to be safe. -- to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas. -- schemas are compiled to ES6 code (ES5 code generation is supported with an option). -- to improve reliability and maintainability the code is migrated to TypeScript. - -**Please note**: - -- the support for JSON-Schema draft-04 is removed - if you have schemas using "id" attributes you have to replace them with "\$id" (or continue using version 6 that will be supported until 02/28/2021). -- all formats are separated to ajv-formats package - they have to be explicitely added if you use them. - -See [release notes](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) for the details. - -To install the new version: - -```bash -npm install ajv@beta -``` - -See [Getting started with v7](https://github.com/ajv-validator/ajv/tree/v7-beta#usage) for code example. - - -## Mozilla MOSS grant and OpenJS Foundation - -[](https://www.mozilla.org/en-US/moss/)     [](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) - -Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition](https://tools.ietf.org/html/draft-ucarion-json-type-definition-04). - -Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. - -This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. - -I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. - - -## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) - -Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! - -Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. - -Please sponsor Ajv via: -- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) -- [Ajv Open Collective️](https://opencollective.com/ajv) - -Thank you. - - -#### Open Collective sponsors - - - - - - - - - - - - - - - -## Using version 6 - -[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published. - -[Ajv version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes). - -__Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance: - -```javascript -ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); -``` - -To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId: - -```javascript -var ajv = new Ajv({schemaId: 'id'}); -// If you want to use both draft-04 and draft-06/07 schemas: -// var ajv = new Ajv({schemaId: 'auto'}); -ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); -``` - - -## Contents - -- [Performance](#performance) -- [Features](#features) -- [Getting started](#getting-started) -- [Frequently Asked Questions](https://github.com/ajv-validator/ajv/blob/master/FAQ.md) -- [Using in browser](#using-in-browser) - - [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) -- [Command line interface](#command-line-interface) -- Validation - - [Keywords](#validation-keywords) - - [Annotation keywords](#annotation-keywords) - - [Formats](#formats) - - [Combining schemas with $ref](#ref) - - [$data reference](#data-reference) - - NEW: [$merge and $patch keywords](#merge-and-patch-keywords) - - [Defining custom keywords](#defining-custom-keywords) - - [Asynchronous schema compilation](#asynchronous-schema-compilation) - - [Asynchronous validation](#asynchronous-validation) -- [Security considerations](#security-considerations) - - [Security contact](#security-contact) - - [Untrusted schemas](#untrusted-schemas) - - [Circular references in objects](#circular-references-in-javascript-objects) - - [Trusted schemas](#security-risks-of-trusted-schemas) - - [ReDoS attack](#redos-attack) -- Modifying data during validation - - [Filtering data](#filtering-data) - - [Assigning defaults](#assigning-defaults) - - [Coercing data types](#coercing-data-types) -- API - - [Methods](#api) - - [Options](#options) - - [Validation errors](#validation-errors) -- [Plugins](#plugins) -- [Related packages](#related-packages) -- [Some packages using Ajv](#some-packages-using-ajv) -- [Tests, Contributing, Changes history](#tests) -- [Support, Code of conduct, License](#open-source-software-support) - - -## Performance - -Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. - -Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: - -- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place -- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster -- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) -- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) - - -Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): - -[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) - - -## Features - -- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards: - - all validation keywords (see [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md)) - - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) - - support of circular references between schemas - - correct string lengths for strings with unicode pairs (can be turned off) - - [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off) - - [validates schemas against meta-schema](#api-validateschema) -- supports [browsers](#using-in-browser) and Node.js 0.10-14.x -- [asynchronous loading](#asynchronous-schema-compilation) of referenced schemas during compilation -- "All errors" validation mode with [option allErrors](#options) -- [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages -- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package -- [filtering data](#filtering-data) from additional properties -- [assigning defaults](#assigning-defaults) to missing properties and items -- [coercing data](#coercing-data-types) to the types specified in `type` keywords -- [custom keywords](#defining-custom-keywords) -- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` -- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). -- keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package -- [$data reference](#data-reference) to use values from the validated data as values for the schema keywords -- [asynchronous validation](#asynchronous-validation) of custom formats and keywords - - -## Install - -``` -npm install ajv -``` - - -## Getting started - -Try it in the Node.js REPL: https://tonicdev.com/npm/ajv - - -The fastest validation call: - -```javascript -// Node.js require: -var Ajv = require('ajv'); -// or ESM/TypeScript import -import Ajv from 'ajv'; - -var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} -var validate = ajv.compile(schema); -var valid = validate(data); -if (!valid) console.log(validate.errors); -``` - -or with less code - -```javascript -// ... -var valid = ajv.validate(schema, data); -if (!valid) console.log(ajv.errors); -// ... -``` - -or - -```javascript -// ... -var valid = ajv.addSchema(schema, 'mySchema') - .validate('mySchema', data); -if (!valid) console.log(ajv.errorsText()); -// ... -``` - -See [API](#api) and [Options](#options) for more details. - -Ajv compiles schemas to functions and caches them in all cases (using schema serialized with [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) or a custom function as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. - -The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). - -__Please note__: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors) - -__Note for TypeScript users__: `ajv` provides its own TypeScript declarations -out of the box, so you don't need to install the deprecated `@types/ajv` -module. - - -## Using in browser - -You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle. - -If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)). - -Then you need to load Ajv in the browser: -```html - -``` - -This bundle can be used with different module systems; it creates global `Ajv` if no module system is found. - -The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). - -Ajv is tested with these browsers: - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) - -__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)). - - -### Ajv and Content Security Policies (CSP) - -If you're using Ajv to compile a schema (the typical use) in a browser document that is loaded with a Content Security Policy (CSP), that policy will require a `script-src` directive that includes the value `'unsafe-eval'`. -:warning: NOTE, however, that `unsafe-eval` is NOT recommended in a secure CSP[[1]](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval), as it has the potential to open the document to cross-site scripting (XSS) attacks. - -In order to make use of Ajv without easing your CSP, you can [pre-compile a schema using the CLI](https://github.com/ajv-validator/ajv-cli#compile-schemas). This will transpile the schema JSON into a JavaScript file that exports a `validate` function that works simlarly to a schema compiled at runtime. - -Note that pre-compilation of schemas is performed using [ajv-pack](https://github.com/ajv-validator/ajv-pack) and there are [some limitations to the schema features it can compile](https://github.com/ajv-validator/ajv-pack#limitations). A successfully pre-compiled schema is equivalent to the same schema compiled at runtime. - - -## Command line interface - -CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports: - -- compiling JSON Schemas to test their validity -- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/ajv-validator/ajv-pack)) -- migrate schemas to draft-07 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate)) -- validating data file(s) against JSON Schema -- testing expected validity of data against JSON Schema -- referenced schemas -- custom meta-schemas -- files in JSON, JSON5, YAML, and JavaScript format -- all Ajv options -- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format - - -## Validation keywords - -Ajv supports all validation keywords from draft-07 of JSON Schema standard: - -- [type](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#type) -- [for numbers](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf -- [for strings](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format -- [for arrays](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#contains) -- [for objects](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#propertynames) -- [for all types](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#const) -- [compound keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf, [if/then/else](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#ifthenelse) - -With [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON Schema standard: - -- [patternRequired](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match. -- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc. - -See [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md) for more details. - - -## Annotation keywords - -JSON Schema specification defines several annotation keywords that describe schema itself but do not perform any validation. - -- `title` and `description`: information about the data represented by that schema -- `$comment` (NEW in draft-07): information for developers. With option `$comment` Ajv logs or passes the comment string to the user-supplied function. See [Options](#options). -- `default`: a default value of the data instance, see [Assigning defaults](#assigning-defaults). -- `examples` (NEW in draft-06): an array of data instances. Ajv does not check the validity of these instances against the schema. -- `readOnly` and `writeOnly` (NEW in draft-07): marks data-instance as read-only or write-only in relation to the source of the data (database, api, etc.). -- `contentEncoding`: [RFC 2045](https://tools.ietf.org/html/rfc2045#section-6.1 ), e.g., "base64". -- `contentMediaType`: [RFC 2046](https://tools.ietf.org/html/rfc2046), e.g., "image/png". - -__Please note__: Ajv does not implement validation of the keywords `examples`, `contentEncoding` and `contentMediaType` but it reserves them. If you want to create a plugin that implements some of them, it should remove these keywords from the instance. - - -## Formats - -Ajv implements formats defined by JSON Schema specification and several other formats. It is recommended NOT to use "format" keyword implementations with untrusted data, as they use potentially unsafe regular expressions - see [ReDoS attack](#redos-attack). - -__Please note__: if you need to use "format" keyword to validate untrusted data, you MUST assess their suitability and safety for your validation scenarios. - -The following formats are implemented for string validation with "format" keyword: - -- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). -- _time_: time with optional time-zone. -- _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). -- _uri_: full URI. -- _uri-reference_: URI reference, including full and relative URIs. -- _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570) -- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url). -- _email_: email address. -- _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). -- _ipv4_: IP address v4. -- _ipv6_: IP address v6. -- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor. -- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122). -- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). -- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). - -__Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here. - -There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, and `email`. See [Options](#options) for details. - -You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. - -The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details. - -You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js). - - -## Combining schemas with $ref - -You can structure your validation logic across multiple schema files and have schemas reference each other using `$ref` keyword. - -Example: - -```javascript -var schema = { - "$id": "http://example.com/schemas/schema.json", - "type": "object", - "properties": { - "foo": { "$ref": "defs.json#/definitions/int" }, - "bar": { "$ref": "defs.json#/definitions/str" } - } -}; - -var defsSchema = { - "$id": "http://example.com/schemas/defs.json", - "definitions": { - "int": { "type": "integer" }, - "str": { "type": "string" } - } -}; -``` - -Now to compile your schema you can either pass all schemas to Ajv instance: - -```javascript -var ajv = new Ajv({schemas: [schema, defsSchema]}); -var validate = ajv.getSchema('http://example.com/schemas/schema.json'); -``` - -or use `addSchema` method: - -```javascript -var ajv = new Ajv; -var validate = ajv.addSchema(defsSchema) - .compile(schema); -``` - -See [Options](#options) and [addSchema](#api) method. - -__Please note__: -- `$ref` is resolved as the uri-reference using schema $id as the base URI (see the example). -- References can be recursive (and mutually recursive) to implement the schemas for different data structures (such as linked lists, trees, graphs, etc.). -- You don't have to host your schema files at the URIs that you use as schema $id. These URIs are only used to identify the schemas, and according to JSON Schema specification validators should not expect to be able to download the schemas from these URIs. -- The actual location of the schema file in the file system is not used. -- You can pass the identifier of the schema as the second parameter of `addSchema` method or as a property name in `schemas` option. This identifier can be used instead of (or in addition to) schema $id. -- You cannot have the same $id (or the schema identifier) used for more than one schema - the exception will be thrown. -- You can implement dynamic resolution of the referenced schemas using `compileAsync` method. In this way you can store schemas in any system (files, web, database, etc.) and reference them without explicitly adding to Ajv instance. See [Asynchronous schema compilation](#asynchronous-schema-compilation). - - -## $data reference - -With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema-org/json-schema-spec/issues/51) for more information about how it works. - -`$data` reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. - -The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema). - -Examples. - -This schema requires that the value in property `smaller` is less or equal than the value in the property larger: - -```javascript -var ajv = new Ajv({$data: true}); - -var schema = { - "properties": { - "smaller": { - "type": "number", - "maximum": { "$data": "1/larger" } - }, - "larger": { "type": "number" } - } -}; - -var validData = { - smaller: 5, - larger: 7 -}; - -ajv.validate(schema, validData); // true -``` - -This schema requires that the properties have the same format as their field names: - -```javascript -var schema = { - "additionalProperties": { - "type": "string", - "format": { "$data": "0#" } - } -}; - -var validData = { - 'date-time': '1963-06-19T08:30:06.283185Z', - email: 'joe.bloggs@example.com' -} -``` - -`$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `const` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails. - - -## $merge and $patch keywords - -With the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON Schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). - -To add keywords `$merge` and `$patch` to Ajv instance use this code: - -```javascript -require('ajv-merge-patch')(ajv); -``` - -Examples. - -Using `$merge`: - -```json -{ - "$merge": { - "source": { - "type": "object", - "properties": { "p": { "type": "string" } }, - "additionalProperties": false - }, - "with": { - "properties": { "q": { "type": "number" } } - } - } -} -``` - -Using `$patch`: - -```json -{ - "$patch": { - "source": { - "type": "object", - "properties": { "p": { "type": "string" } }, - "additionalProperties": false - }, - "with": [ - { "op": "add", "path": "/properties/q", "value": { "type": "number" } } - ] - } -} -``` - -The schemas above are equivalent to this schema: - -```json -{ - "type": "object", - "properties": { - "p": { "type": "string" }, - "q": { "type": "number" } - }, - "additionalProperties": false -} -``` - -The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. - -See the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) for more information. - - -## Defining custom keywords - -The advantages of using custom keywords are: - -- allow creating validation scenarios that cannot be expressed using JSON Schema -- simplify your schemas -- help bringing a bigger part of the validation logic to your schemas -- make your schemas more expressive, less verbose and closer to your application domain -- implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated - -If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). - -The concerns you have to be aware of when extending JSON Schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. - -You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. - -Ajv allows defining keywords with: -- validation function -- compilation function -- macro function -- inline compilation function that should return code (as string) that will be inlined in the currently compiled schema. - -Example. `range` and `exclusiveRange` keywords using compiled schema: - -```javascript -ajv.addKeyword('range', { - type: 'number', - compile: function (sch, parentSchema) { - var min = sch[0]; - var max = sch[1]; - - return parentSchema.exclusiveRange === true - ? function (data) { return data > min && data < max; } - : function (data) { return data >= min && data <= max; } - } -}); - -var schema = { "range": [2, 4], "exclusiveRange": true }; -var validate = ajv.compile(schema); -console.log(validate(2.01)); // true -console.log(validate(3.99)); // true -console.log(validate(2)); // false -console.log(validate(4)); // false -``` - -Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. - -See [Defining custom keywords](https://github.com/ajv-validator/ajv/blob/master/CUSTOM.md) for more details. - - -## Asynchronous schema compilation - -During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` [method](#api-compileAsync) and `loadSchema` [option](#options). - -Example: - -```javascript -var ajv = new Ajv({ loadSchema: loadSchema }); - -ajv.compileAsync(schema).then(function (validate) { - var valid = validate(data); - // ... -}); - -function loadSchema(uri) { - return request.json(uri).then(function (res) { - if (res.statusCode >= 400) - throw new Error('Loading error: ' + res.statusCode); - return res.body; - }); -} -``` - -__Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work. - - -## Asynchronous validation - -Example in Node.js REPL: https://tonicdev.com/esp/ajv-asynchronous-validation - -You can define custom formats and keywords that perform validation asynchronously by accessing database or some other service. You should add `async: true` in the keyword or format definition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)). - -If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation. - -__Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. - -Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). - -Ajv compiles asynchronous schemas to [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent). Async functions are supported in Node.js 7+ and all modern browsers. You can also supply any other transpiler as a function via `processCode` option. See [Options](#options). - -The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas. - -Validation result will be a promise that resolves with validated data or rejects with an exception `Ajv.ValidationError` that contains the array of validation errors in `errors` property. - - -Example: - -```javascript -var ajv = new Ajv; -// require('ajv-async')(ajv); - -ajv.addKeyword('idExists', { - async: true, - type: 'number', - validate: checkIdExists -}); - - -function checkIdExists(schema, data) { - return knex(schema.table) - .select('id') - .where('id', data) - .then(function (rows) { - return !!rows.length; // true if record is found - }); -} - -var schema = { - "$async": true, - "properties": { - "userId": { - "type": "integer", - "idExists": { "table": "users" } - }, - "postId": { - "type": "integer", - "idExists": { "table": "posts" } - } - } -}; - -var validate = ajv.compile(schema); - -validate({ userId: 1, postId: 19 }) -.then(function (data) { - console.log('Data is valid', data); // { userId: 1, postId: 19 } -}) -.catch(function (err) { - if (!(err instanceof Ajv.ValidationError)) throw err; - // data is invalid - console.log('Validation errors:', err.errors); -}); -``` - -### Using transpilers with asynchronous validation functions. - -[ajv-async](https://github.com/ajv-validator/ajv-async) uses [nodent](https://github.com/MatAtBread/nodent) to transpile async functions. To use another transpiler you should separately install it (or load its bundle in the browser). - - -#### Using nodent - -```javascript -var ajv = new Ajv; -require('ajv-async')(ajv); -// in the browser if you want to load ajv-async bundle separately you can: -// window.ajvAsync(ajv); -var validate = ajv.compile(schema); // transpiled es7 async function -validate(data).then(successFunc).catch(errorFunc); -``` - - -#### Using other transpilers - -```javascript -var ajv = new Ajv({ processCode: transpileFunc }); -var validate = ajv.compile(schema); // transpiled es7 async function -validate(data).then(successFunc).catch(errorFunc); -``` - -See [Options](#options). - - -## Security considerations - -JSON Schema, if properly used, can replace data sanitisation. It doesn't replace other API security considerations. It also introduces additional security aspects to consider. - - -##### Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. - - -##### Untrusted schemas - -Ajv treats JSON schemas as trusted as your application code. This security model is based on the most common use case, when the schemas are static and bundled together with the application. - -If your schemas are received from untrusted sources (or generated from untrusted data) there are several scenarios you need to prevent: -- compiling schemas can cause stack overflow (if they are too deep) -- compiling schemas can be slow (e.g. [#557](https://github.com/ajv-validator/ajv/issues/557)) -- validating certain data can be slow - -It is difficult to predict all the scenarios, but at the very least it may help to limit the size of untrusted schemas (e.g. limit JSON string length) and also the maximum schema object depth (that can be high for relatively small JSON strings). You also may want to mitigate slow regular expressions in `pattern` and `patternProperties` keywords. - -Regardless the measures you take, using untrusted schemas increases security risks. - - -##### Circular references in JavaScript objects - -Ajv does not support schemas and validated data that have circular references in objects. See [issue #802](https://github.com/ajv-validator/ajv/issues/802). - -An attempt to compile such schemas or validate such data would cause stack overflow (or will not complete in case of asynchronous validation). Depending on the parser you use, untrusted data can lead to circular references. - - -##### Security risks of trusted schemas - -Some keywords in JSON Schemas can lead to very slow validation for certain data. These keywords include (but may be not limited to): - -- `pattern` and `format` for large strings - in some cases using `maxLength` can help mitigate it, but certain regular expressions can lead to exponential validation time even with relatively short strings (see [ReDoS attack](#redos-attack)). -- `patternProperties` for large property names - use `propertyNames` to mitigate, but some regular expressions can have exponential evaluation time as well. -- `uniqueItems` for large non-scalar arrays - use `maxItems` to mitigate - -__Please note__: The suggestions above to prevent slow validation would only work if you do NOT use `allErrors: true` in production code (using it would continue validation after validation errors). - -You can validate your JSON schemas against [this meta-schema](https://github.com/ajv-validator/ajv/blob/master/lib/refs/json-schema-secure.json) to check that these recommendations are followed: - -```javascript -const isSchemaSecure = ajv.compile(require('ajv/lib/refs/json-schema-secure.json')); - -const schema1 = {format: 'email'}; -isSchemaSecure(schema1); // false - -const schema2 = {format: 'email', maxLength: MAX_LENGTH}; -isSchemaSecure(schema2); // true -``` - -__Please note__: following all these recommendation is not a guarantee that validation of untrusted data is safe - it can still lead to some undesirable results. - - -##### Content Security Policies (CSP) -See [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) - - -## ReDoS attack - -Certain regular expressions can lead to the exponential evaluation time even with relatively short strings. - -Please assess the regular expressions you use in the schemas on their vulnerability to this attack - see [safe-regex](https://github.com/substack/safe-regex), for example. - -__Please note__: some formats that Ajv implements use [regular expressions](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js) that can be vulnerable to ReDoS attack, so if you use Ajv to validate data from untrusted sources __it is strongly recommended__ to consider the following: - -- making assessment of "format" implementations in Ajv. -- using `format: 'fast'` option that simplifies some of the regular expressions (although it does not guarantee that they are safe). -- replacing format implementations provided by Ajv with your own implementations of "format" keyword that either uses different regular expressions or another approach to format validation. Please see [addFormat](#api-addformat) method. -- disabling format validation by ignoring "format" keyword with option `format: false` - -Whatever mitigation you choose, please assume all formats provided by Ajv as potentially unsafe and make your own assessment of their suitability for your validation scenarios. - - -## Filtering data - -With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation. - -This option modifies original data. - -Example: - -```javascript -var ajv = new Ajv({ removeAdditional: true }); -var schema = { - "additionalProperties": false, - "properties": { - "foo": { "type": "number" }, - "bar": { - "additionalProperties": { "type": "number" }, - "properties": { - "baz": { "type": "string" } - } - } - } -} - -var data = { - "foo": 0, - "additional1": 1, // will be removed; `additionalProperties` == false - "bar": { - "baz": "abc", - "additional2": 2 // will NOT be removed; `additionalProperties` != false - }, -} - -var validate = ajv.compile(schema); - -console.log(validate(data)); // true -console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 } -``` - -If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed. - -If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed). - -__Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example: - -```json -{ - "type": "object", - "oneOf": [ - { - "properties": { - "foo": { "type": "string" } - }, - "required": [ "foo" ], - "additionalProperties": false - }, - { - "properties": { - "bar": { "type": "integer" } - }, - "required": [ "bar" ], - "additionalProperties": false - } - ] -} -``` - -The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties. - -With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). - -While this behaviour is unexpected (issues [#129](https://github.com/ajv-validator/ajv/issues/129), [#134](https://github.com/ajv-validator/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: - -```json -{ - "type": "object", - "properties": { - "foo": { "type": "string" }, - "bar": { "type": "integer" } - }, - "additionalProperties": false, - "oneOf": [ - { "required": [ "foo" ] }, - { "required": [ "bar" ] } - ] -} -``` - -The schema above is also more efficient - it will compile into a faster function. - - -## Assigning defaults - -With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. - -With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults. - -This option modifies original data. - -__Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema. - - -Example 1 (`default` in `properties`): - -```javascript -var ajv = new Ajv({ useDefaults: true }); -var schema = { - "type": "object", - "properties": { - "foo": { "type": "number" }, - "bar": { "type": "string", "default": "baz" } - }, - "required": [ "foo", "bar" ] -}; - -var data = { "foo": 1 }; - -var validate = ajv.compile(schema); - -console.log(validate(data)); // true -console.log(data); // { "foo": 1, "bar": "baz" } -``` - -Example 2 (`default` in `items`): - -```javascript -var schema = { - "type": "array", - "items": [ - { "type": "number" }, - { "type": "string", "default": "foo" } - ] -} - -var data = [ 1 ]; - -var validate = ajv.compile(schema); - -console.log(validate(data)); // true -console.log(data); // [ 1, "foo" ] -``` - -`default` keywords in other cases are ignored: - -- not in `properties` or `items` subschemas -- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/ajv-validator/ajv/issues/42)) -- in `if` subschema of `switch` keyword -- in schemas generated by custom macro keywords - -The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning). - - -## Coercing data types - -When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards. - -This option modifies original data. - -__Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value. - - -Example 1: - -```javascript -var ajv = new Ajv({ coerceTypes: true }); -var schema = { - "type": "object", - "properties": { - "foo": { "type": "number" }, - "bar": { "type": "boolean" } - }, - "required": [ "foo", "bar" ] -}; - -var data = { "foo": "1", "bar": "false" }; - -var validate = ajv.compile(schema); - -console.log(validate(data)); // true -console.log(data); // { "foo": 1, "bar": false } -``` - -Example 2 (array coercions): - -```javascript -var ajv = new Ajv({ coerceTypes: 'array' }); -var schema = { - "properties": { - "foo": { "type": "array", "items": { "type": "number" } }, - "bar": { "type": "boolean" } - } -}; - -var data = { "foo": "1", "bar": ["false"] }; - -var validate = ajv.compile(schema); - -console.log(validate(data)); // true -console.log(data); // { "foo": [1], "bar": false } -``` - -The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). - -See [Coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md) for details. - - -## API - -##### new Ajv(Object options) -> Object - -Create Ajv instance. - - -##### .compile(Object schema) -> Function<Object data> - -Generate validating function and cache the compiled schema for future use. - -Validating function returns a boolean value. This function has properties `errors` and `schema`. Errors encountered during the last validation are assigned to `errors` property (it is assigned `null` if there was no errors). `schema` property contains the reference to the original schema. - -The schema passed to this method will be validated against meta-schema unless `validateSchema` option is false. If schema is invalid, an error will be thrown. See [options](#options). - - -##### .compileAsync(Object schema [, Boolean meta] [, Function callback]) -> Promise - -Asynchronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. This function returns a Promise that resolves to a validation function. An optional callback passed to `compileAsync` will be called with 2 parameters: error (or null) and validating function. The returned promise will reject (and the callback will be called with an error) when: - -- missing schema can't be loaded (`loadSchema` returns a Promise that rejects). -- a schema containing a missing reference is loaded, but the reference cannot be resolved. -- schema (or some loaded/referenced schema) is invalid. - -The function compiles schema and loads the first missing schema (or meta-schema) until all missing schemas are loaded. - -You can asynchronously compile meta-schema by passing `true` as the second parameter. - -See example in [Asynchronous compilation](#asynchronous-schema-compilation). - - -##### .validate(Object schema|String key|String ref, data) -> Boolean - -Validate data using passed schema (it will be compiled and cached). - -Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference. - -Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors). - -__Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later. - -If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation). - - -##### .addSchema(Array<Object>|Object schema [, String key]) -> Ajv - -Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole. - -Array of schemas can be passed (schemas should have ids), the second parameter will be ignored. - -Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key. - - -Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data. - -Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time. - -By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option. - -__Please note__: Ajv uses the [method chaining syntax](https://en.wikipedia.org/wiki/Method_chaining) for all methods with the prefix `add*` and `remove*`. -This allows you to do nice things like the following. - -```javascript -var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri); -``` - -##### .addMetaSchema(Array<Object>|Object schema [, String key]) -> Ajv - -Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). - -There is no need to explicitly add draft-07 meta schema (http://json-schema.org/draft-07/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. - - -##### .validateSchema(Object schema) -> Boolean - -Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON Schema standard. - -By default this method is called automatically when the schema is added, so you rarely need to use it directly. - -If schema doesn't have `$schema` property, it is validated against draft 6 meta-schema (option `meta` should not be false). - -If schema has `$schema` property, then the schema with this id (that should be previously added) is used to validate passed schema. - -Errors will be available at `ajv.errors`. - - -##### .getSchema(String key) -> Function<Object data> - -Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). The returned validating function has `schema` property with the reference to the original schema. - - -##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) -> Ajv - -Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. - -Schema can be removed using: -- key passed to `addSchema` -- it's full reference (id) -- RegExp that should match schema id or key (meta-schemas won't be removed) -- actual schema object that will be stable-stringified to remove schema from cache - -If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared. - - -##### .addFormat(String name, String|RegExp|Function|Object format) -> Ajv - -Add custom format to validate strings or numbers. It can also be used to replace pre-defined formats for Ajv instance. - -Strings are converted to RegExp. - -Function should return validation result as `true` or `false`. - -If object is passed it should have properties `validate`, `compare` and `async`: - -- _validate_: a string, RegExp or a function as described above. -- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. -- _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. -- _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/ajv-validator/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass. - -Custom formats can be also added via `formats` option. - - -##### .addKeyword(String keyword, Object definition) -> Ajv - -Add custom validation keyword to Ajv instance. - -Keyword should be different from all standard JSON Schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. - -Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. -It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. - -Example Keywords: -- `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. -- `"example"`: valid, but not recommended as it could collide with future versions of JSON Schema etc. -- `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword - -Keyword definition is an object with the following properties: - -- _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types. -- _validate_: validating function -- _compile_: compiling function -- _macro_: macro function -- _inline_: compiling function that returns code (as string) -- _schema_: an optional `false` value used with "validate" keyword to not pass schema -- _metaSchema_: an optional meta-schema for keyword schema -- _dependencies_: an optional list of properties that must be present in the parent schema - it will be checked during schema compilation -- _modifying_: `true` MUST be passed if keyword modifies data -- _statements_: `true` can be passed in case inline keyword generates statements (as opposed to expression) -- _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. -- _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). -- _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. -- _errors_: an optional boolean or string `"full"` indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. - -_compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. - -__Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed. - -See [Defining custom keywords](#defining-custom-keywords) for more details. - - -##### .getKeyword(String keyword) -> Object|Boolean - -Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown. - - -##### .removeKeyword(String keyword) -> Ajv - -Removes custom or pre-defined keyword so you can redefine them. - -While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results. - -__Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again. - - -##### .errorsText([Array<Object> errors [, Object options]]) -> String - -Returns the text with all errors in a String. - -Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default). - - -## Options - -Defaults: - -```javascript -{ - // validation and reporting options: - $data: false, - allErrors: false, - verbose: false, - $comment: false, // NEW in Ajv version 6.0 - jsonPointers: false, - uniqueItems: true, - unicode: true, - nullable: false, - format: 'fast', - formats: {}, - unknownFormats: true, - schemas: {}, - logger: undefined, - // referenced schema options: - schemaId: '$id', - missingRefs: true, - extendRefs: 'ignore', // recommended 'fail' - loadSchema: undefined, // function(uri: string): Promise {} - // options to modify validated data: - removeAdditional: false, - useDefaults: false, - coerceTypes: false, - // strict mode options - strictDefaults: false, - strictKeywords: false, - strictNumbers: false, - // asynchronous validation options: - transpile: undefined, // requires ajv-async package - // advanced options: - meta: true, - validateSchema: true, - addUsedSchema: true, - inlineRefs: true, - passContext: false, - loopRequired: Infinity, - ownProperties: false, - multipleOfPrecision: false, - errorDataPath: 'object', // deprecated - messages: true, - sourceCode: false, - processCode: undefined, // function (str: string, schema: object): string {} - cache: new Cache, - serialize: undefined -} -``` - -##### Validation and reporting options - -- _$data_: support [$data references](#data-reference). Draft 6 meta-schema that is added by default will be extended to allow them. If you want to use another meta-schema you need to use $dataMetaSchema method to add support for $data reference. See [API](#api). -- _allErrors_: check all rules collecting all errors. Default is to return after the first error. -- _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). -- _$comment_ (NEW in Ajv version 6.0): log or pass the value of `$comment` keyword to a function. Option values: - - `false` (default): ignore $comment keyword. - - `true`: log the keyword value to console. - - function: pass the keyword value, its schema path and root schema to the specified function -- _jsonPointers_: set `dataPath` property of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. -- _uniqueItems_: validate `uniqueItems` keyword (true by default). -- _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. -- _nullable_: support keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). -- _format_: formats validation mode. Option values: - - `"fast"` (default) - simplified and fast validation (see [Formats](#formats) for details of which formats are available and affected by this option). - - `"full"` - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. - - `false` - ignore all format keywords. -- _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. -- _keywords_: an object with custom keywords. Keys and values will be passed to `addKeyword` method. -- _unknownFormats_: handling of unknown formats. Option values: - - `true` (default) - if an unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [$data reference](#data-reference) and it is unknown the validation will fail. - - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail. - - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON Schema specification. -- _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object. -- _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](#error-logging). Option values: - - custom logger - it should have methods `log`, `warn` and `error`. If any of these methods is missing an exception will be thrown. - - `false` - logging is disabled. - - -##### Referenced schema options - -- _schemaId_: this option defines which keywords are used as schema URI. Option value: - - `"$id"` (default) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06/07), ignore `id` keyword (if it is present a warning will be logged). - - `"id"` - only use `id` keyword as schema URI (as specified in JSON Schema draft-04), ignore `$id` keyword (if it is present a warning will be logged). - - `"auto"` - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation. -- _missingRefs_: handling of missing referenced schemas. Option values: - - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). - - `"ignore"` - to log error during compilation and always pass validation. - - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked. -- _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values: - - `"ignore"` (default) - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation. - - `"fail"` (recommended) - if other validation keywords are used together with `$ref` the exception will be thrown when the schema is compiled. This option is recommended to make sure schema has no keywords that are ignored, which can be confusing. - - `true` - validate all keywords in the schemas with `$ref` (the default behaviour in versions before 5.0.0). -- _loadSchema_: asynchronous function that will be used to load remote schemas when `compileAsync` [method](#api-compileAsync) is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept remote schema uri as a parameter and return a Promise that resolves to a schema. See example in [Asynchronous compilation](#asynchronous-schema-compilation). - - -##### Options to modify validated data - -- _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values: - - `false` (default) - not to remove additional properties - - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). - - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. - - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). -- _useDefaults_: replace missing or undefined properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: - - `false` (default) - do not use defaults - - `true` - insert defaults by value (object literal is used). - - `"empty"` - in addition to missing or undefined, use defaults for properties and items that are equal to `null` or `""` (an empty string). - - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. -- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md). Option values: - - `false` (default) - no type coercion. - - `true` - coerce scalar data types. - - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). - - -##### Strict mode options - -- _strictDefaults_: report ignored `default` keywords in schemas. Option values: - - `false` (default) - ignored defaults are not reported - - `true` - if an ignored default is present, throw an error - - `"log"` - if an ignored default is present, log warning -- _strictKeywords_: report unknown keywords in schemas. Option values: - - `false` (default) - unknown keywords are not reported - - `true` - if an unknown keyword is present, throw an error - - `"log"` - if an unknown keyword is present, log warning -- _strictNumbers_: validate numbers strictly, failing validation for NaN and Infinity. Option values: - - `false` (default) - NaN or Infinity will pass validation for numeric types - - `true` - NaN or Infinity will not pass validation for numeric types - -##### Asynchronous validation options - -- _transpile_: Requires [ajv-async](https://github.com/ajv-validator/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: - - `undefined` (default) - transpile with [nodent](https://github.com/MatAtBread/nodent) if async functions are not supported. - - `true` - always transpile with nodent. - - `false` - do not transpile; if async functions are not supported an exception will be thrown. - - -##### Advanced options - -- _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. -- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can be http://json-schema.org/draft-07/schema or absent (draft-07 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: - - `true` (default) - if the validation fails, throw the exception. - - `"log"` - if the validation fails, log error. - - `false` - skip schema validation. -- _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `$id` (or `id`) property that doesn't start with "#". If `$id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `$id` uniqueness check when these methods are used. This option does not affect `addSchema` method. -- _inlineRefs_: Affects compilation of referenced schemas. Option values: - - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions. - - `false` - to not inline referenced schemas (they will be compiled as separate functions). - - integer number - to limit the maximum number of keywords of the schema that will be inlined. -- _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. -- _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. -- _ownProperties_: by default Ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. -- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/ajv-validator/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). -- _errorDataPath_ (deprecated): set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. -- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n)). -- _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). -- _processCode_: an optional function to process generated code before it is passed to Function constructor. It can be used to either beautify (the validating function is generated without line-breaks) or to transpile code. Starting from version 5.0.0 this option replaced options: - - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass a function calling `require('js-beautify').js_beautify` as `processCode: code => js_beautify(code)`. - - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/ajv-validator/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information. -- _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. -- _serialize_: an optional function to serialize schema to cache key. Pass `false` to use schema itself as a key (e.g., if WeakMap used as a cache). By default [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used. - - -## Validation errors - -In case of validation failure, Ajv assigns the array of errors to `errors` property of validation function (or to `errors` property of Ajv instance when `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation), the returned promise is rejected with exception `Ajv.ValidationError` that has `errors` property. - - -### Error objects - -Each error is an object with the following properties: - -- _keyword_: validation keyword. -- _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). -- _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. -- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package). See below for parameters set by all keywords. -- _message_: the standard error message (can be excluded with option `messages` set to false). -- _schema_: the schema of the keyword (added with `verbose` option). -- _parentSchema_: the schema containing the keyword (added with `verbose` option) -- _data_: the data validated by the keyword (added with `verbose` option). - -__Please note__: `propertyNames` keyword schema validation errors have an additional property `propertyName`, `dataPath` points to the object. After schema validation for each property name, if it is invalid an additional error is added with the property `keyword` equal to `"propertyNames"`. - - -### Error parameters - -Properties of `params` object in errors depend on the keyword that failed validation. - -- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword). -- `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false). -- `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords). -- `dependencies` - properties: - - `property` (dependent property), - - `missingProperty` (required missing dependency - only the first one is reported currently) - - `deps` (required dependencies, comma separated list as a string), - - `depsCount` (the number of required dependencies). -- `format` - property `format` (the schema of the keyword). -- `maximum`, `minimum` - properties: - - `limit` (number, the schema of the keyword), - - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`), - - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=") -- `multipleOf` - property `multipleOf` (the schema of the keyword) -- `pattern` - property `pattern` (the schema of the keyword) -- `required` - property `missingProperty` (required property that is missing). -- `propertyNames` - property `propertyName` (an invalid property name). -- `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property). -- `type` - property `type` (required type(s), a string, can be a comma-separated list) -- `uniqueItems` - properties `i` and `j` (indices of duplicate items). -- `const` - property `allowedValue` pointing to the value (the schema of the keyword). -- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). -- `$ref` - property `ref` with the referenced schema URI. -- `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes). -- custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). - - -### Error logging - -Using the `logger` option when initiallizing Ajv will allow you to define custom logging. Here you can build upon the exisiting logging. The use of other logging packages is supported as long as the package or its associated wrapper exposes the required methods. If any of the required methods are missing an exception will be thrown. -- **Required Methods**: `log`, `warn`, `error` - -```javascript -var otherLogger = new OtherLogger(); -var ajv = new Ajv({ - logger: { - log: console.log.bind(console), - warn: function warn() { - otherLogger.logWarn.apply(otherLogger, arguments); - }, - error: function error() { - otherLogger.logError.apply(otherLogger, arguments); - console.error.apply(console, arguments); - } - } -}); -``` - - -## Plugins - -Ajv can be extended with plugins that add custom keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: - -- it exports a function -- this function accepts ajv instance as the first parameter and returns the same instance to allow chaining -- this function can accept an optional configuration as the second parameter - -If you have published a useful plugin please submit a PR to add it to the next section. - - -## Related packages - -- [ajv-async](https://github.com/ajv-validator/ajv-async) - plugin to configure async validation mode -- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats -- [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface -- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for custom error messages -- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages -- [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas -- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.) -- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch -- [ajv-pack](https://github.com/ajv-validator/ajv-pack) - produces a compact module exporting validation functions -- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't already included in ajv (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`). - -## Some packages using Ajv - -- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser -- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services -- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition -- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator -- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org -- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com -- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js -- [table](https://github.com/gajus/table) - formats data into a string table -- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser -- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content -- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation -- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation -- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages -- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema -- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests -- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema -- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file -- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app -- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter -- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages -- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX - - -## Tests - -``` -npm install -git submodule update --init -npm test -``` - -## Contributing - -All validation functions are generated using doT templates in [dot](https://github.com/ajv-validator/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. - -`npm run build` - compiles templates to [dotjs](https://github.com/ajv-validator/ajv/tree/master/lib/dotjs) folder. - -`npm run watch` - automatically compiles templates when files in dot folder change - -Please see [Contributing guidelines](https://github.com/ajv-validator/ajv/blob/master/CONTRIBUTING.md) - - -## Changes history - -See https://github.com/ajv-validator/ajv/releases - -__Please note__: [Changes in version 7.0.0-beta](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) - -[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). - -## Code of conduct - -Please review and follow the [Code of conduct](https://github.com/ajv-validator/ajv/blob/master/CODE_OF_CONDUCT.md). - -Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. - - -## Open-source software support - -Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. - - -## License - -[MIT](https://github.com/ajv-validator/ajv/blob/master/LICENSE) diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/README.md b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/README.md deleted file mode 100644 index 4d994846c81f63..00000000000000 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -These files are compiled dot templates from dot folder. - -Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder. diff --git a/tools/node_modules/eslint/node_modules/ansi-colors/README.md b/tools/node_modules/eslint/node_modules/ansi-colors/README.md deleted file mode 100644 index dcdbcb503d083b..00000000000000 --- a/tools/node_modules/eslint/node_modules/ansi-colors/README.md +++ /dev/null @@ -1,315 +0,0 @@ -# ansi-colors [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/ansi-colors.svg?style=flat)](https://www.npmjs.com/package/ansi-colors) [![NPM monthly downloads](https://img.shields.io/npm/dm/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![NPM total downloads](https://img.shields.io/npm/dt/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![Linux Build Status](https://img.shields.io/travis/doowb/ansi-colors.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/ansi-colors) - -> Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs). - -Please consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save ansi-colors -``` - -![image](https://user-images.githubusercontent.com/383994/39635445-8a98a3a6-4f8b-11e8-89c1-068c45d4fff8.png) - -## Why use this? - -ansi-colors is _the fastest Node.js library for terminal styling_. A more performant drop-in replacement for chalk, with no dependencies. - -* _Blazing fast_ - Fastest terminal styling library in node.js, 10-20x faster than chalk! - -* _Drop-in replacement_ for [chalk](https://github.com/chalk/chalk). -* _No dependencies_ (Chalk has 7 dependencies in its tree!) - -* _Safe_ - Does not modify the `String.prototype` like [colors](https://github.com/Marak/colors.js). -* Supports [nested colors](#nested-colors), **and does not have the [nested styling bug](#nested-styling-bug) that is present in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur)**. -* Supports [chained colors](#chained-colors). -* [Toggle color support](#toggle-color-support) on or off. - -## Usage - -```js -const c = require('ansi-colors'); - -console.log(c.red('This is a red string!')); -console.log(c.green('This is a red string!')); -console.log(c.cyan('This is a cyan string!')); -console.log(c.yellow('This is a yellow string!')); -``` - -![image](https://user-images.githubusercontent.com/383994/39653848-a38e67da-4fc0-11e8-89ae-98c65ebe9dcf.png) - -## Chained colors - -```js -console.log(c.bold.red('this is a bold red message')); -console.log(c.bold.yellow.italic('this is a bold yellow italicized message')); -console.log(c.green.bold.underline('this is a bold green underlined message')); -``` - -![image](https://user-images.githubusercontent.com/383994/39635780-7617246a-4f8c-11e8-89e9-05216cc54e38.png) - -## Nested colors - -```js -console.log(c.yellow(`foo ${c.red.bold('red')} bar ${c.cyan('cyan')} baz`)); -``` - -![image](https://user-images.githubusercontent.com/383994/39635817-8ed93d44-4f8c-11e8-8afd-8c3ea35f5fbe.png) - -### Nested styling bug - -`ansi-colors` does not have the nested styling bug found in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur). - -```js -const { bold, red } = require('ansi-styles'); -console.log(bold(`foo ${red.dim('bar')} baz`)); - -const colorette = require('colorette'); -console.log(colorette.bold(`foo ${colorette.red(colorette.dim('bar'))} baz`)); - -const kleur = require('kleur'); -console.log(kleur.bold(`foo ${kleur.red.dim('bar')} baz`)); - -const chalk = require('chalk'); -console.log(chalk.bold(`foo ${chalk.red.dim('bar')} baz`)); -``` - -**Results in the following** - -(sans icons and labels) - -![image](https://user-images.githubusercontent.com/383994/47280326-d2ee0580-d5a3-11e8-9611-ea6010f0a253.png) - -## Toggle color support - -Easily enable/disable colors. - -```js -const c = require('ansi-colors'); - -// disable colors manually -c.enabled = false; - -// or use a library to automatically detect support -c.enabled = require('color-support').hasBasic; - -console.log(c.red('I will only be colored red if the terminal supports colors')); -``` - -## Strip ANSI codes - -Use the `.unstyle` method to strip ANSI codes from a string. - -```js -console.log(c.unstyle(c.blue.bold('foo bar baz'))); -//=> 'foo bar baz' -``` - -## Available styles - -**Note** that bright and bright-background colors are not always supported. - -| Colors | Background Colors | Bright Colors | Bright Background Colors | -| ------- | ----------------- | ------------- | ------------------------ | -| black | bgBlack | blackBright | bgBlackBright | -| red | bgRed | redBright | bgRedBright | -| green | bgGreen | greenBright | bgGreenBright | -| yellow | bgYellow | yellowBright | bgYellowBright | -| blue | bgBlue | blueBright | bgBlueBright | -| magenta | bgMagenta | magentaBright | bgMagentaBright | -| cyan | bgCyan | cyanBright | bgCyanBright | -| white | bgWhite | whiteBright | bgWhiteBright | -| gray | | | | -| grey | | | | - -_(`gray` is the U.S. spelling, `grey` is more commonly used in the Canada and U.K.)_ - -### Style modifiers - -* dim -* **bold** - -* hidden -* _italic_ - -* underline -* inverse -* ~~strikethrough~~ - -* reset - -## Aliases - -Create custom aliases for styles. - -```js -const colors = require('ansi-colors'); - -colors.alias('primary', colors.yellow); -colors.alias('secondary', colors.bold); - -console.log(colors.primary.secondary('Foo')); -``` - -## Themes - -A theme is an object of custom aliases. - -```js -const colors = require('ansi-colors'); - -colors.theme({ - danger: colors.red, - dark: colors.dim.gray, - disabled: colors.gray, - em: colors.italic, - heading: colors.bold.underline, - info: colors.cyan, - muted: colors.dim, - primary: colors.blue, - strong: colors.bold, - success: colors.green, - underline: colors.underline, - warning: colors.yellow -}); - -// Now, we can use our custom styles alongside the built-in styles! -console.log(colors.danger.strong.em('Error!')); -console.log(colors.warning('Heads up!')); -console.log(colors.info('Did you know...')); -console.log(colors.success.bold('It worked!')); -``` - -## Performance - -**Libraries tested** - -* ansi-colors v3.0.4 -* chalk v2.4.1 - -### Mac - -> MacBook Pro, Intel Core i7, 2.3 GHz, 16 GB. - -**Load time** - -Time it takes to load the first time `require()` is called: - -* ansi-colors - `1.915ms` -* chalk - `12.437ms` - -**Benchmarks** - -``` -# All Colors - ansi-colors x 173,851 ops/sec ±0.42% (91 runs sampled) - chalk x 9,944 ops/sec ±2.53% (81 runs sampled))) - -# Chained colors - ansi-colors x 20,791 ops/sec ±0.60% (88 runs sampled) - chalk x 2,111 ops/sec ±2.34% (83 runs sampled) - -# Nested colors - ansi-colors x 59,304 ops/sec ±0.98% (92 runs sampled) - chalk x 4,590 ops/sec ±2.08% (82 runs sampled) -``` - -### Windows - -> Windows 10, Intel Core i7-7700k CPU @ 4.2 GHz, 32 GB - -**Load time** - -Time it takes to load the first time `require()` is called: - -* ansi-colors - `1.494ms` -* chalk - `11.523ms` - -**Benchmarks** - -``` -# All Colors - ansi-colors x 193,088 ops/sec ±0.51% (95 runs sampled)) - chalk x 9,612 ops/sec ±3.31% (77 runs sampled))) - -# Chained colors - ansi-colors x 26,093 ops/sec ±1.13% (94 runs sampled) - chalk x 2,267 ops/sec ±2.88% (80 runs sampled)) - -# Nested colors - ansi-colors x 67,747 ops/sec ±0.49% (93 runs sampled) - chalk x 4,446 ops/sec ±3.01% (82 runs sampled)) -``` - -## About - -
-Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
- -
-Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
- -
-Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
- -### Related projects - -You might also be interested in these projects: - -* [ansi-wrap](https://www.npmjs.com/package/ansi-wrap): Create ansi colors by passing the open and close codes. | [homepage](https://github.com/jonschlinkert/ansi-wrap "Create ansi colors by passing the open and close codes.") -* [strip-color](https://www.npmjs.com/package/strip-color): Strip ANSI color codes from a string. No dependencies. | [homepage](https://github.com/jonschlinkert/strip-color "Strip ANSI color codes from a string. No dependencies.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 48 | [jonschlinkert](https://github.com/jonschlinkert) | -| 42 | [doowb](https://github.com/doowb) | -| 6 | [lukeed](https://github.com/lukeed) | -| 2 | [Silic0nS0ldier](https://github.com/Silic0nS0ldier) | -| 1 | [dwieeb](https://github.com/dwieeb) | -| 1 | [jorgebucaran](https://github.com/jorgebucaran) | -| 1 | [madhavarshney](https://github.com/madhavarshney) | -| 1 | [chapterjason](https://github.com/chapterjason) | - -### Author - -**Brian Woodward** - -* [GitHub Profile](https://github.com/doowb) -* [Twitter Profile](https://twitter.com/doowb) -* [LinkedIn Profile](https://linkedin.com/in/woodwardbrian) - -### License - -Copyright © 2019, [Brian Woodward](https://github.com/doowb). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 01, 2019._ \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/argparse/README.md b/tools/node_modules/eslint/node_modules/argparse/README.md deleted file mode 100644 index 550b5c9b7b00aa..00000000000000 --- a/tools/node_modules/eslint/node_modules/argparse/README.md +++ /dev/null @@ -1,84 +0,0 @@ -argparse -======== - -[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) -[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) - -CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)). - -**Difference with original.** - -- JS has no keyword arguments support. - - Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`. -- JS has no python's types `int`, `float`, ... - - Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`. -- `%r` format specifier uses `require('util').inspect()`. - -More details in [doc](./doc). - - -Example -------- - -`test.js` file: - -```javascript -#!/usr/bin/env node -'use strict'; - -const { ArgumentParser } = require('argparse'); -const { version } = require('./package.json'); - -const parser = new ArgumentParser({ - description: 'Argparse example' -}); - -parser.add_argument('-v', '--version', { action: 'version', version }); -parser.add_argument('-f', '--foo', { help: 'foo bar' }); -parser.add_argument('-b', '--bar', { help: 'bar foo' }); -parser.add_argument('--baz', { help: 'baz bar' }); - -console.dir(parser.parse_args()); -``` - -Display help: - -``` -$ ./test.js -h -usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] - -Argparse example - -optional arguments: - -h, --help show this help message and exit - -v, --version show program's version number and exit - -f FOO, --foo FOO foo bar - -b BAR, --bar BAR bar foo - --baz BAZ baz bar -``` - -Parse arguments: - -``` -$ ./test.js -f=3 --bar=4 --baz 5 -{ foo: '3', bar: '4', baz: '5' } -``` - - -API docs --------- - -Since this is a port with minimal divergence, there's no separate documentation. -Use original one instead, with notes about difference. - -1. [Original doc](https://docs.python.org/3.9/library/argparse.html). -2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html). -3. [Difference with python](./doc). - - -argparse for enterprise ------------------------ - -Available as part of the Tidelift Subscription - -The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/tools/node_modules/eslint/node_modules/balanced-match/README.md b/tools/node_modules/eslint/node_modules/balanced-match/README.md deleted file mode 100644 index d2a48b6b49f2cf..00000000000000 --- a/tools/node_modules/eslint/node_modules/balanced-match/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. diff --git a/tools/node_modules/eslint/node_modules/brace-expansion/README.md b/tools/node_modules/eslint/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e16409152..00000000000000 --- a/tools/node_modules/eslint/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. diff --git a/tools/node_modules/eslint/node_modules/browserslist/README.md b/tools/node_modules/eslint/node_modules/browserslist/README.md deleted file mode 100644 index b1cde150e40bee..00000000000000 --- a/tools/node_modules/eslint/node_modules/browserslist/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Browserslist [![Cult Of Martians][cult-img]][cult] - -Browserslist logo by Anton Lovchikov - -The config to share target browsers and Node.js versions between different -front-end tools. It is used in: - -* [Autoprefixer] -* [Babel] -* [postcss-preset-env] -* [eslint-plugin-compat] -* [stylelint-no-unsupported-browser-features] -* [postcss-normalize] -* [obsolete-webpack-plugin] - -All tools will find target browsers automatically, -when you add the following to `package.json`: - -```json - "browserslist": [ - "defaults", - "not IE 11", - "maintained node versions" - ] -``` - -Or in `.browserslistrc` config: - -```yaml -# Browsers that we support - -defaults -not IE 11 -maintained node versions -``` - -Developers set their version lists using queries like `last 2 versions` -to be free from updating versions manually. -Browserslist will use [`caniuse-lite`] with [Can I Use] data for this queries. - -Browserslist will take queries from tool option, -`browserslist` config, `.browserslistrc` config, -`browserslist` section in `package.json` or environment variables. - -[cult-img]: https://cultofmartians.com/assets/badges/badge.svg -[cult]: https://cultofmartians.com/done.html - - - Sponsored by Evil Martians - - -[stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features -[eslint-plugin-compat]: https://github.com/amilajack/eslint-plugin-compat -[Browserslist Example]: https://github.com/browserslist/browserslist-example -[postcss-preset-env]: https://github.com/jonathantneal/postcss-preset-env -[postcss-normalize]: https://github.com/jonathantneal/postcss-normalize -[`caniuse-lite`]: https://github.com/ben-eb/caniuse-lite -[Autoprefixer]: https://github.com/postcss/autoprefixer -[Can I Use]: https://caniuse.com/ -[Babel]: https://github.com/babel/babel/tree/master/packages/babel-preset-env -[obsolete-webpack-plugin]: https://github.com/ElemeFE/obsolete-webpack-plugin - -## Docs -Read **[full docs](https://github.com/browserslist/browserslist#readme)** on GitHub. diff --git a/tools/node_modules/eslint/node_modules/caniuse-lite/README.md b/tools/node_modules/eslint/node_modules/caniuse-lite/README.md deleted file mode 100644 index f4878abf43c45c..00000000000000 --- a/tools/node_modules/eslint/node_modules/caniuse-lite/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# caniuse-lite - -A smaller version of caniuse-db, with only the essentials! - -## Why? - -The full data behind [Can I use][1] is incredibly useful for any front end -developer, and on the website all of the details from the database are displayed -to the user. However in automated tools, [many of these fields go unused][2]; -it's not a problem for server side consumption but client side, the less -JavaScript that we send to the end user the better. - -caniuse-lite then, is a smaller dataset that keeps essential parts of the data -in a compact format. It does this in multiple ways, such as converting `null` -array entries into empty strings, representing support data as an integer rather -than a string, and using base62 references instead of longer human-readable -keys. - -This packed data is then reassembled (via functions exposed by this module) into -a larger format which is mostly compatible with caniuse-db, and so it can be -used as an almost drop-in replacement for caniuse-db for contexts where size on -disk is important; for example, usage in web browsers. The API differences are -very small and are detailed in the section below. - - -## API - -```js -import * as lite from 'caniuse-lite'; -``` - - -### `lite.agents` - -caniuse-db provides a full `data.json` file which contains all of the features -data. Instead of this large file, caniuse-lite provides this data subset -instead, which has the `browser`, `prefix`, `prefix_exceptions`, `usage_global` -and `versions` keys from the original. - -In addition, the subset contains the `release_date` key with release dates (as timestamps) for each version: -```json -{ - "release_date": { - "6": 998870400, - "7": 1161129600, - "8": 1237420800, - "9": 1300060800, - "10": 1346716800, - "11": 1381968000, - "5.5": 962323200 - } -} -``` - - -### `lite.feature(js)` - -The `feature` method takes a file from `data/features` and converts it into -something that more closely represents the `caniuse-db` format. Note that only -the `title`, `stats` and `status` keys are kept from the original data. - - -### `lite.features` - -The `features` index is provided as a way to query all of the features that -are listed in the `caniuse-db` dataset. Note that you will need to use the -`feature` method on values from this index to get a human-readable format. - - -### `lite.region(js)` - -The `region` method takes a file from `data/regions` and converts it into -something that more closely represents the `caniuse-db` format. Note that *only* -the usage data is exposed here (the `data` key in the original files). - - -## License - -The data in this repo is available for use under a CC BY 4.0 license -(http://creativecommons.org/licenses/by/4.0/). For attribution just mention -somewhere that the source is caniuse.com. If you have any questions about using -the data for your project please contact me here: http://a.deveria.com/contact - -[1]: http://caniuse.com/ -[2]: https://github.com/Fyrd/caniuse/issues/1827 - - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. diff --git a/tools/node_modules/eslint/node_modules/color-convert/README.md b/tools/node_modules/eslint/node_modules/color-convert/README.md deleted file mode 100644 index d4b08fc369948d..00000000000000 --- a/tools/node_modules/eslint/node_modules/color-convert/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# color-convert - -[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) - -Color-convert is a color conversion library for JavaScript and node. -It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): - -```js -var convert = require('color-convert'); - -convert.rgb.hsl(140, 200, 100); // [96, 48, 59] -convert.keyword.rgb('blue'); // [0, 0, 255] - -var rgbChannels = convert.rgb.channels; // 3 -var cmykChannels = convert.cmyk.channels; // 4 -var ansiChannels = convert.ansi16.channels; // 1 -``` - -# Install - -```console -$ npm install color-convert -``` - -# API - -Simply get the property of the _from_ and _to_ conversion that you're looking for. - -All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. - -All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). - -```js -var convert = require('color-convert'); - -// Hex to LAB -convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] -convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] - -// RGB to CMYK -convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] -convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] -``` - -### Arrays -All functions that accept multiple arguments also support passing an array. - -Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) - -```js -var convert = require('color-convert'); - -convert.rgb.hex(123, 45, 67); // '7B2D43' -convert.rgb.hex([123, 45, 67]); // '7B2D43' -``` - -## Routing - -Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). - -Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). - -# Contribute - -If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. - -# License -Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/tools/node_modules/eslint/node_modules/color-name/README.md b/tools/node_modules/eslint/node_modules/color-name/README.md deleted file mode 100644 index 932b979176f33b..00000000000000 --- a/tools/node_modules/eslint/node_modules/color-name/README.md +++ /dev/null @@ -1,11 +0,0 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - - diff --git a/tools/node_modules/eslint/node_modules/comment-parser/LICENSE b/tools/node_modules/eslint/node_modules/comment-parser/LICENSE new file mode 100644 index 00000000000000..c91d3e722ea663 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Sergii Iavorskyi + +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. \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/comment-parser/browser/index.js b/tools/node_modules/eslint/node_modules/comment-parser/browser/index.js new file mode 100644 index 00000000000000..a42c00baa33d4c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/browser/index.js @@ -0,0 +1,653 @@ +var CommentParser = (function (exports) { + 'use strict'; + + /** @deprecated */ + exports.Markers = void 0; + (function (Markers) { + Markers["start"] = "/**"; + Markers["nostart"] = "/***"; + Markers["delim"] = "*"; + Markers["end"] = "*/"; + })(exports.Markers || (exports.Markers = {})); + + function isSpace(source) { + return /^\s+$/.test(source); + } + function splitCR(source) { + const matches = source.match(/\r+$/); + return matches == null + ? ['', source] + : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)]; + } + function splitSpace(source) { + const matches = source.match(/^\s+/); + return matches == null + ? ['', source] + : [source.slice(0, matches[0].length), source.slice(matches[0].length)]; + } + function splitLines(source) { + return source.split(/\n/); + } + function seedBlock(block = {}) { + return Object.assign({ description: '', tags: [], source: [], problems: [] }, block); + } + function seedSpec(spec = {}) { + return Object.assign({ tag: '', name: '', type: '', optional: false, description: '', problems: [], source: [] }, spec); + } + function seedTokens(tokens = {}) { + return Object.assign({ start: '', delimiter: '', postDelimiter: '', tag: '', postTag: '', name: '', postName: '', type: '', postType: '', description: '', end: '', lineEnd: '' }, tokens); + } + /** + * Assures Block.tags[].source contains references to the Block.source items, + * using Block.source as a source of truth. This is a counterpart of rewireSpecs + * @param block parsed coments block + */ + function rewireSource(block) { + const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map()); + for (const spec of block.tags) { + spec.source = spec.source.map((line) => source.get(line.number)); + } + return block; + } + /** + * Assures Block.source contains references to the Block.tags[].source items, + * using Block.tags[].source as a source of truth. This is a counterpart of rewireSource + * @param block parsed coments block + */ + function rewireSpecs(block) { + const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map()); + block.source = block.source.map((line) => source.get(line.number) || line); + return block; + } + + const reTag = /^@\S+/; + /** + * Creates configured `Parser` + * @param {Partial} options + */ + function getParser$3({ fence = '```', } = {}) { + const fencer = getFencer(fence); + const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced; + return function parseBlock(source) { + // start with description section + const sections = [[]]; + let isFenced = false; + for (const line of source) { + if (reTag.test(line.tokens.description) && !isFenced) { + sections.push([line]); + } + else { + sections[sections.length - 1].push(line); + } + isFenced = toggleFence(line.tokens.description, isFenced); + } + return sections; + }; + } + function getFencer(fence) { + if (typeof fence === 'string') + return (source) => source.split(fence).length % 2 === 0; + return fence; + } + + function getParser$2({ startLine = 0, markers = exports.Markers, } = {}) { + let block = null; + let num = startLine; + return function parseSource(source) { + let rest = source; + const tokens = seedTokens(); + [tokens.lineEnd, rest] = splitCR(rest); + [tokens.start, rest] = splitSpace(rest); + if (block === null && + rest.startsWith(markers.start) && + !rest.startsWith(markers.nostart)) { + block = []; + tokens.delimiter = rest.slice(0, markers.start.length); + rest = rest.slice(markers.start.length); + [tokens.postDelimiter, rest] = splitSpace(rest); + } + if (block === null) { + num++; + return null; + } + const isClosed = rest.trimRight().endsWith(markers.end); + if (tokens.delimiter === '' && + rest.startsWith(markers.delim) && + !rest.startsWith(markers.end)) { + tokens.delimiter = markers.delim; + rest = rest.slice(markers.delim.length); + [tokens.postDelimiter, rest] = splitSpace(rest); + } + if (isClosed) { + const trimmed = rest.trimRight(); + tokens.end = rest.slice(trimmed.length - markers.end.length); + rest = trimmed.slice(0, -markers.end.length); + } + tokens.description = rest; + block.push({ number: num, source, tokens }); + num++; + if (isClosed) { + const result = block.slice(); + block = null; + return result; + } + return null; + }; + } + + function getParser$1({ tokenizers }) { + return function parseSpec(source) { + var _a; + let spec = seedSpec({ source }); + for (const tokenize of tokenizers) { + spec = tokenize(spec); + if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical) + break; + } + return spec; + }; + } + + /** + * Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token, + * and populates `spec.tag` + */ + function tagTokenizer() { + return (spec) => { + const { tokens } = spec.source[0]; + const match = tokens.description.match(/\s*(@(\S+))(\s*)/); + if (match === null) { + spec.problems.push({ + code: 'spec:tag:prefix', + message: 'tag should start with "@" symbol', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + tokens.tag = match[1]; + tokens.postTag = match[3]; + tokens.description = tokens.description.slice(match[0].length); + spec.tag = match[2]; + return spec; + }; + } + + /** + * Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description` + * tokens and populates Spec.type` + * + * @param {Spacing} spacing tells how to deal with a whitespace + * for type values going over multiple lines + */ + function typeTokenizer(spacing = 'compact') { + const join = getJoiner$1(spacing); + return (spec) => { + let curlies = 0; + let lines = []; + for (const [i, { tokens }] of spec.source.entries()) { + let type = ''; + if (i === 0 && tokens.description[0] !== '{') + return spec; + for (const ch of tokens.description) { + if (ch === '{') + curlies++; + if (ch === '}') + curlies--; + type += ch; + if (curlies === 0) + break; + } + lines.push([tokens, type]); + if (curlies === 0) + break; + } + if (curlies !== 0) { + spec.problems.push({ + code: 'spec:type:unpaired-curlies', + message: 'unpaired curlies', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + const parts = []; + const offset = lines[0][0].postDelimiter.length; + for (const [i, [tokens, type]] of lines.entries()) { + tokens.type = type; + if (i > 0) { + tokens.type = tokens.postDelimiter.slice(offset) + type; + tokens.postDelimiter = tokens.postDelimiter.slice(0, offset); + } + [tokens.postType, tokens.description] = splitSpace(tokens.description.slice(type.length)); + parts.push(tokens.type); + } + parts[0] = parts[0].slice(1); + parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1); + spec.type = join(parts); + return spec; + }; + } + const trim = (x) => x.trim(); + function getJoiner$1(spacing) { + if (spacing === 'compact') + return (t) => t.map(trim).join(''); + else if (spacing === 'preserve') + return (t) => t.join('\n'); + else + return spacing; + } + + const isQuoted = (s) => s && s.startsWith('"') && s.endsWith('"'); + /** + * Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens, + * and populates the `spec.name` + */ + function nameTokenizer() { + const typeEnd = (num, { tokens }, i) => tokens.type === '' ? num : i; + return (spec) => { + // look for the name in the line where {type} ends + const { tokens } = spec.source[spec.source.reduce(typeEnd, 0)]; + const source = tokens.description.trimLeft(); + const quotedGroups = source.split('"'); + // if it starts with quoted group, assume it is a literal + if (quotedGroups.length > 1 && + quotedGroups[0] === '' && + quotedGroups.length % 2 === 1) { + spec.name = quotedGroups[1]; + tokens.name = `"${quotedGroups[1]}"`; + [tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length)); + return spec; + } + let brackets = 0; + let name = ''; + let optional = false; + let defaultValue; + // assume name is non-space string or anything wrapped into brackets + for (const ch of source) { + if (brackets === 0 && isSpace(ch)) + break; + if (ch === '[') + brackets++; + if (ch === ']') + brackets--; + name += ch; + } + if (brackets !== 0) { + spec.problems.push({ + code: 'spec:name:unpaired-brackets', + message: 'unpaired brackets', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + const nameToken = name; + if (name[0] === '[' && name[name.length - 1] === ']') { + optional = true; + name = name.slice(1, -1); + const parts = name.split('='); + name = parts[0].trim(); + if (parts[1] !== undefined) + defaultValue = parts.slice(1).join('=').trim(); + if (name === '') { + spec.problems.push({ + code: 'spec:name:empty-name', + message: 'empty name', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + if (defaultValue === '') { + spec.problems.push({ + code: 'spec:name:empty-default', + message: 'empty default value', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + // has "=" and is not a string, except for "=>" + if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) { + spec.problems.push({ + code: 'spec:name:invalid-default', + message: 'invalid default value syntax', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + } + spec.optional = optional; + spec.name = name; + tokens.name = nameToken; + if (defaultValue !== undefined) + spec.default = defaultValue; + [tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length)); + return spec; + }; + } + + /** + * Makes no changes to `spec.lines[].tokens` but joins them into `spec.description` + * following given spacing srtategy + * @param {Spacing} spacing tells how to handle the whitespace + * @param {BlockMarkers} markers tells how to handle comment block delimitation + */ + function descriptionTokenizer(spacing = 'compact', markers = exports.Markers) { + const join = getJoiner(spacing); + return (spec) => { + spec.description = join(spec.source, markers); + return spec; + }; + } + function getJoiner(spacing) { + if (spacing === 'compact') + return compactJoiner; + if (spacing === 'preserve') + return preserveJoiner; + return spacing; + } + function compactJoiner(lines, markers = exports.Markers) { + return lines + .map(({ tokens: { description } }) => description.trim()) + .filter((description) => description !== '') + .join(' '); + } + const lineNo = (num, { tokens }, i) => tokens.type === '' ? num : i; + const getDescription = ({ tokens }) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) + + tokens.description; + function preserveJoiner(lines, markers = exports.Markers) { + if (lines.length === 0) + return ''; + // skip the opening line with no description + if (lines[0].tokens.description === '' && + lines[0].tokens.delimiter === markers.start) + lines = lines.slice(1); + // skip the closing line with no description + const lastLine = lines[lines.length - 1]; + if (lastLine !== undefined && + lastLine.tokens.description === '' && + lastLine.tokens.end.endsWith(markers.end)) + lines = lines.slice(0, -1); + // description starts at the last line of type definition + lines = lines.slice(lines.reduce(lineNo, 0)); + return lines.map(getDescription).join('\n'); + } + + function getParser({ startLine = 0, fence = '```', spacing = 'compact', markers = exports.Markers, tokenizers = [ + tagTokenizer(), + typeTokenizer(spacing), + nameTokenizer(), + descriptionTokenizer(spacing), + ], } = {}) { + if (startLine < 0 || startLine % 1 > 0) + throw new Error('Invalid startLine'); + const parseSource = getParser$2({ startLine, markers }); + const parseBlock = getParser$3({ fence }); + const parseSpec = getParser$1({ tokenizers }); + const joinDescription = getJoiner(spacing); + const notEmpty = (line) => line.tokens.description.trim() != ''; + return function (source) { + const blocks = []; + for (const line of splitLines(source)) { + const lines = parseSource(line); + if (lines === null) + continue; + if (lines.find(notEmpty) === undefined) + continue; + const sections = parseBlock(lines); + const specs = sections.slice(1).map(parseSpec); + blocks.push({ + description: joinDescription(sections[0], markers), + tags: specs, + source: lines, + problems: specs.reduce((acc, spec) => acc.concat(spec.problems), []), + }); + } + return blocks; + }; + } + + function join(tokens) { + return (tokens.start + + tokens.delimiter + + tokens.postDelimiter + + tokens.tag + + tokens.postTag + + tokens.type + + tokens.postType + + tokens.name + + tokens.postName + + tokens.description + + tokens.end + + tokens.lineEnd); + } + function getStringifier() { + return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n'); + } + + var __rest$2 = (window && window.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + const zeroWidth$1 = { + start: 0, + tag: 0, + type: 0, + name: 0, + }; + const getWidth = (markers = exports.Markers) => (w, { tokens: t }) => ({ + start: t.delimiter === markers.start ? t.start.length : w.start, + tag: Math.max(w.tag, t.tag.length), + type: Math.max(w.type, t.type.length), + name: Math.max(w.name, t.name.length), + }); + const space = (len) => ''.padStart(len, ' '); + function align$1(markers = exports.Markers) { + let intoTags = false; + let w; + function update(line) { + const tokens = Object.assign({}, line.tokens); + if (tokens.tag !== '') + intoTags = true; + const isEmpty = tokens.tag === '' && + tokens.name === '' && + tokens.type === '' && + tokens.description === ''; + // dangling '*/' + if (tokens.end === markers.end && isEmpty) { + tokens.start = space(w.start + 1); + return Object.assign(Object.assign({}, line), { tokens }); + } + switch (tokens.delimiter) { + case markers.start: + tokens.start = space(w.start); + break; + case markers.delim: + tokens.start = space(w.start + 1); + break; + default: + tokens.delimiter = ''; + tokens.start = space(w.start + 2); // compensate delimiter + } + if (!intoTags) { + tokens.postDelimiter = tokens.description === '' ? '' : ' '; + return Object.assign(Object.assign({}, line), { tokens }); + } + const nothingAfter = { + delim: false, + tag: false, + type: false, + name: false, + }; + if (tokens.description === '') { + nothingAfter.name = true; + tokens.postName = ''; + if (tokens.name === '') { + nothingAfter.type = true; + tokens.postType = ''; + if (tokens.type === '') { + nothingAfter.tag = true; + tokens.postTag = ''; + if (tokens.tag === '') { + nothingAfter.delim = true; + } + } + } + } + tokens.postDelimiter = nothingAfter.delim ? '' : ' '; + if (!nothingAfter.tag) + tokens.postTag = space(w.tag - tokens.tag.length + 1); + if (!nothingAfter.type) + tokens.postType = space(w.type - tokens.type.length + 1); + if (!nothingAfter.name) + tokens.postName = space(w.name - tokens.name.length + 1); + return Object.assign(Object.assign({}, line), { tokens }); + } + return (_a) => { + var { source } = _a, fields = __rest$2(_a, ["source"]); + w = source.reduce(getWidth(markers), Object.assign({}, zeroWidth$1)); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; + } + + var __rest$1 = (window && window.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + const pull = (offset) => (str) => str.slice(offset); + const push = (offset) => { + const space = ''.padStart(offset, ' '); + return (str) => str + space; + }; + function indent(pos) { + let shift; + const pad = (start) => { + if (shift === undefined) { + const offset = pos - start.length; + shift = offset > 0 ? push(offset) : pull(-offset); + } + return shift(start); + }; + const update = (line) => (Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { start: pad(line.tokens.start) }) })); + return (_a) => { + var { source } = _a, fields = __rest$1(_a, ["source"]); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; + } + + var __rest = (window && window.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + function crlf(ending) { + function update(line) { + return Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { lineEnd: ending === 'LF' ? '' : '\r' }) }); + } + return (_a) => { + var { source } = _a, fields = __rest(_a, ["source"]); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; + } + + function flow(...transforms) { + return (block) => transforms.reduce((block, t) => t(block), block); + } + + const zeroWidth = { + line: 0, + start: 0, + delimiter: 0, + postDelimiter: 0, + tag: 0, + postTag: 0, + name: 0, + postName: 0, + type: 0, + postType: 0, + description: 0, + end: 0, + lineEnd: 0, + }; + const headers = { lineEnd: 'CR' }; + const fields = Object.keys(zeroWidth); + const repr = (x) => (isSpace(x) ? `{${x.length}}` : x); + const frame = (line) => '|' + line.join('|') + '|'; + const align = (width, tokens) => Object.keys(tokens).map((k) => repr(tokens[k]).padEnd(width[k])); + function inspect({ source }) { + var _a, _b; + if (source.length === 0) + return ''; + const width = Object.assign({}, zeroWidth); + for (const f of fields) + width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length; + for (const { number, tokens } of source) { + width.line = Math.max(width.line, number.toString().length); + for (const k in tokens) + width[k] = Math.max(width[k], repr(tokens[k]).length); + } + const lines = [[], []]; + for (const f of fields) + lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f])); + for (const f of fields) + lines[1].push('-'.padEnd(width[f], '-')); + for (const { number, tokens } of source) { + const line = number.toString().padStart(width.line); + lines.push([line, ...align(width, tokens)]); + } + return lines.map(frame).join('\n'); + } + + function parse(source, options = {}) { + return getParser(options)(source); + } + const stringify = getStringifier(); + const transforms = { + flow: flow, + align: align$1, + indent: indent, + crlf: crlf, + }; + const tokenizers = { + tag: tagTokenizer, + type: typeTokenizer, + name: nameTokenizer, + description: descriptionTokenizer, + }; + const util = { rewireSpecs, rewireSource, seedBlock, seedTokens }; + + exports.inspect = inspect; + exports.parse = parse; + exports.stringify = stringify; + exports.tokenizers = tokenizers; + exports.transforms = transforms; + exports.util = util; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +}({})); diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/index.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/index.js new file mode 100644 index 00000000000000..6b6c4751396e20 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/index.js @@ -0,0 +1,30 @@ +import getParser from './parser/index.js'; +import descriptionTokenizer from './parser/tokenizers/description.js'; +import nameTokenizer from './parser/tokenizers/name.js'; +import tagTokenizer from './parser/tokenizers/tag.js'; +import typeTokenizer from './parser/tokenizers/type.js'; +import getStringifier from './stringifier/index.js'; +import alignTransform from './transforms/align.js'; +import indentTransform from './transforms/indent.js'; +import crlfTransform from './transforms/crlf.js'; +import { flow as flowTransform } from './transforms/index.js'; +import { rewireSpecs, rewireSource, seedBlock, seedTokens } from './util.js'; +export * from './primitives.js'; +export function parse(source, options = {}) { + return getParser(options)(source); +} +export const stringify = getStringifier(); +export { default as inspect } from './stringifier/inspect.js'; +export const transforms = { + flow: flowTransform, + align: alignTransform, + indent: indentTransform, + crlf: crlfTransform, +}; +export const tokenizers = { + tag: tagTokenizer, + type: typeTokenizer, + name: nameTokenizer, + description: descriptionTokenizer, +}; +export const util = { rewireSpecs, rewireSource, seedBlock, seedTokens }; diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/block-parser.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/block-parser.js new file mode 100644 index 00000000000000..9c4a62bc845d13 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/block-parser.js @@ -0,0 +1,29 @@ +const reTag = /^@\S+/; +/** + * Creates configured `Parser` + * @param {Partial} options + */ +export default function getParser({ fence = '```', } = {}) { + const fencer = getFencer(fence); + const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced; + return function parseBlock(source) { + // start with description section + const sections = [[]]; + let isFenced = false; + for (const line of source) { + if (reTag.test(line.tokens.description) && !isFenced) { + sections.push([line]); + } + else { + sections[sections.length - 1].push(line); + } + isFenced = toggleFence(line.tokens.description, isFenced); + } + return sections; + }; +} +function getFencer(fence) { + if (typeof fence === 'string') + return (source) => source.split(fence).length % 2 === 0; + return fence; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/index.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/index.js new file mode 100644 index 00000000000000..01e17686692f47 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/index.js @@ -0,0 +1,42 @@ +import { Markers } from '../primitives.js'; +import { splitLines } from '../util.js'; +import blockParser from './block-parser.js'; +import sourceParser from './source-parser.js'; +import specParser from './spec-parser.js'; +import tokenizeTag from './tokenizers/tag.js'; +import tokenizeType from './tokenizers/type.js'; +import tokenizeName from './tokenizers/name.js'; +import tokenizeDescription, { getJoiner as getDescriptionJoiner, } from './tokenizers/description.js'; +export default function getParser({ startLine = 0, fence = '```', spacing = 'compact', markers = Markers, tokenizers = [ + tokenizeTag(), + tokenizeType(spacing), + tokenizeName(), + tokenizeDescription(spacing), +], } = {}) { + if (startLine < 0 || startLine % 1 > 0) + throw new Error('Invalid startLine'); + const parseSource = sourceParser({ startLine, markers }); + const parseBlock = blockParser({ fence }); + const parseSpec = specParser({ tokenizers }); + const joinDescription = getDescriptionJoiner(spacing); + const notEmpty = (line) => line.tokens.description.trim() != ''; + return function (source) { + const blocks = []; + for (const line of splitLines(source)) { + const lines = parseSource(line); + if (lines === null) + continue; + if (lines.find(notEmpty) === undefined) + continue; + const sections = parseBlock(lines); + const specs = sections.slice(1).map(parseSpec); + blocks.push({ + description: joinDescription(sections[0], markers), + tags: specs, + source: lines, + problems: specs.reduce((acc, spec) => acc.concat(spec.problems), []), + }); + } + return blocks; + }; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/source-parser.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/source-parser.js new file mode 100644 index 00000000000000..de1c95d5e8cbcf --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/source-parser.js @@ -0,0 +1,46 @@ +import { Markers } from '../primitives.js'; +import { seedTokens, splitSpace, splitCR } from '../util.js'; +export default function getParser({ startLine = 0, markers = Markers, } = {}) { + let block = null; + let num = startLine; + return function parseSource(source) { + let rest = source; + const tokens = seedTokens(); + [tokens.lineEnd, rest] = splitCR(rest); + [tokens.start, rest] = splitSpace(rest); + if (block === null && + rest.startsWith(markers.start) && + !rest.startsWith(markers.nostart)) { + block = []; + tokens.delimiter = rest.slice(0, markers.start.length); + rest = rest.slice(markers.start.length); + [tokens.postDelimiter, rest] = splitSpace(rest); + } + if (block === null) { + num++; + return null; + } + const isClosed = rest.trimRight().endsWith(markers.end); + if (tokens.delimiter === '' && + rest.startsWith(markers.delim) && + !rest.startsWith(markers.end)) { + tokens.delimiter = markers.delim; + rest = rest.slice(markers.delim.length); + [tokens.postDelimiter, rest] = splitSpace(rest); + } + if (isClosed) { + const trimmed = rest.trimRight(); + tokens.end = rest.slice(trimmed.length - markers.end.length); + rest = trimmed.slice(0, -markers.end.length); + } + tokens.description = rest; + block.push({ number: num, source, tokens }); + num++; + if (isClosed) { + const result = block.slice(); + block = null; + return result; + } + return null; + }; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/spec-parser.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/spec-parser.js new file mode 100644 index 00000000000000..934e009052c5fc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/spec-parser.js @@ -0,0 +1,13 @@ +import { seedSpec } from '../util.js'; +export default function getParser({ tokenizers }) { + return function parseSpec(source) { + var _a; + let spec = seedSpec({ source }); + for (const tokenize of tokenizers) { + spec = tokenize(spec); + if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical) + break; + } + return spec; + }; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/description.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/description.js new file mode 100644 index 00000000000000..a74bc90bfaf5be --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/description.js @@ -0,0 +1,47 @@ +import { Markers } from '../../primitives.js'; +/** + * Makes no changes to `spec.lines[].tokens` but joins them into `spec.description` + * following given spacing srtategy + * @param {Spacing} spacing tells how to handle the whitespace + * @param {BlockMarkers} markers tells how to handle comment block delimitation + */ +export default function descriptionTokenizer(spacing = 'compact', markers = Markers) { + const join = getJoiner(spacing); + return (spec) => { + spec.description = join(spec.source, markers); + return spec; + }; +} +export function getJoiner(spacing) { + if (spacing === 'compact') + return compactJoiner; + if (spacing === 'preserve') + return preserveJoiner; + return spacing; +} +function compactJoiner(lines, markers = Markers) { + return lines + .map(({ tokens: { description } }) => description.trim()) + .filter((description) => description !== '') + .join(' '); +} +const lineNo = (num, { tokens }, i) => tokens.type === '' ? num : i; +const getDescription = ({ tokens }) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) + + tokens.description; +function preserveJoiner(lines, markers = Markers) { + if (lines.length === 0) + return ''; + // skip the opening line with no description + if (lines[0].tokens.description === '' && + lines[0].tokens.delimiter === markers.start) + lines = lines.slice(1); + // skip the closing line with no description + const lastLine = lines[lines.length - 1]; + if (lastLine !== undefined && + lastLine.tokens.description === '' && + lastLine.tokens.end.endsWith(markers.end)) + lines = lines.slice(0, -1); + // description starts at the last line of type definition + lines = lines.slice(lines.reduce(lineNo, 0)); + return lines.map(getDescription).join('\n'); +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/index.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/index.js new file mode 100644 index 00000000000000..cb0ff5c3b541f6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/index.js @@ -0,0 +1 @@ +export {}; diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/name.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/name.js new file mode 100644 index 00000000000000..ec1b44717bccb6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/name.js @@ -0,0 +1,91 @@ +import { splitSpace, isSpace } from '../../util.js'; +const isQuoted = (s) => s && s.startsWith('"') && s.endsWith('"'); +/** + * Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens, + * and populates the `spec.name` + */ +export default function nameTokenizer() { + const typeEnd = (num, { tokens }, i) => tokens.type === '' ? num : i; + return (spec) => { + // look for the name in the line where {type} ends + const { tokens } = spec.source[spec.source.reduce(typeEnd, 0)]; + const source = tokens.description.trimLeft(); + const quotedGroups = source.split('"'); + // if it starts with quoted group, assume it is a literal + if (quotedGroups.length > 1 && + quotedGroups[0] === '' && + quotedGroups.length % 2 === 1) { + spec.name = quotedGroups[1]; + tokens.name = `"${quotedGroups[1]}"`; + [tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length)); + return spec; + } + let brackets = 0; + let name = ''; + let optional = false; + let defaultValue; + // assume name is non-space string or anything wrapped into brackets + for (const ch of source) { + if (brackets === 0 && isSpace(ch)) + break; + if (ch === '[') + brackets++; + if (ch === ']') + brackets--; + name += ch; + } + if (brackets !== 0) { + spec.problems.push({ + code: 'spec:name:unpaired-brackets', + message: 'unpaired brackets', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + const nameToken = name; + if (name[0] === '[' && name[name.length - 1] === ']') { + optional = true; + name = name.slice(1, -1); + const parts = name.split('='); + name = parts[0].trim(); + if (parts[1] !== undefined) + defaultValue = parts.slice(1).join('=').trim(); + if (name === '') { + spec.problems.push({ + code: 'spec:name:empty-name', + message: 'empty name', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + if (defaultValue === '') { + spec.problems.push({ + code: 'spec:name:empty-default', + message: 'empty default value', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + // has "=" and is not a string, except for "=>" + if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) { + spec.problems.push({ + code: 'spec:name:invalid-default', + message: 'invalid default value syntax', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + } + spec.optional = optional; + spec.name = name; + tokens.name = nameToken; + if (defaultValue !== undefined) + spec.default = defaultValue; + [tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length)); + return spec; + }; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/tag.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/tag.js new file mode 100644 index 00000000000000..4696b00dab08a0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/tag.js @@ -0,0 +1,24 @@ +/** + * Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token, + * and populates `spec.tag` + */ +export default function tagTokenizer() { + return (spec) => { + const { tokens } = spec.source[0]; + const match = tokens.description.match(/\s*(@(\S+))(\s*)/); + if (match === null) { + spec.problems.push({ + code: 'spec:tag:prefix', + message: 'tag should start with "@" symbol', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + tokens.tag = match[1]; + tokens.postTag = match[3]; + tokens.description = tokens.description.slice(match[0].length); + spec.tag = match[2]; + return spec; + }; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/type.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/type.js new file mode 100644 index 00000000000000..b084603d76314c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/parser/tokenizers/type.js @@ -0,0 +1,65 @@ +import { splitSpace } from '../../util.js'; +/** + * Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description` + * tokens and populates Spec.type` + * + * @param {Spacing} spacing tells how to deal with a whitespace + * for type values going over multiple lines + */ +export default function typeTokenizer(spacing = 'compact') { + const join = getJoiner(spacing); + return (spec) => { + let curlies = 0; + let lines = []; + for (const [i, { tokens }] of spec.source.entries()) { + let type = ''; + if (i === 0 && tokens.description[0] !== '{') + return spec; + for (const ch of tokens.description) { + if (ch === '{') + curlies++; + if (ch === '}') + curlies--; + type += ch; + if (curlies === 0) + break; + } + lines.push([tokens, type]); + if (curlies === 0) + break; + } + if (curlies !== 0) { + spec.problems.push({ + code: 'spec:type:unpaired-curlies', + message: 'unpaired curlies', + line: spec.source[0].number, + critical: true, + }); + return spec; + } + const parts = []; + const offset = lines[0][0].postDelimiter.length; + for (const [i, [tokens, type]] of lines.entries()) { + tokens.type = type; + if (i > 0) { + tokens.type = tokens.postDelimiter.slice(offset) + type; + tokens.postDelimiter = tokens.postDelimiter.slice(0, offset); + } + [tokens.postType, tokens.description] = splitSpace(tokens.description.slice(type.length)); + parts.push(tokens.type); + } + parts[0] = parts[0].slice(1); + parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1); + spec.type = join(parts); + return spec; + }; +} +const trim = (x) => x.trim(); +function getJoiner(spacing) { + if (spacing === 'compact') + return (t) => t.map(trim).join(''); + else if (spacing === 'preserve') + return (t) => t.join('\n'); + else + return spacing; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/primitives.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/primitives.js new file mode 100644 index 00000000000000..4a503527cd871e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/primitives.js @@ -0,0 +1,8 @@ +/** @deprecated */ +export var Markers; +(function (Markers) { + Markers["start"] = "/**"; + Markers["nostart"] = "/***"; + Markers["delim"] = "*"; + Markers["end"] = "*/"; +})(Markers || (Markers = {})); diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/stringifier/index.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/stringifier/index.js new file mode 100644 index 00000000000000..60b46ca4f59575 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/stringifier/index.js @@ -0,0 +1,17 @@ +function join(tokens) { + return (tokens.start + + tokens.delimiter + + tokens.postDelimiter + + tokens.tag + + tokens.postTag + + tokens.type + + tokens.postType + + tokens.name + + tokens.postName + + tokens.description + + tokens.end + + tokens.lineEnd); +} +export default function getStringifier() { + return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n'); +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/stringifier/inspect.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/stringifier/inspect.js new file mode 100644 index 00000000000000..4569f3ccfe1273 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/stringifier/inspect.js @@ -0,0 +1,44 @@ +import { isSpace } from '../util.js'; +const zeroWidth = { + line: 0, + start: 0, + delimiter: 0, + postDelimiter: 0, + tag: 0, + postTag: 0, + name: 0, + postName: 0, + type: 0, + postType: 0, + description: 0, + end: 0, + lineEnd: 0, +}; +const headers = { lineEnd: 'CR' }; +const fields = Object.keys(zeroWidth); +const repr = (x) => (isSpace(x) ? `{${x.length}}` : x); +const frame = (line) => '|' + line.join('|') + '|'; +const align = (width, tokens) => Object.keys(tokens).map((k) => repr(tokens[k]).padEnd(width[k])); +export default function inspect({ source }) { + var _a, _b; + if (source.length === 0) + return ''; + const width = Object.assign({}, zeroWidth); + for (const f of fields) + width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length; + for (const { number, tokens } of source) { + width.line = Math.max(width.line, number.toString().length); + for (const k in tokens) + width[k] = Math.max(width[k], repr(tokens[k]).length); + } + const lines = [[], []]; + for (const f of fields) + lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f])); + for (const f of fields) + lines[1].push('-'.padEnd(width[f], '-')); + for (const { number, tokens } of source) { + const line = number.toString().padStart(width.line); + lines.push([line, ...align(width, tokens)]); + } + return lines.map(frame).join('\n'); +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/align.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/align.js new file mode 100644 index 00000000000000..0c1d6616c5e6c0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/align.js @@ -0,0 +1,93 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import { Markers } from '../primitives.js'; +import { rewireSource } from '../util.js'; +const zeroWidth = { + start: 0, + tag: 0, + type: 0, + name: 0, +}; +const getWidth = (markers = Markers) => (w, { tokens: t }) => ({ + start: t.delimiter === markers.start ? t.start.length : w.start, + tag: Math.max(w.tag, t.tag.length), + type: Math.max(w.type, t.type.length), + name: Math.max(w.name, t.name.length), +}); +const space = (len) => ''.padStart(len, ' '); +export default function align(markers = Markers) { + let intoTags = false; + let w; + function update(line) { + const tokens = Object.assign({}, line.tokens); + if (tokens.tag !== '') + intoTags = true; + const isEmpty = tokens.tag === '' && + tokens.name === '' && + tokens.type === '' && + tokens.description === ''; + // dangling '*/' + if (tokens.end === markers.end && isEmpty) { + tokens.start = space(w.start + 1); + return Object.assign(Object.assign({}, line), { tokens }); + } + switch (tokens.delimiter) { + case markers.start: + tokens.start = space(w.start); + break; + case markers.delim: + tokens.start = space(w.start + 1); + break; + default: + tokens.delimiter = ''; + tokens.start = space(w.start + 2); // compensate delimiter + } + if (!intoTags) { + tokens.postDelimiter = tokens.description === '' ? '' : ' '; + return Object.assign(Object.assign({}, line), { tokens }); + } + const nothingAfter = { + delim: false, + tag: false, + type: false, + name: false, + }; + if (tokens.description === '') { + nothingAfter.name = true; + tokens.postName = ''; + if (tokens.name === '') { + nothingAfter.type = true; + tokens.postType = ''; + if (tokens.type === '') { + nothingAfter.tag = true; + tokens.postTag = ''; + if (tokens.tag === '') { + nothingAfter.delim = true; + } + } + } + } + tokens.postDelimiter = nothingAfter.delim ? '' : ' '; + if (!nothingAfter.tag) + tokens.postTag = space(w.tag - tokens.tag.length + 1); + if (!nothingAfter.type) + tokens.postType = space(w.type - tokens.type.length + 1); + if (!nothingAfter.name) + tokens.postName = space(w.name - tokens.name.length + 1); + return Object.assign(Object.assign({}, line), { tokens }); + } + return (_a) => { + var { source } = _a, fields = __rest(_a, ["source"]); + w = source.reduce(getWidth(markers), Object.assign({}, zeroWidth)); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/crlf.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/crlf.js new file mode 100644 index 00000000000000..f876f949cb19bf --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/crlf.js @@ -0,0 +1,34 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import { rewireSource } from '../util.js'; +const order = [ + 'end', + 'description', + 'postType', + 'type', + 'postName', + 'name', + 'postTag', + 'tag', + 'postDelimiter', + 'delimiter', + 'start', +]; +export default function crlf(ending) { + function update(line) { + return Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { lineEnd: ending === 'LF' ? '' : '\r' }) }); + } + return (_a) => { + var { source } = _a, fields = __rest(_a, ["source"]); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/indent.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/indent.js new file mode 100644 index 00000000000000..ca24b854026b6a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/indent.js @@ -0,0 +1,32 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import { rewireSource } from '../util.js'; +const pull = (offset) => (str) => str.slice(offset); +const push = (offset) => { + const space = ''.padStart(offset, ' '); + return (str) => str + space; +}; +export default function indent(pos) { + let shift; + const pad = (start) => { + if (shift === undefined) { + const offset = pos - start.length; + shift = offset > 0 ? push(offset) : pull(-offset); + } + return shift(start); + }; + const update = (line) => (Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { start: pad(line.tokens.start) }) })); + return (_a) => { + var { source } = _a, fields = __rest(_a, ["source"]); + return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) })); + }; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/index.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/index.js new file mode 100644 index 00000000000000..af165719fb822b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/transforms/index.js @@ -0,0 +1,3 @@ +export function flow(...transforms) { + return (block) => transforms.reduce((block, t) => t(block), block); +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/es6/util.js b/tools/node_modules/eslint/node_modules/comment-parser/es6/util.js new file mode 100644 index 00000000000000..4476e26f2711fc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/es6/util.js @@ -0,0 +1,52 @@ +export function isSpace(source) { + return /^\s+$/.test(source); +} +export function hasCR(source) { + return /\r$/.test(source); +} +export function splitCR(source) { + const matches = source.match(/\r+$/); + return matches == null + ? ['', source] + : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)]; +} +export function splitSpace(source) { + const matches = source.match(/^\s+/); + return matches == null + ? ['', source] + : [source.slice(0, matches[0].length), source.slice(matches[0].length)]; +} +export function splitLines(source) { + return source.split(/\n/); +} +export function seedBlock(block = {}) { + return Object.assign({ description: '', tags: [], source: [], problems: [] }, block); +} +export function seedSpec(spec = {}) { + return Object.assign({ tag: '', name: '', type: '', optional: false, description: '', problems: [], source: [] }, spec); +} +export function seedTokens(tokens = {}) { + return Object.assign({ start: '', delimiter: '', postDelimiter: '', tag: '', postTag: '', name: '', postName: '', type: '', postType: '', description: '', end: '', lineEnd: '' }, tokens); +} +/** + * Assures Block.tags[].source contains references to the Block.source items, + * using Block.source as a source of truth. This is a counterpart of rewireSpecs + * @param block parsed coments block + */ +export function rewireSource(block) { + const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map()); + for (const spec of block.tags) { + spec.source = spec.source.map((line) => source.get(line.number)); + } + return block; +} +/** + * Assures Block.source contains references to the Block.tags[].source items, + * using Block.tags[].source as a source of truth. This is a counterpart of rewireSource + * @param block parsed coments block + */ +export function rewireSpecs(block) { + const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map()); + block.source = block.source.map((line) => source.get(line.number) || line); + return block; +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/jest.config.cjs b/tools/node_modules/eslint/node_modules/comment-parser/jest.config.cjs new file mode 100644 index 00000000000000..a90258738198a4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/jest.config.cjs @@ -0,0 +1,207 @@ +// For a detailed explanation regarding each configuration property, visit: +// https://jestjs.io/docs/en/configuration.html + +const { compilerOptions: tsconfig } = JSON.parse( + require('fs').readFileSync('./tsconfig.node.json') +); + +module.exports = { + globals: { + 'ts-jest': { + tsconfig, + }, + }, + + // All imported modules in your tests should be mocked automatically + // automock: false, + + // Stop running tests after `n` failures + // bail: 0, + + // The directory where Jest should store its cached dependency information + // cacheDirectory: "/private/var/folders/_g/g97k3tbx31x08qqy2z18kxq80000gn/T/jest_dx", + + // Automatically clear mock calls and instances between every test + // clearMocks: false, + + // Indicates whether the coverage information should be collected while executing the test + collectCoverage: true, + + // An array of glob patterns indicating a set of files for which coverage information should be collected + // collectCoverageFrom: undefined, + + // The directory where Jest should output its coverage files + // coverageDirectory: ".coverage", + + // An array of regexp pattern strings used to skip coverage collection + coveragePathIgnorePatterns: ['/node_modules/', '/lib/', '/tests/'], + + // Indicates which provider should be used to instrument code for coverage + coverageProvider: 'v8', + + // A list of reporter names that Jest uses when writing coverage reports + // coverageReporters: [ + // "json", + // "text", + // "lcov", + // "clover" + // ], + + // An object that configures minimum threshold enforcement for coverage results + // coverageThreshold: { + // global : { + // branches: 85, + // functions: 85, + // lines: 85, + // statements: 85 + // } + // }, + + // A path to a custom dependency extractor + // dependencyExtractor: undefined, + + // Make calling deprecated APIs throw helpful error messages + // errorOnDeprecated: false, + + // Force coverage collection from ignored files using an array of glob patterns + // forceCoverageMatch: [], + + // A path to a module which exports an async function that is triggered once before all test suites + // globalSetup: undefined, + + // A path to a module which exports an async function that is triggered once after all test suites + // globalTeardown: undefined, + + // A set of global variables that need to be available in all test environments + // globals: {}, + + // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. + // maxWorkers: "50%", + + // An array of directory names to be searched recursively up from the requiring module's location + // moduleDirectories: [ + // "node_modules" + // ], + + // An array of file extensions your modules use + // moduleFileExtensions: [ + // "js", + // "json", + // "jsx", + // "ts", + // "tsx", + // "node" + // ], + + // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module + // moduleNameMapper: {}, + + // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader + // modulePathIgnorePatterns: [], + + // Activates notifications for test results + // notify: false, + + // An enum that specifies notification mode. Requires { notify: true } + // notifyMode: "failure-change", + + // A preset that is used as a base for Jest's configuration + preset: 'ts-jest', + + // Run tests from one or more projects + // projects: undefined, + + // Use this configuration option to add custom reporters to Jest + // reporters: undefined, + + // Automatically reset mock state between every test + // resetMocks: false, + + // Reset the module registry before running each individual test + // resetModules: false, + + // A path to a custom resolver + // resolver: undefined, + + // Automatically restore mock state between every test + // restoreMocks: false, + + // The root directory that Jest should scan for tests and modules within + // rootDir: undefined, + + // A list of paths to directories that Jest should use to search for files in + roots: ['/tests/'], + + // Allows you to use a custom runner instead of Jest's default test runner + // runner: "jest-runner", + + // The paths to modules that run some code to configure or set up the testing environment before each test + // setupFiles: [], + + // A list of paths to modules that run some code to configure or set up the testing framework before each test + // setupFilesAfterEnv: [], + + // The number of seconds after which a test is considered as slow and reported as such in the results. + // slowTestThreshold: 5, + + // A list of paths to snapshot serializer modules Jest should use for snapshot testing + // snapshotSerializers: [], + + // The test environment that will be used for testing + testEnvironment: 'node', + + // Options that will be passed to the testEnvironment + // testEnvironmentOptions: {}, + + // Adds a location field to test results + // testLocationInResults: false, + + // The glob patterns Jest uses to detect test files + // testMatch: [ + // "**/__tests__/**/*.[jt]s?(x)", + // "**/?(*.)+(spec|test).[tj]s?(x)" + // ], + + // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped + // testPathIgnorePatterns: [ + // "/node_modules/" + // ], + + // The regexp pattern or array of patterns that Jest uses to detect test files + // testRegex: [], + + // This option allows the use of a custom results processor + // testResultsProcessor: undefined, + + // This option allows use of a custom test runner + // testRunner: "jasmine2", + + // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href + // testURL: "http://localhost", + + // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" + // timers: "real", + + // A map from regular expressions to paths to transformers + transform: { + '^.+\\.ts$': 'ts-jest', + }, + + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + // transformIgnorePatterns: [ + // "/node_modules/", + // "\\.pnp\\.[^\\/]+$" + // ], + + // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them + // unmockedModulePathPatterns: undefined, + + // Indicates whether each individual test should be reported during the run + // verbose: undefined, + + // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode + // watchPathIgnorePatterns: [], + + // Whether to use watchman for file crawling + // watchman: true, +}; diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/index.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/index.cjs new file mode 100644 index 00000000000000..f7970b41e547e8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/index.cjs @@ -0,0 +1,82 @@ +"use strict"; + +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +var __exportStar = this && this.__exportStar || function (m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.util = exports.tokenizers = exports.transforms = exports.inspect = exports.stringify = exports.parse = void 0; + +const index_1 = require("./parser/index.cjs"); + +const description_1 = require("./parser/tokenizers/description.cjs"); + +const name_1 = require("./parser/tokenizers/name.cjs"); + +const tag_1 = require("./parser/tokenizers/tag.cjs"); + +const type_1 = require("./parser/tokenizers/type.cjs"); + +const index_2 = require("./stringifier/index.cjs"); + +const align_1 = require("./transforms/align.cjs"); + +const indent_1 = require("./transforms/indent.cjs"); + +const crlf_1 = require("./transforms/crlf.cjs"); + +const index_3 = require("./transforms/index.cjs"); + +const util_1 = require("./util.cjs"); + +__exportStar(require("./primitives.cjs"), exports); + +function parse(source, options = {}) { + return index_1.default(options)(source); +} + +exports.parse = parse; +exports.stringify = index_2.default(); + +var inspect_1 = require("./stringifier/inspect.cjs"); + +Object.defineProperty(exports, "inspect", { + enumerable: true, + get: function () { + return inspect_1.default; + } +}); +exports.transforms = { + flow: index_3.flow, + align: align_1.default, + indent: indent_1.default, + crlf: crlf_1.default +}; +exports.tokenizers = { + tag: tag_1.default, + type: type_1.default, + name: name_1.default, + description: description_1.default +}; +exports.util = { + rewireSpecs: util_1.rewireSpecs, + rewireSource: util_1.rewireSource, + seedBlock: util_1.seedBlock, + seedTokens: util_1.seedTokens +}; +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/block-parser.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/block-parser.cjs new file mode 100644 index 00000000000000..b81ecd79c4fe59 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/block-parser.cjs @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +const reTag = /^@\S+/; +/** + * Creates configured `Parser` + * @param {Partial} options + */ + +function getParser({ + fence = '```' +} = {}) { + const fencer = getFencer(fence); + + const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced; + + return function parseBlock(source) { + // start with description section + const sections = [[]]; + let isFenced = false; + + for (const line of source) { + if (reTag.test(line.tokens.description) && !isFenced) { + sections.push([line]); + } else { + sections[sections.length - 1].push(line); + } + + isFenced = toggleFence(line.tokens.description, isFenced); + } + + return sections; + }; +} + +exports.default = getParser; + +function getFencer(fence) { + if (typeof fence === 'string') return source => source.split(fence).length % 2 === 0; + return fence; +} +//# sourceMappingURL=block-parser.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/index.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/index.cjs new file mode 100644 index 00000000000000..dde50d4013e453 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/index.cjs @@ -0,0 +1,69 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const primitives_1 = require("../primitives.cjs"); + +const util_1 = require("../util.cjs"); + +const block_parser_1 = require("./block-parser.cjs"); + +const source_parser_1 = require("./source-parser.cjs"); + +const spec_parser_1 = require("./spec-parser.cjs"); + +const tag_1 = require("./tokenizers/tag.cjs"); + +const type_1 = require("./tokenizers/type.cjs"); + +const name_1 = require("./tokenizers/name.cjs"); + +const description_1 = require("./tokenizers/description.cjs"); + +function getParser({ + startLine = 0, + fence = '```', + spacing = 'compact', + markers = primitives_1.Markers, + tokenizers = [tag_1.default(), type_1.default(spacing), name_1.default(), description_1.default(spacing)] +} = {}) { + if (startLine < 0 || startLine % 1 > 0) throw new Error('Invalid startLine'); + const parseSource = source_parser_1.default({ + startLine, + markers + }); + const parseBlock = block_parser_1.default({ + fence + }); + const parseSpec = spec_parser_1.default({ + tokenizers + }); + const joinDescription = description_1.getJoiner(spacing); + + const notEmpty = line => line.tokens.description.trim() != ''; + + return function (source) { + const blocks = []; + + for (const line of util_1.splitLines(source)) { + const lines = parseSource(line); + if (lines === null) continue; + if (lines.find(notEmpty) === undefined) continue; + const sections = parseBlock(lines); + const specs = sections.slice(1).map(parseSpec); + blocks.push({ + description: joinDescription(sections[0], markers), + tags: specs, + source: lines, + problems: specs.reduce((acc, spec) => acc.concat(spec.problems), []) + }); + } + + return blocks; + }; +} + +exports.default = getParser; +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/source-parser.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/source-parser.cjs new file mode 100644 index 00000000000000..f2ccc8fb79a141 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/source-parser.cjs @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const primitives_1 = require("../primitives.cjs"); + +const util_1 = require("../util.cjs"); + +function getParser({ + startLine = 0, + markers = primitives_1.Markers +} = {}) { + let block = null; + let num = startLine; + return function parseSource(source) { + let rest = source; + const tokens = util_1.seedTokens(); + [tokens.lineEnd, rest] = util_1.splitCR(rest); + [tokens.start, rest] = util_1.splitSpace(rest); + + if (block === null && rest.startsWith(markers.start) && !rest.startsWith(markers.nostart)) { + block = []; + tokens.delimiter = rest.slice(0, markers.start.length); + rest = rest.slice(markers.start.length); + [tokens.postDelimiter, rest] = util_1.splitSpace(rest); + } + + if (block === null) { + num++; + return null; + } + + const isClosed = rest.trimRight().endsWith(markers.end); + + if (tokens.delimiter === '' && rest.startsWith(markers.delim) && !rest.startsWith(markers.end)) { + tokens.delimiter = markers.delim; + rest = rest.slice(markers.delim.length); + [tokens.postDelimiter, rest] = util_1.splitSpace(rest); + } + + if (isClosed) { + const trimmed = rest.trimRight(); + tokens.end = rest.slice(trimmed.length - markers.end.length); + rest = trimmed.slice(0, -markers.end.length); + } + + tokens.description = rest; + block.push({ + number: num, + source, + tokens + }); + num++; + + if (isClosed) { + const result = block.slice(); + block = null; + return result; + } + + return null; + }; +} + +exports.default = getParser; +//# sourceMappingURL=source-parser.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/spec-parser.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/spec-parser.cjs new file mode 100644 index 00000000000000..6857828236e402 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/spec-parser.cjs @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +function getParser({ + tokenizers +}) { + return function parseSpec(source) { + var _a; + + let spec = util_1.seedSpec({ + source + }); + + for (const tokenize of tokenizers) { + spec = tokenize(spec); + if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical) break; + } + + return spec; + }; +} + +exports.default = getParser; +//# sourceMappingURL=spec-parser.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/description.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/description.cjs new file mode 100644 index 00000000000000..7baa72edc00edb --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/description.cjs @@ -0,0 +1,62 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getJoiner = void 0; + +const primitives_1 = require("../../primitives.cjs"); +/** + * Makes no changes to `spec.lines[].tokens` but joins them into `spec.description` + * following given spacing srtategy + * @param {Spacing} spacing tells how to handle the whitespace + * @param {BlockMarkers} markers tells how to handle comment block delimitation + */ + + +function descriptionTokenizer(spacing = 'compact', markers = primitives_1.Markers) { + const join = getJoiner(spacing); + return spec => { + spec.description = join(spec.source, markers); + return spec; + }; +} + +exports.default = descriptionTokenizer; + +function getJoiner(spacing) { + if (spacing === 'compact') return compactJoiner; + if (spacing === 'preserve') return preserveJoiner; + return spacing; +} + +exports.getJoiner = getJoiner; + +function compactJoiner(lines, markers = primitives_1.Markers) { + return lines.map(({ + tokens: { + description + } + }) => description.trim()).filter(description => description !== '').join(' '); +} + +const lineNo = (num, { + tokens +}, i) => tokens.type === '' ? num : i; + +const getDescription = ({ + tokens +}) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) + tokens.description; + +function preserveJoiner(lines, markers = primitives_1.Markers) { + if (lines.length === 0) return ''; // skip the opening line with no description + + if (lines[0].tokens.description === '' && lines[0].tokens.delimiter === markers.start) lines = lines.slice(1); // skip the closing line with no description + + const lastLine = lines[lines.length - 1]; + if (lastLine !== undefined && lastLine.tokens.description === '' && lastLine.tokens.end.endsWith(markers.end)) lines = lines.slice(0, -1); // description starts at the last line of type definition + + lines = lines.slice(lines.reduce(lineNo, 0)); + return lines.map(getDescription).join('\n'); +} +//# sourceMappingURL=description.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/index.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/index.cjs new file mode 100644 index 00000000000000..203880fed84ce2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/index.cjs @@ -0,0 +1,6 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/name.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/name.cjs new file mode 100644 index 00000000000000..613740b9428a97 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/name.cjs @@ -0,0 +1,109 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../../util.cjs"); + +const isQuoted = s => s && s.startsWith('"') && s.endsWith('"'); +/** + * Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens, + * and populates the `spec.name` + */ + + +function nameTokenizer() { + const typeEnd = (num, { + tokens + }, i) => tokens.type === '' ? num : i; + + return spec => { + // look for the name in the line where {type} ends + const { + tokens + } = spec.source[spec.source.reduce(typeEnd, 0)]; + const source = tokens.description.trimLeft(); + const quotedGroups = source.split('"'); // if it starts with quoted group, assume it is a literal + + if (quotedGroups.length > 1 && quotedGroups[0] === '' && quotedGroups.length % 2 === 1) { + spec.name = quotedGroups[1]; + tokens.name = `"${quotedGroups[1]}"`; + [tokens.postName, tokens.description] = util_1.splitSpace(source.slice(tokens.name.length)); + return spec; + } + + let brackets = 0; + let name = ''; + let optional = false; + let defaultValue; // assume name is non-space string or anything wrapped into brackets + + for (const ch of source) { + if (brackets === 0 && util_1.isSpace(ch)) break; + if (ch === '[') brackets++; + if (ch === ']') brackets--; + name += ch; + } + + if (brackets !== 0) { + spec.problems.push({ + code: 'spec:name:unpaired-brackets', + message: 'unpaired brackets', + line: spec.source[0].number, + critical: true + }); + return spec; + } + + const nameToken = name; + + if (name[0] === '[' && name[name.length - 1] === ']') { + optional = true; + name = name.slice(1, -1); + const parts = name.split('='); + name = parts[0].trim(); + if (parts[1] !== undefined) defaultValue = parts.slice(1).join('=').trim(); + + if (name === '') { + spec.problems.push({ + code: 'spec:name:empty-name', + message: 'empty name', + line: spec.source[0].number, + critical: true + }); + return spec; + } + + if (defaultValue === '') { + spec.problems.push({ + code: 'spec:name:empty-default', + message: 'empty default value', + line: spec.source[0].number, + critical: true + }); + return spec; + } // has "=" and is not a string, except for "=>" + + + if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) { + spec.problems.push({ + code: 'spec:name:invalid-default', + message: 'invalid default value syntax', + line: spec.source[0].number, + critical: true + }); + return spec; + } + } + + spec.optional = optional; + spec.name = name; + tokens.name = nameToken; + if (defaultValue !== undefined) spec.default = defaultValue; + [tokens.postName, tokens.description] = util_1.splitSpace(source.slice(tokens.name.length)); + return spec; + }; +} + +exports.default = nameTokenizer; +//# sourceMappingURL=name.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/tag.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/tag.cjs new file mode 100644 index 00000000000000..55aec566c6f644 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/tag.cjs @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token, + * and populates `spec.tag` + */ + +function tagTokenizer() { + return spec => { + const { + tokens + } = spec.source[0]; + const match = tokens.description.match(/\s*(@(\S+))(\s*)/); + + if (match === null) { + spec.problems.push({ + code: 'spec:tag:prefix', + message: 'tag should start with "@" symbol', + line: spec.source[0].number, + critical: true + }); + return spec; + } + + tokens.tag = match[1]; + tokens.postTag = match[3]; + tokens.description = tokens.description.slice(match[0].length); + spec.tag = match[2]; + return spec; + }; +} + +exports.default = tagTokenizer; +//# sourceMappingURL=tag.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/type.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/type.cjs new file mode 100644 index 00000000000000..0018ec59c4ecc7 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/parser/tokenizers/type.cjs @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../../util.cjs"); +/** + * Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description` + * tokens and populates Spec.type` + * + * @param {Spacing} spacing tells how to deal with a whitespace + * for type values going over multiple lines + */ + + +function typeTokenizer(spacing = 'compact') { + const join = getJoiner(spacing); + return spec => { + let curlies = 0; + let lines = []; + + for (const [i, { + tokens + }] of spec.source.entries()) { + let type = ''; + if (i === 0 && tokens.description[0] !== '{') return spec; + + for (const ch of tokens.description) { + if (ch === '{') curlies++; + if (ch === '}') curlies--; + type += ch; + if (curlies === 0) break; + } + + lines.push([tokens, type]); + if (curlies === 0) break; + } + + if (curlies !== 0) { + spec.problems.push({ + code: 'spec:type:unpaired-curlies', + message: 'unpaired curlies', + line: spec.source[0].number, + critical: true + }); + return spec; + } + + const parts = []; + const offset = lines[0][0].postDelimiter.length; + + for (const [i, [tokens, type]] of lines.entries()) { + tokens.type = type; + + if (i > 0) { + tokens.type = tokens.postDelimiter.slice(offset) + type; + tokens.postDelimiter = tokens.postDelimiter.slice(0, offset); + } + + [tokens.postType, tokens.description] = util_1.splitSpace(tokens.description.slice(type.length)); + parts.push(tokens.type); + } + + parts[0] = parts[0].slice(1); + parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1); + spec.type = join(parts); + return spec; + }; +} + +exports.default = typeTokenizer; + +const trim = x => x.trim(); + +function getJoiner(spacing) { + if (spacing === 'compact') return t => t.map(trim).join('');else if (spacing === 'preserve') return t => t.join('\n');else return spacing; +} +//# sourceMappingURL=type.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/primitives.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/primitives.cjs new file mode 100644 index 00000000000000..a60ed1473dbd71 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/primitives.cjs @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Markers = void 0; +/** @deprecated */ + +var Markers; + +(function (Markers) { + Markers["start"] = "/**"; + Markers["nostart"] = "/***"; + Markers["delim"] = "*"; + Markers["end"] = "*/"; +})(Markers = exports.Markers || (exports.Markers = {})); +//# sourceMappingURL=primitives.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/stringifier/index.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/stringifier/index.cjs new file mode 100644 index 00000000000000..26214cb1d0d0b4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/stringifier/index.cjs @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function join(tokens) { + return tokens.start + tokens.delimiter + tokens.postDelimiter + tokens.tag + tokens.postTag + tokens.type + tokens.postType + tokens.name + tokens.postName + tokens.description + tokens.end + tokens.lineEnd; +} + +function getStringifier() { + return block => block.source.map(({ + tokens + }) => join(tokens)).join('\n'); +} + +exports.default = getStringifier; +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/stringifier/inspect.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/stringifier/inspect.cjs new file mode 100644 index 00000000000000..ee3473a036f225 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/stringifier/inspect.cjs @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +const zeroWidth = { + line: 0, + start: 0, + delimiter: 0, + postDelimiter: 0, + tag: 0, + postTag: 0, + name: 0, + postName: 0, + type: 0, + postType: 0, + description: 0, + end: 0, + lineEnd: 0 +}; +const headers = { + lineEnd: 'CR' +}; +const fields = Object.keys(zeroWidth); + +const repr = x => util_1.isSpace(x) ? `{${x.length}}` : x; + +const frame = line => '|' + line.join('|') + '|'; + +const align = (width, tokens) => Object.keys(tokens).map(k => repr(tokens[k]).padEnd(width[k])); + +function inspect({ + source +}) { + var _a, _b; + + if (source.length === 0) return ''; + const width = Object.assign({}, zeroWidth); + + for (const f of fields) width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length; + + for (const { + number, + tokens + } of source) { + width.line = Math.max(width.line, number.toString().length); + + for (const k in tokens) width[k] = Math.max(width[k], repr(tokens[k]).length); + } + + const lines = [[], []]; + + for (const f of fields) lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f])); + + for (const f of fields) lines[1].push('-'.padEnd(width[f], '-')); + + for (const { + number, + tokens + } of source) { + const line = number.toString().padStart(width.line); + lines.push([line, ...align(width, tokens)]); + } + + return lines.map(frame).join('\n'); +} + +exports.default = inspect; +//# sourceMappingURL=inspect.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/align.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/align.cjs new file mode 100644 index 00000000000000..4ff401dea929ba --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/align.cjs @@ -0,0 +1,127 @@ +"use strict"; + +var __rest = this && this.__rest || function (s, e) { + var t = {}; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +}; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const primitives_1 = require("../primitives.cjs"); + +const util_1 = require("../util.cjs"); + +const zeroWidth = { + start: 0, + tag: 0, + type: 0, + name: 0 +}; + +const getWidth = (markers = primitives_1.Markers) => (w, { + tokens: t +}) => ({ + start: t.delimiter === markers.start ? t.start.length : w.start, + tag: Math.max(w.tag, t.tag.length), + type: Math.max(w.type, t.type.length), + name: Math.max(w.name, t.name.length) +}); + +const space = len => ''.padStart(len, ' '); + +function align(markers = primitives_1.Markers) { + let intoTags = false; + let w; + + function update(line) { + const tokens = Object.assign({}, line.tokens); + if (tokens.tag !== '') intoTags = true; + const isEmpty = tokens.tag === '' && tokens.name === '' && tokens.type === '' && tokens.description === ''; // dangling '*/' + + if (tokens.end === markers.end && isEmpty) { + tokens.start = space(w.start + 1); + return Object.assign(Object.assign({}, line), { + tokens + }); + } + + switch (tokens.delimiter) { + case markers.start: + tokens.start = space(w.start); + break; + + case markers.delim: + tokens.start = space(w.start + 1); + break; + + default: + tokens.delimiter = ''; + tokens.start = space(w.start + 2); + // compensate delimiter + } + + if (!intoTags) { + tokens.postDelimiter = tokens.description === '' ? '' : ' '; + return Object.assign(Object.assign({}, line), { + tokens + }); + } + + const nothingAfter = { + delim: false, + tag: false, + type: false, + name: false + }; + + if (tokens.description === '') { + nothingAfter.name = true; + tokens.postName = ''; + + if (tokens.name === '') { + nothingAfter.type = true; + tokens.postType = ''; + + if (tokens.type === '') { + nothingAfter.tag = true; + tokens.postTag = ''; + + if (tokens.tag === '') { + nothingAfter.delim = true; + } + } + } + } + + tokens.postDelimiter = nothingAfter.delim ? '' : ' '; + if (!nothingAfter.tag) tokens.postTag = space(w.tag - tokens.tag.length + 1); + if (!nothingAfter.type) tokens.postType = space(w.type - tokens.type.length + 1); + if (!nothingAfter.name) tokens.postName = space(w.name - tokens.name.length + 1); + return Object.assign(Object.assign({}, line), { + tokens + }); + } + + return _a => { + var { + source + } = _a, + fields = __rest(_a, ["source"]); + + w = source.reduce(getWidth(markers), Object.assign({}, zeroWidth)); + return util_1.rewireSource(Object.assign(Object.assign({}, fields), { + source: source.map(update) + })); + }; +} + +exports.default = align; +//# sourceMappingURL=align.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/crlf.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/crlf.cjs new file mode 100644 index 00000000000000..c653c48bef6a65 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/crlf.cjs @@ -0,0 +1,44 @@ +"use strict"; + +var __rest = this && this.__rest || function (s, e) { + var t = {}; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +}; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +const order = ['end', 'description', 'postType', 'type', 'postName', 'name', 'postTag', 'tag', 'postDelimiter', 'delimiter', 'start']; + +function crlf(ending) { + function update(line) { + return Object.assign(Object.assign({}, line), { + tokens: Object.assign(Object.assign({}, line.tokens), { + lineEnd: ending === 'LF' ? '' : '\r' + }) + }); + } + + return _a => { + var { + source + } = _a, + fields = __rest(_a, ["source"]); + + return util_1.rewireSource(Object.assign(Object.assign({}, fields), { + source: source.map(update) + })); + }; +} + +exports.default = crlf; +//# sourceMappingURL=crlf.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/indent.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/indent.cjs new file mode 100644 index 00000000000000..3ce279b800d7a9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/indent.cjs @@ -0,0 +1,58 @@ +"use strict"; + +var __rest = this && this.__rest || function (s, e) { + var t = {}; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +}; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = require("../util.cjs"); + +const pull = offset => str => str.slice(offset); + +const push = offset => { + const space = ''.padStart(offset, ' '); + return str => str + space; +}; + +function indent(pos) { + let shift; + + const pad = start => { + if (shift === undefined) { + const offset = pos - start.length; + shift = offset > 0 ? push(offset) : pull(-offset); + } + + return shift(start); + }; + + const update = line => Object.assign(Object.assign({}, line), { + tokens: Object.assign(Object.assign({}, line.tokens), { + start: pad(line.tokens.start) + }) + }); + + return _a => { + var { + source + } = _a, + fields = __rest(_a, ["source"]); + + return util_1.rewireSource(Object.assign(Object.assign({}, fields), { + source: source.map(update) + })); + }; +} + +exports.default = indent; +//# sourceMappingURL=indent.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/index.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/index.cjs new file mode 100644 index 00000000000000..767083ae35d7be --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/transforms/index.cjs @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.flow = void 0; + +function flow(...transforms) { + return block => transforms.reduce((block, t) => t(block), block); +} + +exports.flow = flow; +//# sourceMappingURL=index.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/lib/util.cjs b/tools/node_modules/eslint/node_modules/comment-parser/lib/util.cjs new file mode 100644 index 00000000000000..5d94c0a5d82d21 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/lib/util.cjs @@ -0,0 +1,113 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rewireSpecs = exports.rewireSource = exports.seedTokens = exports.seedSpec = exports.seedBlock = exports.splitLines = exports.splitSpace = exports.splitCR = exports.hasCR = exports.isSpace = void 0; + +function isSpace(source) { + return /^\s+$/.test(source); +} + +exports.isSpace = isSpace; + +function hasCR(source) { + return /\r$/.test(source); +} + +exports.hasCR = hasCR; + +function splitCR(source) { + const matches = source.match(/\r+$/); + return matches == null ? ['', source] : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)]; +} + +exports.splitCR = splitCR; + +function splitSpace(source) { + const matches = source.match(/^\s+/); + return matches == null ? ['', source] : [source.slice(0, matches[0].length), source.slice(matches[0].length)]; +} + +exports.splitSpace = splitSpace; + +function splitLines(source) { + return source.split(/\n/); +} + +exports.splitLines = splitLines; + +function seedBlock(block = {}) { + return Object.assign({ + description: '', + tags: [], + source: [], + problems: [] + }, block); +} + +exports.seedBlock = seedBlock; + +function seedSpec(spec = {}) { + return Object.assign({ + tag: '', + name: '', + type: '', + optional: false, + description: '', + problems: [], + source: [] + }, spec); +} + +exports.seedSpec = seedSpec; + +function seedTokens(tokens = {}) { + return Object.assign({ + start: '', + delimiter: '', + postDelimiter: '', + tag: '', + postTag: '', + name: '', + postName: '', + type: '', + postType: '', + description: '', + end: '', + lineEnd: '' + }, tokens); +} + +exports.seedTokens = seedTokens; +/** + * Assures Block.tags[].source contains references to the Block.source items, + * using Block.source as a source of truth. This is a counterpart of rewireSpecs + * @param block parsed coments block + */ + +function rewireSource(block) { + const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map()); + + for (const spec of block.tags) { + spec.source = spec.source.map(line => source.get(line.number)); + } + + return block; +} + +exports.rewireSource = rewireSource; +/** + * Assures Block.source contains references to the Block.tags[].source items, + * using Block.tags[].source as a source of truth. This is a counterpart of rewireSource + * @param block parsed coments block + */ + +function rewireSpecs(block) { + const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map()); + block.source = block.source.map(line => source.get(line.number) || line); + return block; +} + +exports.rewireSpecs = rewireSpecs; +//# sourceMappingURL=util.cjs.map diff --git a/tools/node_modules/eslint/node_modules/comment-parser/migrate-1.0.md b/tools/node_modules/eslint/node_modules/comment-parser/migrate-1.0.md new file mode 100644 index 00000000000000..bd815b678299c2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/migrate-1.0.md @@ -0,0 +1,105 @@ +# Migrating 0.x to 1.x + +## Parser + +0.x can be mostly translated into 1.x one way or another. The idea behind the new config structure is to handle only the most common cases, and provide the fallback for alternative implementation. + +### `dotted_names: boolean` + +> By default dotted names like `name.subname.subsubname` will be expanded into nested sections, this can be prevented by passing opts.dotted_names = false. + +**Removed** This feature is removed but still can be done on top of the `parse()` output. Please post a request or contribute a PR if you need it. + +### `trim: boolean` + +> Set this to false to avoid the default of trimming whitespace at the start and end of each line. + +In the new parser all original spacing is kept along with comment lines in `.source`. Description lines are joined together depending on `spacing` option + +**New option:** + +- `spacing: "compact"` lines concatenated with a single space and no line breaks +- `spacing: "preserve"` keeps line breaks and space around as is. Indentation space counts from `*` delimiter or from the start of the line if the delimiter is omitted +- `spacing: (lines: Line[]) => string` completely freeform joining strategy, since all original spacing can be accessed, there is no limit to how this can be implemented. See [primitives.ts](./src/primitives.ts) and [spacer.ts](./src/parser/spacer.ts) + +### `join: string | number | boolean` + +> If the following lines of a multiline comment do not start with a star, `join` will have the following effect on tag source (and description) when joining the lines together: +> +> - If a string, use that string in place of the leading whitespace (and avoid newlines). +> - If a non-zero number (e.g., 1), do no trimming and avoid newlines. +> - If undefined, false, or 0, use the default behavior of not trimming but adding a newline. +> - Otherwise (e.g., if join is true), replace any leading whitespace with a single space and avoid newlines. +> +> Note that if a multi-line comment has lines that start with a star, these will be appended with initial whitespace as is and with newlines regardless of the join setting. + +See the `spacing` option above, all the variations can be fine-tunned with `spacing: (lines: Line[]) => string` + +### `fence: string | RegExp | ((source: string) => boolean)` + +> Set to a string or regular expression to toggle state upon finding an odd number of matches within a line. Defaults to ```. +> +> If set to a function, it should return true to toggle fenced state; upon returning true the first time, this will prevent subsequent lines from being interpreted as starting a new jsdoc tag until such time as the function returns true again to indicate that the state has toggled back. + +This is mostly kept the same + +**New optoins:** + +- ```` fence: '```' ```` same as 0.x +- `fencer: (source: string) => boolean` same as 0.x, see [parser/block-parser.ts](./src/parser/block-parser.ts) + +### `parsers: Parser[]` + +> In case you need to parse tags in different way you can pass opts.parsers = [parser1, ..., parserN], where each parser is function name(str:String, data:Object):{source:String, data:Object}. +> ... + +**New options:** + +- `tokenizers: []Tokenizer` is a list of functions extracting the `tag`, `type`, `name` and `description` tokens from this string. See [parser/spec-parser.ts](./src/parser/spec-parser.ts) and [primitives.ts](./src/primitives.ts) + +Default tokenizers chain is + +```js +[ + tagTokenizer(), + typeTokenizer(), + nameTokenizer(), + descriptionTokenizer(getSpacer(spacing)), +] +``` + +where + +```ts +type Tokenizer = (spec: Spec) => Spec + +interface Spec { + tag: string; + name: string; + default?: string; + type: string; + optional: boolean; + description: string; + problems: Problem[]; + source: Line[]; +} +``` + +chain starts with blank `Spec` and each tokenizer fulfills a piece using `.source` input + +## Stringifier + +> One may also convert comment-parser JSON structures back into strings using the stringify method (stringify(o: (object|Array) [, opts: object]): string). +> ... + +Stringifier config follows the same strategy – a couple of common cases, and freeform formatter as a fallback + +**New Options:** + +- `format: "none"` re-assembles the source with original spacing and delimiters preserved +- `format: "align"` aligns tag, name, type, and descriptions into fixed-width columns +- `format: (tokens: Tokens) => string[]` do what you like, resulting lines will be concatenated into the output. Despite the simple interface, this can be turned into a complex stateful formatter, see `"align"` implementation in [transforms/align.ts](./src/transforms/align.ts) + +## Stream + +Work in progress diff --git a/tools/node_modules/eslint/node_modules/comment-parser/package.json b/tools/node_modules/eslint/node_modules/comment-parser/package.json new file mode 100644 index 00000000000000..3ed6fbf63f46fb --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/package.json @@ -0,0 +1,86 @@ +{ + "name": "comment-parser", + "version": "1.3.0", + "description": "Generic JSDoc-like comment parser", + "type": "module", + "main": "lib/index.cjs", + "exports": { + ".": { + "import": "./es6/index.js", + "require": "./lib/index.cjs" + }, + "./primitives": { + "import": "./es6/primitives.js", + "require": "./lib/primitives.cjs" + }, + "./util": { + "import": "./es6/util.js", + "require": "./lib/util.cjs" + }, + "./parser/*": { + "import": "./es6/parser/*.js", + "require": "./lib/parser/*.cjs" + }, + "./stringifier/*": { + "import": "./es6/stringifier/*.js", + "require": "./lib/stringifier/*.cjs" + }, + "./transforms/*": { + "import": "./es6/transforms/*.js", + "require": "./lib/transforms/*.cjs" + } + }, + "types": "lib/index.d.ts", + "directories": { + "test": "tests" + }, + "devDependencies": { + "@types/jest": "^26.0.23", + "convert-extension": "^0.3.0", + "jest": "^27.0.5", + "prettier": "2.3.1", + "replace": "^1.2.1", + "rimraf": "^3.0.2", + "rollup": "^2.52.2", + "ts-jest": "^27.0.3", + "typescript": "^4.3.4" + }, + "engines": { + "node": ">= 12.0.0" + }, + "scripts": { + "build": "rimraf lib es6 browser; tsc -p tsconfig.json && tsc -p tsconfig.node.json && rollup -o browser/index.js -f iife --context window -n CommentParser es6/index.js && convert-extension cjs lib/ && cd es6 && replace \"from '(\\.[^']*)'\" \"from '\\$1.js'\" * -r --include=\"*.js\"", + "format": "prettier --write src tests", + "pretest": "rimraf coverage; npm run build", + "test": "prettier --check src tests && jest --verbose", + "preversion": "npm run build" + }, + "repository": { + "type": "git", + "url": "git@github.com:yavorskiy/comment-parser.git" + }, + "keywords": [ + "jsdoc", + "comments", + "parser" + ], + "author": "Sergiy Yavorsky (https://github.com/syavorsky)", + "contributors": [ + "Alex Grozav (https://github.com/alexgrozav)", + "Alexej Yaroshevich (https://github.com/zxqfox)", + "Andre Wachsmuth (https://github.com/blutorange)", + "Brett Zamir (https://github.com/brettz9)", + "Dieter Oberkofler (https://github.com/doberkofler)", + "Evgeny Reznichenko (https://github.com/zxcabs)", + "Javier \"Ciberma\" Mora (https://github.com/jhm-ciberman)", + "Jayden Seric (https://github.com/jaydenseric)", + "Jordan Harband (https://github.com/ljharb)", + "tengattack (https://github.com/tengattack)" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/syavorsky/comment-parser/issues" + }, + "homepage": "https://github.com/syavorsky/comment-parser", + "dependencies": {} +} diff --git a/tools/node_modules/eslint/node_modules/comment-parser/tsconfig.node.json b/tools/node_modules/eslint/node_modules/comment-parser/tsconfig.node.json new file mode 100644 index 00000000000000..9a05436b7a8fa1 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/comment-parser/tsconfig.node.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es2015", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + "outDir": "./lib", + "lib": ["es2016", "es5"] + }, + "include": ["src"], + "exclude": ["node_modules"] +} diff --git a/tools/node_modules/eslint/node_modules/concat-map/README.markdown b/tools/node_modules/eslint/node_modules/concat-map/README.markdown deleted file mode 100644 index 408f70a1be473c..00000000000000 --- a/tools/node_modules/eslint/node_modules/concat-map/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -concat-map -========== - -Concatenative mapdashery. - -[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) - -[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) - -example -======= - -``` js -var concatMap = require('concat-map'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); -``` - -*** - -``` -[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] -``` - -methods -======= - -``` js -var concatMap = require('concat-map') -``` - -concatMap(xs, fn) ------------------ - -Return an array of concatenated elements by calling `fn(x, i)` for each element -`x` and each index `i` in the array `xs`. - -When `fn(x, i)` returns an array, its result will be concatenated with the -result array. If `fn(x, i)` returns anything else, that value will be pushed -onto the end of the result array. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install concat-map -``` - -license -======= - -MIT - -notes -===== - -This module was written while sitting high above the ground in a tree. diff --git a/tools/node_modules/eslint/node_modules/convert-source-map/README.md b/tools/node_modules/eslint/node_modules/convert-source-map/README.md deleted file mode 100644 index fdee23e4510050..00000000000000 --- a/tools/node_modules/eslint/node_modules/convert-source-map/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.svg?branch=master)](http://travis-ci.org/thlorenz/convert-source-map) - -Converts a source-map from/to different formats and allows adding/changing properties. - -```js -var convert = require('convert-source-map'); - -var json = convert - .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') - .toJSON(); - -var modified = convert - .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') - .setProperty('sources', [ 'SRC/FOO.JS' ]) - .toJSON(); - -console.log(json); -console.log(modified); -``` - -```json -{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"} -{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"} -``` - -## API - -### fromObject(obj) - -Returns source map converter from given object. - -### fromJSON(json) - -Returns source map converter from given json string. - -### fromBase64(base64) - -Returns source map converter from given base64 encoded json string. - -### fromComment(comment) - -Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`. - -### fromMapFileComment(comment, mapFileDir) - -Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`. - -`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the -generated file, i.e. the one containing the source map. - -### fromSource(source) - -Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. - -### fromMapFileSource(source, mapFileDir) - -Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was -found. - -The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see -fromMapFileComment. - -### toObject() - -Returns a copy of the underlying source map. - -### toJSON([space]) - -Converts source map to json string. If `space` is given (optional), this will be passed to -[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the -JSON string is generated. - -### toBase64() - -Converts source map to base64 encoded json string. - -### toComment([options]) - -Converts source map to an inline comment that can be appended to the source-file. - -By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would -normally see in a JS source file. - -When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. - -### addProperty(key, value) - -Adds given property to the source map. Throws an error if property already exists. - -### setProperty(key, value) - -Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated. - -### getProperty(key) - -Gets given property of the source map. - -### removeComments(src) - -Returns `src` with all source map comments removed - -### removeMapFileComments(src) - -Returns `src` with all source map comments pointing to map files removed. - -### commentRegex - -Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments. - -### mapFileCommentRegex - -Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files. - -### generateMapFileComment(file, [options]) - -Returns a comment that links to an external source map via `file`. - -By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file. - -When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. diff --git a/tools/node_modules/eslint/node_modules/cross-spawn/README.md b/tools/node_modules/eslint/node_modules/cross-spawn/README.md deleted file mode 100644 index c4a4da8447fb5b..00000000000000 --- a/tools/node_modules/eslint/node_modules/cross-spawn/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# cross-spawn - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] - -[npm-url]:https://npmjs.org/package/cross-spawn -[downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg -[npm-image]:https://img.shields.io/npm/v/cross-spawn.svg -[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn -[travis-image]:https://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg -[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn -[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg -[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn -[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg -[david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn -[david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg -[david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev -[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg - -A cross platform solution to node's spawn and spawnSync. - - -## Installation - -Node.js version 8 and up: -`$ npm install cross-spawn` - -Node.js version 7 and under: -`$ npm install cross-spawn@6` - -## Why - -Node has issues when using spawn on Windows: - -- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318) -- It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix)) -- Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367) -- Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`) -- Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149) -- No `options.shell` support on node `` where `` must not contain any arguments. -If you would like to have the shebang support improved, feel free to contribute via a pull-request. - -Remember to always test your code on Windows! - - -## Tests - -`$ npm test` -`$ npm test -- --watch` during development - - -## License - -Released under the [MIT License](https://www.opensource.org/licenses/mit-license.php). diff --git a/tools/node_modules/eslint/node_modules/debug/README.md b/tools/node_modules/eslint/node_modules/debug/README.md deleted file mode 100644 index 5ea4cd2759b917..00000000000000 --- a/tools/node_modules/eslint/node_modules/debug/README.md +++ /dev/null @@ -1,478 +0,0 @@ -# debug -[![Build Status](https://travis-ci.org/debug-js/debug.svg?branch=master)](https://travis-ci.org/debug-js/debug) [![Coverage Status](https://coveralls.io/repos/github/debug-js/debug/badge.svg?branch=master)](https://coveralls.io/github/debug-js/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) -[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) - - - -A tiny JavaScript debugging utility modelled after Node.js core's debugging -technique. Works in Node.js and web browsers. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - -`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. - -Example [_app.js_](./examples/node/app.js): - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %o', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example [_worker.js_](./examples/node/worker.js): - -```js -var a = require('debug')('worker:a') - , b = require('debug')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); -``` - -The `DEBUG` environment variable is then used to enable these based on space or -comma-delimited names. - -Here are some examples: - -screen shot 2017-08-08 at 12 53 04 pm -screen shot 2017-08-08 at 12 53 38 pm -screen shot 2017-08-08 at 12 53 25 pm - -#### Windows command prompt notes - -##### CMD - -On Windows the environment variable is set using the `set` command. - -```cmd -set DEBUG=*,-not_this -``` - -Example: - -```cmd -set DEBUG=* & node app.js -``` - -##### PowerShell (VS Code default) - -PowerShell uses different syntax to set environment variables. - -```cmd -$env:DEBUG = "*,-not_this" -``` - -Example: - -```cmd -$env:DEBUG='app';node app.js -``` - -Then, run the program to be debugged as usual. - -npm script example: -```js - "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", -``` - -## Namespace Colors - -Every debug instance has a color generated for it based on its namespace name. -This helps when visually parsing the debug output to identify which debug instance -a debug line belongs to. - -#### Node.js - -In Node.js, colors are enabled when stderr is a TTY. You also _should_ install -the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, -otherwise debug will only use a small handful of basic colors. - - - -#### Web Browser - -Colors are also enabled on "Web Inspectors" that understand the `%c` formatting -option. These are WebKit web inspectors, Firefox ([since version -31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) -and the Firebug plugin for Firefox (any version). - - - - -## Millisecond diff - -When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - - -When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: - - - - -## Conventions - -If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. - -## Wildcards - -The `*` character may be used as a wildcard. Suppose for example your library has -debuggers named "connect:bodyParser", "connect:compress", "connect:session", -instead of listing all three with -`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do -`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - -You can also exclude specific debuggers by prefixing them with a "-" character. -For example, `DEBUG=*,-connect:*` would include all debuggers except those -starting with "connect:". - -## Environment Variables - -When running through Node.js, you can set a few environment variables that will -change the behavior of the debug logging: - -| Name | Purpose | -|-----------|-------------------------------------------------| -| `DEBUG` | Enables/disables specific debugging namespaces. | -| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | -| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | -| `DEBUG_DEPTH` | Object inspection depth. | -| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | - - -__Note:__ The environment variables beginning with `DEBUG_` end up being -converted into an Options object that gets used with `%o`/`%O` formatters. -See the Node.js documentation for -[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) -for the complete list. - -## Formatters - -Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. -Below are the officially supported formatters: - -| Formatter | Representation | -|-----------|----------------| -| `%O` | Pretty-print an Object on multiple lines. | -| `%o` | Pretty-print an Object all on a single line. | -| `%s` | String. | -| `%d` | Number (both integer and float). | -| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | -| `%%` | Single percent sign ('%'). This does not consume an argument. | - - -### Custom formatters - -You can add custom formatters by extending the `debug.formatters` object. -For example, if you wanted to add support for rendering a Buffer as hex with -`%h`, you could do something like: - -```js -const createDebug = require('debug') -createDebug.formatters.h = (v) => { - return v.toString('hex') -} - -// …elsewhere -const debug = createDebug('foo') -debug('this is hex: %h', new Buffer('hello world')) -// foo this is hex: 68656c6c6f20776f726c6421 +0ms -``` - - -## Browser Support - -You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), -or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), -if you don't want to build it yourself. - -Debug's enable state is currently persisted by `localStorage`. -Consider the situation shown below where you have `worker:a` and `worker:b`, -and wish to debug both. You can enable this using `localStorage.debug`: - -```js -localStorage.debug = 'worker:*' -``` - -And then refresh the page. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - - -## Output streams - - By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: - -Example [_stdout.js_](./examples/node/stdout.js): - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -## Extend -You can simply extend debugger -```js -const log = require('debug')('auth'); - -//creates new debug instance with extended namespace -const logSign = log.extend('sign'); -const logLogin = log.extend('login'); - -log('hello'); // auth hello -logSign('hello'); //auth:sign hello -logLogin('hello'); //auth:login hello -``` - -## Set dynamically - -You can also enable debug dynamically by calling the `enable()` method : - -```js -let debug = require('debug'); - -console.log(1, debug.enabled('test')); - -debug.enable('test'); -console.log(2, debug.enabled('test')); - -debug.disable(); -console.log(3, debug.enabled('test')); - -``` - -print : -``` -1 false -2 true -3 false -``` - -Usage : -`enable(namespaces)` -`namespaces` can include modes separated by a colon and wildcards. - -Note that calling `enable()` completely overrides previously set DEBUG variable : - -``` -$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' -=> false -``` - -`disable()` - -Will disable all namespaces. The functions returns the namespaces currently -enabled (and skipped). This can be useful if you want to disable debugging -temporarily without knowing what was enabled to begin with. - -For example: - -```js -let debug = require('debug'); -debug.enable('foo:*,-foo:bar'); -let namespaces = debug.disable(); -debug.enable(namespaces); -``` - -Note: There is no guarantee that the string will be identical to the initial -enable string, but semantically they will be identical. - -## Checking whether a debug target is enabled - -After you've created a debug instance, you can determine whether or not it is -enabled by checking the `enabled` property: - -```javascript -const debug = require('debug')('http'); - -if (debug.enabled) { - // do stuff... -} -``` - -You can also manually toggle this property to force the debug instance to be -enabled or disabled. - -## Usage in child processes - -Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. -For example: - -```javascript -worker = fork(WORKER_WRAP_PATH, [workerPath], { - stdio: [ - /* stdin: */ 0, - /* stdout: */ 'pipe', - /* stderr: */ 'pipe', - 'ipc', - ], - env: Object.assign({}, process.env, { - DEBUG_COLORS: 1 // without this settings, colors won't be shown - }), -}); - -worker.stderr.pipe(process.stderr, { end: false }); -``` - - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - - Andrew Rhyne - - Josh Junon - -## Backers - -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## License - -(The MIT License) - -Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> -Copyright (c) 2018-2021 Josh Junon - -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. diff --git a/tools/node_modules/eslint/node_modules/deep-is/README.markdown b/tools/node_modules/eslint/node_modules/deep-is/README.markdown deleted file mode 100644 index eb69a83bda12f8..00000000000000 --- a/tools/node_modules/eslint/node_modules/deep-is/README.markdown +++ /dev/null @@ -1,70 +0,0 @@ -deep-is -========== - -Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like -[deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`. - -This module is around [5 times faster](https://gist.github.com/2790507) -than wrapping `assert.deepEqual()` in a `try/catch`. - -[![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is) - -[![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is) - -example -======= - -``` js -var equal = require('deep-is'); -console.dir([ - equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - ), - equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - ) -]); -``` - -methods -======= - -var deepIs = require('deep-is') - -deepIs(a, b) ---------------- - -Compare objects `a` and `b`, returning whether they are equal according to a -recursive equality algorithm. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install deep-is -``` - -test -==== - -With [npm](http://npmjs.org) do: - -``` -npm test -``` - -license -======= - -Copyright (c) 2012, 2013 Thorsten Lorenz -Copyright (c) 2012 James Halliday - -Derived largely from node's assert module, which has the copyright statement: - -Copyright (c) 2009 Thomas Robinson <280north.com> - -Released under the MIT license, see LICENSE for details. diff --git a/tools/node_modules/eslint/node_modules/doctrine/README.md b/tools/node_modules/eslint/node_modules/doctrine/README.md deleted file mode 100644 index 26fad18b90d5c8..00000000000000 --- a/tools/node_modules/eslint/node_modules/doctrine/README.md +++ /dev/null @@ -1,165 +0,0 @@ -[![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Downloads][downloads-image]][downloads-url] -[![Join the chat at https://gitter.im/eslint/doctrine](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/doctrine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -# Doctrine - -Doctrine is a [JSDoc](http://usejsdoc.org) parser that parses documentation comments from JavaScript (you need to pass in the comment, not a whole JavaScript file). - -## Installation - -You can install Doctrine using [npm](https://npmjs.com): - -``` -$ npm install doctrine --save-dev -``` - -Doctrine can also be used in web browsers using [Browserify](http://browserify.org). - -## Usage - -Require doctrine inside of your JavaScript: - -```js -var doctrine = require("doctrine"); -``` - -### parse() - -The primary method is `parse()`, which accepts two arguments: the JSDoc comment to parse and an optional options object. The available options are: - -* `unwrap` - set to `true` to delete the leading `/**`, any `*` that begins a line, and the trailing `*/` from the source text. Default: `false`. -* `tags` - an array of tags to return. When specified, Doctrine returns only tags in this array. For example, if `tags` is `["param"]`, then only `@param` tags will be returned. Default: `null`. -* `recoverable` - set to `true` to keep parsing even when syntax errors occur. Default: `false`. -* `sloppy` - set to `true` to allow optional parameters to be specified in brackets (`@param {string} [foo]`). Default: `false`. -* `lineNumbers` - set to `true` to add `lineNumber` to each node, specifying the line on which the node is found in the source. Default: `false`. -* `range` - set to `true` to add `range` to each node, specifying the start and end index of the node in the original comment. Default: `false`. - -Here's a simple example: - -```js -var ast = doctrine.parse( - [ - "/**", - " * This function comment is parsed by doctrine", - " * @param {{ok:String}} userName", - "*/" - ].join('\n'), { unwrap: true }); -``` - -This example returns the following AST: - - { - "description": "This function comment is parsed by doctrine", - "tags": [ - { - "title": "param", - "description": null, - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "ok", - "value": { - "type": "NameExpression", - "name": "String" - } - } - ] - }, - "name": "userName" - } - ] - } - -See the [demo page](http://eslint.org/doctrine/demo/) more detail. - -## Team - -These folks keep the project moving and are resources for help: - -* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead -* Yusuke Suzuki ([@constellation](https://github.com/constellation)) - reviewer - -## Contributing - -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/doctrine/issues). - -## Frequently Asked Questions - -### Can I pass a whole JavaScript file to Doctrine? - -No. Doctrine can only parse JSDoc comments, so you'll need to pass just the JSDoc comment to Doctrine in order to work. - - -### License - -#### doctrine - -Copyright JS Foundation and other contributors, https://js.foundation - -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. - -#### esprima - -some of functions is derived from esprima - -Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) - (twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -#### closure-compiler - -some of extensions is derived from closure-compiler - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - - -### Where to ask for help? - -Join our [Chatroom](https://gitter.im/eslint/doctrine) - -[npm-image]: https://img.shields.io/npm/v/doctrine.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/doctrine -[travis-image]: https://img.shields.io/travis/eslint/doctrine/master.svg?style=flat-square -[travis-url]: https://travis-ci.org/eslint/doctrine -[coveralls-image]: https://img.shields.io/coveralls/eslint/doctrine/master.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/eslint/doctrine?branch=master -[downloads-image]: http://img.shields.io/npm/dm/doctrine.svg?style=flat-square -[downloads-url]: https://www.npmjs.com/package/doctrine diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/README.md b/tools/node_modules/eslint/node_modules/electron-to-chromium/README.md deleted file mode 100644 index a96ddf12afe27d..00000000000000 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/README.md +++ /dev/null @@ -1,186 +0,0 @@ -### Made by [@kilianvalkhof](https://twitter.com/kilianvalkhof) - -#### Other projects: - -- 💻 [Polypane](https://polypane.app) - Develop responsive websites and apps twice as fast on multiple screens at once -- 🖌️ [Superposition](https://superposition.design) - Kickstart your design system by extracting design tokens from your website -- 🗒️ [FromScratch](https://fromscratch.rocks) - A smart but simple autosaving scratchpad - ---- - -# Electron-to-Chromium [![npm](https://img.shields.io/npm/v/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![travis](https://img.shields.io/travis/Kilian/electron-to-chromium/master.svg)](https://travis-ci.org/Kilian/electron-to-chromium) [![npm-downloads](https://img.shields.io/npm/dm/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![codecov](https://codecov.io/gh/Kilian/electron-to-chromium/branch/master/graph/badge.svg)](https://codecov.io/gh/Kilian/electron-to-chromium)[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_shield) - -This repository provides a mapping of Electron versions to the Chromium version that it uses. - -This package is used in [Browserslist](https://github.com/ai/browserslist), so you can use e.g. `electron >= 1.4` in [Autoprefixer](https://github.com/postcss/autoprefixer), [Stylelint](https://github.com/stylelint/stylelint), [babel-preset-env](https://github.com/babel/babel-preset-env) and [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat). - -**Supported by:** - - - - - - -## Install -Install using `npm install electron-to-chromium`. - -## Usage -To include Electron-to-Chromium, require it: - -```js -var e2c = require('electron-to-chromium'); -``` - -### Properties -The Electron-to-Chromium object has 4 properties to use: - -#### `versions` -An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value. - -```js -var versions = e2c.versions; -console.log(versions['1.4']); -// returns "53" -``` - -#### `fullVersions` -An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value. - -```js -var versions = e2c.fullVersions; -console.log(versions['1.4.11']); -// returns "53.0.2785.143" -``` - -#### `chromiumVersions` -An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value. - -```js -var versions = e2c.chromiumVersions; -console.log(versions['54']); -// returns "1.4" -``` - -#### `fullChromiumVersions` -An object of key-value pairs with a Chromium version as the key, and an array of the corresponding major Electron versions as the value. - -```js -var versions = e2c.fullChromiumVersions; -console.log(versions['54.0.2840.101']); -// returns ["1.5.1", "1.5.0"] -``` -### Functions - -#### `electronToChromium(query)` -Arguments: -* Query: string or number, required. A major or full Electron version. - -A function that returns the corresponding Chromium version for a given Electron function. Returns a string. - -If you provide it with a major Electron version, it will return a major Chromium version: - -```js -var chromeVersion = e2c.electronToChromium('1.4'); -// chromeVersion is "53" -``` - -If you provide it with a full Electron version, it will return the full Chromium version. - -```js -var chromeVersion = e2c.electronToChromium('1.4.11'); -// chromeVersion is "53.0.2785.143" -``` - -If a query does not match a Chromium version, it will return `undefined`. - -```js -var chromeVersion = e2c.electronToChromium('9000'); -// chromeVersion is undefined -``` - -#### `chromiumToElectron(query)` -Arguments: -* Query: string or number, required. A major or full Chromium version. - -Returns a string with the corresponding Electron version for a given Chromium query. - -If you provide it with a major Chromium version, it will return a major Electron version: - -```js -var electronVersion = e2c.chromiumToElectron('54'); -// electronVersion is "1.4" -``` - -If you provide it with a full Chrome version, it will return an array of full Electron versions. - -```js -var electronVersions = e2c.chromiumToElectron('56.0.2924.87'); -// electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"] -``` - -If a query does not match an Electron version, it will return `undefined`. - -```js -var electronVersion = e2c.chromiumToElectron('10'); -// electronVersion is undefined -``` - -#### `electronToBrowserList(query)` **DEPRECATED** -Arguments: -* Query: string or number, required. A major Electron version. - -_**Deprecated**: Browserlist already includes electron-to-chromium._ - -A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string. - -If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities: - -```js -var query = e2c.electronToBrowserList('1.4'); -// query is "Chrome >= 53" -``` - -If a query does not match a Chromium version, it will return `undefined`. - -```js -var query = e2c.electronToBrowserList('9000'); -// query is undefined -``` - -### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions -All lists can be imported on their own, if file size is a concern. - -#### `versions` - -```js -var versions = require('electron-to-chromium/versions'); -``` - -#### `fullVersions` - -```js -var fullVersions = require('electron-to-chromium/full-versions'); -``` - -#### `chromiumVersions` - -```js -var chromiumVersions = require('electron-to-chromium/chromium-versions'); -``` - -#### `fullChromiumVersions` - -```js -var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions'); -``` - -## Updating -This package will be updated with each new Electron release. - -To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions. - -To verify correct behaviour, run `npm test`. - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_large) diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.js b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.js index 00285c69154acd..e05d430979aaee 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.js +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.js @@ -1374,7 +1374,8 @@ module.exports = { "13.5.2", "13.6.0", "13.6.1", - "13.6.2" + "13.6.2", + "13.6.3" ], "92.0.4511.0": [ "14.0.0-beta.1", @@ -1489,7 +1490,8 @@ module.exports = { "14.1.0", "14.1.1", "14.2.0", - "14.2.1" + "14.2.1", + "14.2.2" ], "94.0.4584.0": [ "15.0.0-alpha.3", @@ -1572,7 +1574,8 @@ module.exports = { "15.2.0", "15.3.0", "15.3.1", - "15.3.2" + "15.3.2", + "15.3.3" ], "95.0.4629.0": [ "16.0.0-alpha.1", @@ -1652,7 +1655,8 @@ module.exports = { "16.0.1" ], "96.0.4664.55": [ - "16.0.2" + "16.0.2", + "16.0.3" ], "96.0.4664.4": [ "17.0.0-alpha.1", @@ -1686,6 +1690,8 @@ module.exports = { "17.0.0-alpha.4", "18.0.0-nightly.20211124", "18.0.0-nightly.20211125", - "18.0.0-nightly.20211126" + "18.0.0-nightly.20211126", + "18.0.0-nightly.20211129", + "18.0.0-nightly.20211130" ] }; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.json b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.json index ff33a1f6b99055..ca2d777cbe818b 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.json +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-chromium-versions.json @@ -1 +1 @@ -{"39.0.2171.65":["0.20.0","0.20.1","0.20.2","0.20.3","0.20.4","0.20.5","0.20.6","0.20.7","0.20.8"],"40.0.2214.91":["0.21.0","0.21.1","0.21.2"],"41.0.2272.76":["0.21.3","0.22.1","0.22.2","0.22.3","0.23.0","0.24.0"],"42.0.2311.107":["0.25.0","0.25.1","0.25.2","0.25.3","0.26.0","0.26.1","0.27.0","0.27.1"],"43.0.2357.65":["0.27.2","0.27.3","0.28.0","0.28.1","0.28.2","0.28.3","0.29.1","0.29.2"],"44.0.2403.125":["0.30.4","0.31.0"],"45.0.2454.85":["0.31.2","0.32.2","0.32.3","0.33.0","0.33.1","0.33.2","0.33.3","0.33.4","0.33.6","0.33.7","0.33.8","0.33.9","0.34.0","0.34.1","0.34.2","0.34.3","0.34.4","0.35.1","0.35.2","0.35.3","0.35.4","0.35.5"],"47.0.2526.73":["0.36.0","0.36.2","0.36.3","0.36.4"],"47.0.2526.110":["0.36.5","0.36.6","0.36.7","0.36.8","0.36.9","0.36.10","0.36.11","0.36.12"],"49.0.2623.75":["0.37.0","0.37.1","0.37.3","0.37.4","0.37.5","0.37.6","0.37.7","0.37.8","1.0.0","1.0.1","1.0.2"],"50.0.2661.102":["1.1.0","1.1.1","1.1.2","1.1.3"],"51.0.2704.63":["1.2.0","1.2.1"],"51.0.2704.84":["1.2.2","1.2.3"],"51.0.2704.103":["1.2.4","1.2.5"],"51.0.2704.106":["1.2.6","1.2.7","1.2.8"],"52.0.2743.82":["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.9","1.3.10","1.3.13","1.3.14","1.3.15"],"53.0.2785.113":["1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5"],"53.0.2785.143":["1.4.6","1.4.7","1.4.8","1.4.10","1.4.11","1.4.13","1.4.14","1.4.15","1.4.16"],"54.0.2840.51":["1.4.12"],"54.0.2840.101":["1.5.0","1.5.1"],"56.0.2924.87":["1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.6.6","1.6.7","1.6.8","1.6.9","1.6.10","1.6.11","1.6.12","1.6.13","1.6.14","1.6.15","1.6.16","1.6.17","1.6.18"],"58.0.3029.110":["1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.7","1.7.8","1.7.9","1.7.10","1.7.11","1.7.12","1.7.13","1.7.14","1.7.15","1.7.16"],"59.0.3071.115":["1.8.0","1.8.1","1.8.2-beta.1","1.8.2-beta.2","1.8.2-beta.3","1.8.2-beta.4","1.8.2-beta.5","1.8.2","1.8.3","1.8.4","1.8.5","1.8.6","1.8.7","1.8.8"],"61.0.3163.100":["2.0.0-beta.1","2.0.0-beta.2","2.0.0-beta.3","2.0.0-beta.4","2.0.0-beta.5","2.0.0-beta.6","2.0.0-beta.7","2.0.0-beta.8","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8-nightly.20180819","2.0.8-nightly.20180820","2.0.8","2.0.9","2.0.10","2.0.11","2.0.12","2.0.13","2.0.14","2.0.15","2.0.16","2.0.17","2.0.18","2.1.0-unsupported.20180809"],"66.0.3359.181":["3.0.0-beta.1","3.0.0-beta.2","3.0.0-beta.3","3.0.0-beta.4","3.0.0-beta.5","3.0.0-beta.6","3.0.0-beta.7","3.0.0-beta.8","3.0.0-beta.9","3.0.0-beta.10","3.0.0-beta.11","3.0.0-beta.12","3.0.0-beta.13","3.0.0-nightly.20180818","3.0.0-nightly.20180821","3.0.0-nightly.20180823","3.0.0-nightly.20180904","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.7","3.0.8","3.0.9","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.1.0-beta.1","3.1.0-beta.2","3.1.0-beta.3","3.1.0-beta.4","3.1.0-beta.5","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","3.1.10","3.1.11","3.1.12","3.1.13","4.0.0-nightly.20180817","4.0.0-nightly.20180819","4.0.0-nightly.20180821"],"69.0.3497.106":["4.0.0-beta.1","4.0.0-beta.2","4.0.0-beta.3","4.0.0-beta.4","4.0.0-beta.5","4.0.0-beta.6","4.0.0-beta.7","4.0.0-beta.8","4.0.0-beta.9","4.0.0-beta.10","4.0.0-beta.11","4.0.0-nightly.20181010","4.0.0","4.0.1","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6"],"67.0.3396.99":["4.0.0-nightly.20180929"],"68.0.3440.128":["4.0.0-nightly.20181006"],"69.0.3497.128":["4.0.7","4.0.8","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.1.5","4.2.0","4.2.1","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.2.10","4.2.11","4.2.12"],"72.0.3626.52":["5.0.0-beta.1","5.0.0-beta.2"],"73.0.3683.27":["5.0.0-beta.3"],"73.0.3683.54":["5.0.0-beta.4"],"73.0.3683.61":["5.0.0-beta.5"],"73.0.3683.84":["5.0.0-beta.6"],"73.0.3683.94":["5.0.0-beta.7"],"73.0.3683.104":["5.0.0-beta.8"],"73.0.3683.117":["5.0.0-beta.9"],"70.0.3538.110":["5.0.0-nightly.20190107"],"71.0.3578.98":["5.0.0-nightly.20190121","5.0.0-nightly.20190122"],"73.0.3683.119":["5.0.0"],"73.0.3683.121":["5.0.1","5.0.2","5.0.3","5.0.4","5.0.5","5.0.6","5.0.7","5.0.8","5.0.9","5.0.10","5.0.11","5.0.12","5.0.13"],"76.0.3774.1":["6.0.0-beta.1"],"76.0.3783.1":["6.0.0-beta.2","6.0.0-beta.3","6.0.0-beta.4"],"76.0.3805.4":["6.0.0-beta.5"],"76.0.3809.3":["6.0.0-beta.6"],"76.0.3809.22":["6.0.0-beta.7"],"76.0.3809.26":["6.0.0-beta.8","6.0.0-beta.9"],"76.0.3809.37":["6.0.0-beta.10"],"76.0.3809.42":["6.0.0-beta.11"],"76.0.3809.54":["6.0.0-beta.12"],"76.0.3809.60":["6.0.0-beta.13"],"76.0.3809.68":["6.0.0-beta.14"],"76.0.3809.74":["6.0.0-beta.15"],"72.0.3626.107":["6.0.0-nightly.20190212"],"72.0.3626.110":["6.0.0-nightly.20190213"],"74.0.3724.8":["6.0.0-nightly.20190311"],"76.0.3809.88":["6.0.0"],"76.0.3809.102":["6.0.1"],"76.0.3809.110":["6.0.2"],"76.0.3809.126":["6.0.3"],"76.0.3809.131":["6.0.4"],"76.0.3809.136":["6.0.5"],"76.0.3809.138":["6.0.6"],"76.0.3809.139":["6.0.7"],"76.0.3809.146":["6.0.8","6.0.9","6.0.10","6.0.11","6.0.12","6.1.0","6.1.1","6.1.2","6.1.3","6.1.4","6.1.5","6.1.6","6.1.7","6.1.8","6.1.9","6.1.10","6.1.11","6.1.12"],"78.0.3866.0":["7.0.0-beta.1","7.0.0-beta.2","7.0.0-beta.3","7.0.0-nightly.20190727","7.0.0-nightly.20190728","7.0.0-nightly.20190729","7.0.0-nightly.20190730","7.0.0-nightly.20190731","8.0.0-nightly.20190801","8.0.0-nightly.20190802"],"78.0.3896.6":["7.0.0-beta.4"],"78.0.3905.1":["7.0.0-beta.5","7.0.0-beta.6","7.0.0-beta.7","7.0.0"],"76.0.3784.0":["7.0.0-nightly.20190521"],"76.0.3806.0":["7.0.0-nightly.20190529","7.0.0-nightly.20190530","7.0.0-nightly.20190531","7.0.0-nightly.20190602","7.0.0-nightly.20190603"],"77.0.3814.0":["7.0.0-nightly.20190604"],"77.0.3815.0":["7.0.0-nightly.20190605","7.0.0-nightly.20190606","7.0.0-nightly.20190607","7.0.0-nightly.20190608","7.0.0-nightly.20190609","7.0.0-nightly.20190611","7.0.0-nightly.20190612","7.0.0-nightly.20190613","7.0.0-nightly.20190615","7.0.0-nightly.20190616","7.0.0-nightly.20190618","7.0.0-nightly.20190619","7.0.0-nightly.20190622","7.0.0-nightly.20190623","7.0.0-nightly.20190624","7.0.0-nightly.20190627","7.0.0-nightly.20190629","7.0.0-nightly.20190630","7.0.0-nightly.20190701","7.0.0-nightly.20190702"],"77.0.3843.0":["7.0.0-nightly.20190704","7.0.0-nightly.20190705"],"77.0.3848.0":["7.0.0-nightly.20190719","7.0.0-nightly.20190720","7.0.0-nightly.20190721"],"77.0.3864.0":["7.0.0-nightly.20190726"],"78.0.3904.92":["7.0.1"],"78.0.3904.94":["7.1.0"],"78.0.3904.99":["7.1.1"],"78.0.3904.113":["7.1.2"],"78.0.3904.126":["7.1.3"],"78.0.3904.130":["7.1.4","7.1.5","7.1.6","7.1.7","7.1.8","7.1.9","7.1.10","7.1.11","7.1.12","7.1.13","7.1.14","7.2.0","7.2.1","7.2.2","7.2.3","7.2.4","7.3.0","7.3.1","7.3.2","7.3.3"],"79.0.3931.0":["8.0.0-beta.1","8.0.0-beta.2","8.0.0-nightly.20191019","8.0.0-nightly.20191020","8.0.0-nightly.20191021","8.0.0-nightly.20191023"],"80.0.3955.0":["8.0.0-beta.3","8.0.0-beta.4"],"80.0.3987.14":["8.0.0-beta.5"],"80.0.3987.51":["8.0.0-beta.6"],"80.0.3987.59":["8.0.0-beta.7"],"80.0.3987.75":["8.0.0-beta.8","8.0.0-beta.9"],"78.0.3871.0":["8.0.0-nightly.20190803","8.0.0-nightly.20190806","8.0.0-nightly.20190807","8.0.0-nightly.20190808","8.0.0-nightly.20190809","8.0.0-nightly.20190810","8.0.0-nightly.20190811","8.0.0-nightly.20190812","8.0.0-nightly.20190813","8.0.0-nightly.20190814","8.0.0-nightly.20190815"],"78.0.3881.0":["8.0.0-nightly.20190816","8.0.0-nightly.20190817","8.0.0-nightly.20190818","8.0.0-nightly.20190819","8.0.0-nightly.20190820"],"78.0.3892.0":["8.0.0-nightly.20190824","8.0.0-nightly.20190825","8.0.0-nightly.20190827","8.0.0-nightly.20190828","8.0.0-nightly.20190830","8.0.0-nightly.20190901","8.0.0-nightly.20190902","8.0.0-nightly.20190907","8.0.0-nightly.20190909","8.0.0-nightly.20190910","8.0.0-nightly.20190911","8.0.0-nightly.20190913","8.0.0-nightly.20190914","8.0.0-nightly.20190915","8.0.0-nightly.20190917"],"79.0.3915.0":["8.0.0-nightly.20190919","8.0.0-nightly.20190920"],"79.0.3919.0":["8.0.0-nightly.20190923","8.0.0-nightly.20190924","8.0.0-nightly.20190926","8.0.0-nightly.20190929","8.0.0-nightly.20190930","8.0.0-nightly.20191001","8.0.0-nightly.20191004","8.0.0-nightly.20191005","8.0.0-nightly.20191006","8.0.0-nightly.20191009","8.0.0-nightly.20191011","8.0.0-nightly.20191012","8.0.0-nightly.20191017"],"80.0.3952.0":["8.0.0-nightly.20191101","8.0.0-nightly.20191105"],"80.0.3987.86":["8.0.0","8.0.1","8.0.2"],"80.0.3987.134":["8.0.3"],"80.0.3987.137":["8.1.0"],"80.0.3987.141":["8.1.1"],"80.0.3987.158":["8.2.0"],"80.0.3987.163":["8.2.1","8.2.2","8.2.3","8.5.3","8.5.4","8.5.5"],"80.0.3987.165":["8.2.4","8.2.5","8.3.0","8.3.1","8.3.2","8.3.3","8.3.4","8.4.0","8.4.1","8.5.0","8.5.1","8.5.2"],"82.0.4048.0":["9.0.0-beta.1","9.0.0-beta.2","9.0.0-beta.3","9.0.0-beta.4","9.0.0-beta.5"],"82.0.4058.2":["9.0.0-beta.6","9.0.0-beta.7","9.0.0-beta.9"],"82.0.4085.10":["9.0.0-beta.10"],"82.0.4085.14":["9.0.0-beta.12","9.0.0-beta.13"],"82.0.4085.27":["9.0.0-beta.14"],"83.0.4102.3":["9.0.0-beta.15","9.0.0-beta.16"],"83.0.4103.14":["9.0.0-beta.17"],"83.0.4103.16":["9.0.0-beta.18"],"83.0.4103.24":["9.0.0-beta.19"],"83.0.4103.26":["9.0.0-beta.20","9.0.0-beta.21"],"83.0.4103.34":["9.0.0-beta.22"],"83.0.4103.44":["9.0.0-beta.23"],"83.0.4103.45":["9.0.0-beta.24"],"80.0.3954.0":["9.0.0-nightly.20191121","9.0.0-nightly.20191122","9.0.0-nightly.20191123","9.0.0-nightly.20191124","9.0.0-nightly.20191129","9.0.0-nightly.20191130","9.0.0-nightly.20191201","9.0.0-nightly.20191202","9.0.0-nightly.20191203","9.0.0-nightly.20191204","9.0.0-nightly.20191210"],"81.0.3994.0":["9.0.0-nightly.20191220","9.0.0-nightly.20191221","9.0.0-nightly.20191222","9.0.0-nightly.20191223","9.0.0-nightly.20191224","9.0.0-nightly.20191225","9.0.0-nightly.20191226","9.0.0-nightly.20191228","9.0.0-nightly.20191229","9.0.0-nightly.20191230","9.0.0-nightly.20191231","9.0.0-nightly.20200101","9.0.0-nightly.20200103","9.0.0-nightly.20200104","9.0.0-nightly.20200105","9.0.0-nightly.20200106","9.0.0-nightly.20200108","9.0.0-nightly.20200109","9.0.0-nightly.20200110","9.0.0-nightly.20200111","9.0.0-nightly.20200113","9.0.0-nightly.20200115","9.0.0-nightly.20200116","9.0.0-nightly.20200117"],"81.0.4030.0":["9.0.0-nightly.20200119","9.0.0-nightly.20200121"],"83.0.4103.64":["9.0.0"],"83.0.4103.94":["9.0.1","9.0.2"],"83.0.4103.100":["9.0.3"],"83.0.4103.104":["9.0.4"],"83.0.4103.119":["9.0.5"],"83.0.4103.122":["9.1.0","9.1.1","9.1.2","9.2.0","9.2.1","9.3.0","9.3.1","9.3.2","9.3.3","9.3.4","9.3.5","9.4.0","9.4.1","9.4.2","9.4.3","9.4.4"],"84.0.4129.0":["10.0.0-beta.1","10.0.0-beta.2","10.0.0-nightly.20200501","10.0.0-nightly.20200504","10.0.0-nightly.20200505","10.0.0-nightly.20200506","10.0.0-nightly.20200507","10.0.0-nightly.20200508","10.0.0-nightly.20200511","10.0.0-nightly.20200512","10.0.0-nightly.20200513","10.0.0-nightly.20200514","10.0.0-nightly.20200515","10.0.0-nightly.20200518","10.0.0-nightly.20200519","10.0.0-nightly.20200520","10.0.0-nightly.20200521","11.0.0-nightly.20200525","11.0.0-nightly.20200526"],"85.0.4161.2":["10.0.0-beta.3","10.0.0-beta.4"],"85.0.4181.1":["10.0.0-beta.8","10.0.0-beta.9"],"85.0.4183.19":["10.0.0-beta.10"],"85.0.4183.20":["10.0.0-beta.11"],"85.0.4183.26":["10.0.0-beta.12"],"85.0.4183.39":["10.0.0-beta.13","10.0.0-beta.14","10.0.0-beta.15","10.0.0-beta.17","10.0.0-beta.19","10.0.0-beta.20","10.0.0-beta.21"],"85.0.4183.70":["10.0.0-beta.23"],"85.0.4183.78":["10.0.0-beta.24"],"85.0.4183.80":["10.0.0-beta.25"],"82.0.4050.0":["10.0.0-nightly.20200209","10.0.0-nightly.20200210","10.0.0-nightly.20200211","10.0.0-nightly.20200216","10.0.0-nightly.20200217","10.0.0-nightly.20200218","10.0.0-nightly.20200221","10.0.0-nightly.20200222","10.0.0-nightly.20200223","10.0.0-nightly.20200226","10.0.0-nightly.20200303"],"82.0.4076.0":["10.0.0-nightly.20200304","10.0.0-nightly.20200305","10.0.0-nightly.20200306","10.0.0-nightly.20200309","10.0.0-nightly.20200310"],"82.0.4083.0":["10.0.0-nightly.20200311"],"83.0.4086.0":["10.0.0-nightly.20200316"],"83.0.4087.0":["10.0.0-nightly.20200317","10.0.0-nightly.20200318","10.0.0-nightly.20200320","10.0.0-nightly.20200323","10.0.0-nightly.20200324","10.0.0-nightly.20200325","10.0.0-nightly.20200326","10.0.0-nightly.20200327","10.0.0-nightly.20200330","10.0.0-nightly.20200331","10.0.0-nightly.20200401","10.0.0-nightly.20200402","10.0.0-nightly.20200403","10.0.0-nightly.20200406"],"83.0.4095.0":["10.0.0-nightly.20200408","10.0.0-nightly.20200410","10.0.0-nightly.20200413"],"84.0.4114.0":["10.0.0-nightly.20200414"],"84.0.4115.0":["10.0.0-nightly.20200415","10.0.0-nightly.20200416","10.0.0-nightly.20200417"],"84.0.4121.0":["10.0.0-nightly.20200422","10.0.0-nightly.20200423"],"84.0.4125.0":["10.0.0-nightly.20200427","10.0.0-nightly.20200428","10.0.0-nightly.20200429","10.0.0-nightly.20200430"],"85.0.4183.84":["10.0.0"],"85.0.4183.86":["10.0.1"],"85.0.4183.87":["10.1.0"],"85.0.4183.93":["10.1.1"],"85.0.4183.98":["10.1.2"],"85.0.4183.121":["10.1.3","10.1.4","10.1.5","10.1.6","10.1.7","10.2.0","10.3.0","10.3.1","10.3.2","10.4.0","10.4.1","10.4.2","10.4.3","10.4.4","10.4.5","10.4.6","10.4.7"],"86.0.4234.0":["11.0.0-beta.1","11.0.0-beta.3","11.0.0-beta.4","11.0.0-beta.5","11.0.0-beta.6","11.0.0-beta.7","11.0.0-nightly.20200822","11.0.0-nightly.20200824","11.0.0-nightly.20200825","11.0.0-nightly.20200826","12.0.0-nightly.20200827","12.0.0-nightly.20200831","12.0.0-nightly.20200902","12.0.0-nightly.20200903","12.0.0-nightly.20200907","12.0.0-nightly.20200910","12.0.0-nightly.20200911","12.0.0-nightly.20200914"],"87.0.4251.1":["11.0.0-beta.8","11.0.0-beta.9","11.0.0-beta.11"],"87.0.4280.11":["11.0.0-beta.12","11.0.0-beta.13"],"87.0.4280.27":["11.0.0-beta.16","11.0.0-beta.17","11.0.0-beta.18","11.0.0-beta.19"],"87.0.4280.40":["11.0.0-beta.20"],"87.0.4280.47":["11.0.0-beta.22","11.0.0-beta.23"],"85.0.4156.0":["11.0.0-nightly.20200529"],"85.0.4162.0":["11.0.0-nightly.20200602","11.0.0-nightly.20200603","11.0.0-nightly.20200604","11.0.0-nightly.20200609","11.0.0-nightly.20200610","11.0.0-nightly.20200611","11.0.0-nightly.20200615","11.0.0-nightly.20200616","11.0.0-nightly.20200617","11.0.0-nightly.20200618","11.0.0-nightly.20200619"],"85.0.4179.0":["11.0.0-nightly.20200701","11.0.0-nightly.20200702","11.0.0-nightly.20200703","11.0.0-nightly.20200706","11.0.0-nightly.20200707","11.0.0-nightly.20200708","11.0.0-nightly.20200709"],"86.0.4203.0":["11.0.0-nightly.20200716","11.0.0-nightly.20200717","11.0.0-nightly.20200720","11.0.0-nightly.20200721"],"86.0.4209.0":["11.0.0-nightly.20200723","11.0.0-nightly.20200724","11.0.0-nightly.20200729","11.0.0-nightly.20200730","11.0.0-nightly.20200731","11.0.0-nightly.20200803","11.0.0-nightly.20200804","11.0.0-nightly.20200805","11.0.0-nightly.20200811","11.0.0-nightly.20200812"],"87.0.4280.60":["11.0.0","11.0.1"],"87.0.4280.67":["11.0.2","11.0.3","11.0.4"],"87.0.4280.88":["11.0.5","11.1.0","11.1.1"],"87.0.4280.141":["11.2.0","11.2.1","11.2.2","11.2.3","11.3.0","11.4.0","11.4.1","11.4.2","11.4.3","11.4.4","11.4.5","11.4.6","11.4.7","11.4.8","11.4.9","11.4.10","11.4.11","11.4.12","11.5.0"],"89.0.4328.0":["12.0.0-beta.1","12.0.0-beta.3","12.0.0-beta.4","12.0.0-beta.5","12.0.0-beta.6","12.0.0-beta.7","12.0.0-beta.8","12.0.0-beta.9","12.0.0-beta.10","12.0.0-beta.11","12.0.0-beta.12","12.0.0-beta.14","13.0.0-nightly.20201119","13.0.0-nightly.20201123","13.0.0-nightly.20201124","13.0.0-nightly.20201126","13.0.0-nightly.20201127","13.0.0-nightly.20201130","13.0.0-nightly.20201201","13.0.0-nightly.20201202","13.0.0-nightly.20201203","13.0.0-nightly.20201204","13.0.0-nightly.20201207","13.0.0-nightly.20201208","13.0.0-nightly.20201209","13.0.0-nightly.20201210","13.0.0-nightly.20201211","13.0.0-nightly.20201214"],"89.0.4348.1":["12.0.0-beta.16","12.0.0-beta.18","12.0.0-beta.19","12.0.0-beta.20"],"89.0.4388.2":["12.0.0-beta.21","12.0.0-beta.22","12.0.0-beta.23","12.0.0-beta.24","12.0.0-beta.25","12.0.0-beta.26"],"89.0.4389.23":["12.0.0-beta.27","12.0.0-beta.28","12.0.0-beta.29"],"89.0.4389.58":["12.0.0-beta.30","12.0.0-beta.31"],"87.0.4268.0":["12.0.0-nightly.20201013","12.0.0-nightly.20201014","12.0.0-nightly.20201015"],"88.0.4292.0":["12.0.0-nightly.20201023","12.0.0-nightly.20201026"],"88.0.4306.0":["12.0.0-nightly.20201030","12.0.0-nightly.20201102","12.0.0-nightly.20201103","12.0.0-nightly.20201104","12.0.0-nightly.20201105","12.0.0-nightly.20201106","12.0.0-nightly.20201111","12.0.0-nightly.20201112"],"88.0.4324.0":["12.0.0-nightly.20201116"],"89.0.4389.69":["12.0.0"],"89.0.4389.82":["12.0.1"],"89.0.4389.90":["12.0.2"],"89.0.4389.114":["12.0.3","12.0.4"],"89.0.4389.128":["12.0.5","12.0.6","12.0.7","12.0.8","12.0.9","12.0.10","12.0.11","12.0.12","12.0.13","12.0.14","12.0.15","12.0.16","12.0.17","12.0.18","12.1.0","12.1.1","12.1.2","12.2.0","12.2.1","12.2.2","12.2.3"],"90.0.4402.0":["13.0.0-beta.2","13.0.0-beta.3","13.0.0-nightly.20210210","13.0.0-nightly.20210211","13.0.0-nightly.20210212","13.0.0-nightly.20210216","13.0.0-nightly.20210217","13.0.0-nightly.20210218","13.0.0-nightly.20210219","13.0.0-nightly.20210222","13.0.0-nightly.20210225","13.0.0-nightly.20210226","13.0.0-nightly.20210301","13.0.0-nightly.20210302","13.0.0-nightly.20210303","14.0.0-nightly.20210304"],"90.0.4415.0":["13.0.0-beta.4","13.0.0-beta.5","13.0.0-beta.6","13.0.0-beta.7","13.0.0-beta.8","13.0.0-beta.9","13.0.0-beta.11","13.0.0-beta.12","13.0.0-beta.13","14.0.0-nightly.20210305","14.0.0-nightly.20210308","14.0.0-nightly.20210309","14.0.0-nightly.20210311","14.0.0-nightly.20210315","14.0.0-nightly.20210316","14.0.0-nightly.20210317","14.0.0-nightly.20210318","14.0.0-nightly.20210319","14.0.0-nightly.20210323","14.0.0-nightly.20210324","14.0.0-nightly.20210325","14.0.0-nightly.20210326","14.0.0-nightly.20210329","14.0.0-nightly.20210330"],"91.0.4448.0":["13.0.0-beta.14","13.0.0-beta.16","13.0.0-beta.17","13.0.0-beta.18","13.0.0-beta.20","14.0.0-nightly.20210331","14.0.0-nightly.20210401","14.0.0-nightly.20210402","14.0.0-nightly.20210406","14.0.0-nightly.20210407","14.0.0-nightly.20210408","14.0.0-nightly.20210409","14.0.0-nightly.20210413"],"91.0.4472.33":["13.0.0-beta.21","13.0.0-beta.22","13.0.0-beta.23"],"91.0.4472.38":["13.0.0-beta.24","13.0.0-beta.26","13.0.0-beta.27","13.0.0-beta.28"],"89.0.4349.0":["13.0.0-nightly.20201215","13.0.0-nightly.20201216","13.0.0-nightly.20201221","13.0.0-nightly.20201222"],"89.0.4359.0":["13.0.0-nightly.20201223","13.0.0-nightly.20210104","13.0.0-nightly.20210108","13.0.0-nightly.20210111"],"89.0.4386.0":["13.0.0-nightly.20210113","13.0.0-nightly.20210114","13.0.0-nightly.20210118","13.0.0-nightly.20210122","13.0.0-nightly.20210125"],"89.0.4389.0":["13.0.0-nightly.20210127","13.0.0-nightly.20210128","13.0.0-nightly.20210129","13.0.0-nightly.20210201","13.0.0-nightly.20210202","13.0.0-nightly.20210203","13.0.0-nightly.20210205","13.0.0-nightly.20210208","13.0.0-nightly.20210209"],"91.0.4472.69":["13.0.0","13.0.1"],"91.0.4472.77":["13.1.0","13.1.1","13.1.2"],"91.0.4472.106":["13.1.3","13.1.4"],"91.0.4472.124":["13.1.5","13.1.6","13.1.7"],"91.0.4472.164":["13.1.8","13.1.9","13.2.0","13.2.1","13.2.2","13.2.3","13.3.0","13.4.0","13.5.0","13.5.1","13.5.2","13.6.0","13.6.1","13.6.2"],"92.0.4511.0":["14.0.0-beta.1","14.0.0-beta.2","14.0.0-beta.3","14.0.0-nightly.20210520","14.0.0-nightly.20210523","14.0.0-nightly.20210524","15.0.0-nightly.20210527","15.0.0-nightly.20210528","15.0.0-nightly.20210531","15.0.0-nightly.20210601","15.0.0-nightly.20210602"],"93.0.4536.0":["14.0.0-beta.5","14.0.0-beta.6","14.0.0-beta.7","14.0.0-beta.8","15.0.0-nightly.20210609","15.0.0-nightly.20210610","15.0.0-nightly.20210611","15.0.0-nightly.20210614","15.0.0-nightly.20210615","15.0.0-nightly.20210616"],"93.0.4539.0":["14.0.0-beta.9","14.0.0-beta.10","15.0.0-nightly.20210617","15.0.0-nightly.20210618","15.0.0-nightly.20210621","15.0.0-nightly.20210622"],"93.0.4557.4":["14.0.0-beta.11","14.0.0-beta.12"],"93.0.4566.0":["14.0.0-beta.13","14.0.0-beta.14","14.0.0-beta.15","14.0.0-beta.16","14.0.0-beta.17","15.0.0-alpha.1","15.0.0-alpha.2","15.0.0-nightly.20210706","15.0.0-nightly.20210707","15.0.0-nightly.20210708","15.0.0-nightly.20210709","15.0.0-nightly.20210712","15.0.0-nightly.20210713","15.0.0-nightly.20210714","15.0.0-nightly.20210715","15.0.0-nightly.20210716","15.0.0-nightly.20210719","15.0.0-nightly.20210720","15.0.0-nightly.20210721","16.0.0-nightly.20210722","16.0.0-nightly.20210723","16.0.0-nightly.20210726"],"93.0.4577.15":["14.0.0-beta.18","14.0.0-beta.19","14.0.0-beta.20","14.0.0-beta.21"],"93.0.4577.25":["14.0.0-beta.22","14.0.0-beta.23"],"93.0.4577.51":["14.0.0-beta.24","14.0.0-beta.25"],"92.0.4475.0":["14.0.0-nightly.20210426","14.0.0-nightly.20210427"],"92.0.4488.0":["14.0.0-nightly.20210430","14.0.0-nightly.20210503"],"92.0.4496.0":["14.0.0-nightly.20210505"],"92.0.4498.0":["14.0.0-nightly.20210506"],"92.0.4499.0":["14.0.0-nightly.20210507","14.0.0-nightly.20210510","14.0.0-nightly.20210511","14.0.0-nightly.20210512","14.0.0-nightly.20210513"],"92.0.4505.0":["14.0.0-nightly.20210514","14.0.0-nightly.20210517","14.0.0-nightly.20210518","14.0.0-nightly.20210519"],"93.0.4577.58":["14.0.0"],"93.0.4577.63":["14.0.1"],"93.0.4577.82":["14.0.2","14.1.0","14.1.1","14.2.0","14.2.1"],"94.0.4584.0":["15.0.0-alpha.3","15.0.0-alpha.4","15.0.0-alpha.5","15.0.0-alpha.6","16.0.0-nightly.20210727","16.0.0-nightly.20210728","16.0.0-nightly.20210729","16.0.0-nightly.20210730","16.0.0-nightly.20210802","16.0.0-nightly.20210803","16.0.0-nightly.20210804","16.0.0-nightly.20210805","16.0.0-nightly.20210806","16.0.0-nightly.20210809","16.0.0-nightly.20210810","16.0.0-nightly.20210811"],"94.0.4590.2":["15.0.0-alpha.7","15.0.0-alpha.8","15.0.0-alpha.9","16.0.0-nightly.20210812","16.0.0-nightly.20210813","16.0.0-nightly.20210816","16.0.0-nightly.20210817","16.0.0-nightly.20210818","16.0.0-nightly.20210819","16.0.0-nightly.20210820","16.0.0-nightly.20210823"],"94.0.4606.12":["15.0.0-alpha.10"],"94.0.4606.20":["15.0.0-beta.1","15.0.0-beta.2"],"94.0.4606.31":["15.0.0-beta.3","15.0.0-beta.4","15.0.0-beta.5","15.0.0-beta.6","15.0.0-beta.7"],"93.0.4530.0":["15.0.0-nightly.20210603","15.0.0-nightly.20210604"],"93.0.4535.0":["15.0.0-nightly.20210608"],"93.0.4550.0":["15.0.0-nightly.20210623","15.0.0-nightly.20210624"],"93.0.4552.0":["15.0.0-nightly.20210625","15.0.0-nightly.20210628","15.0.0-nightly.20210629"],"93.0.4558.0":["15.0.0-nightly.20210630","15.0.0-nightly.20210701","15.0.0-nightly.20210702","15.0.0-nightly.20210705"],"94.0.4606.51":["15.0.0"],"94.0.4606.61":["15.1.0","15.1.1"],"94.0.4606.71":["15.1.2"],"94.0.4606.81":["15.2.0","15.3.0","15.3.1","15.3.2"],"95.0.4629.0":["16.0.0-alpha.1","16.0.0-alpha.2","16.0.0-alpha.3","16.0.0-alpha.4","16.0.0-alpha.5","16.0.0-alpha.6","16.0.0-alpha.7","16.0.0-nightly.20210902","16.0.0-nightly.20210903","16.0.0-nightly.20210906","16.0.0-nightly.20210907","16.0.0-nightly.20210908","16.0.0-nightly.20210909","16.0.0-nightly.20210910","16.0.0-nightly.20210913","16.0.0-nightly.20210914","16.0.0-nightly.20210915","16.0.0-nightly.20210916","16.0.0-nightly.20210917","16.0.0-nightly.20210920","16.0.0-nightly.20210921","16.0.0-nightly.20210922","17.0.0-nightly.20210923","17.0.0-nightly.20210924","17.0.0-nightly.20210927","17.0.0-nightly.20210928","17.0.0-nightly.20210929","17.0.0-nightly.20210930","17.0.0-nightly.20211001","17.0.0-nightly.20211004","17.0.0-nightly.20211005"],"96.0.4647.0":["16.0.0-alpha.8","16.0.0-alpha.9","16.0.0-beta.1","16.0.0-beta.2","16.0.0-beta.3","17.0.0-nightly.20211006","17.0.0-nightly.20211007","17.0.0-nightly.20211008","17.0.0-nightly.20211011","17.0.0-nightly.20211012","17.0.0-nightly.20211013","17.0.0-nightly.20211014","17.0.0-nightly.20211015","17.0.0-nightly.20211018","17.0.0-nightly.20211019","17.0.0-nightly.20211020","17.0.0-nightly.20211021"],"96.0.4664.18":["16.0.0-beta.4","16.0.0-beta.5"],"96.0.4664.27":["16.0.0-beta.6","16.0.0-beta.7"],"96.0.4664.35":["16.0.0-beta.8","16.0.0-beta.9"],"95.0.4612.5":["16.0.0-nightly.20210824","16.0.0-nightly.20210825","16.0.0-nightly.20210826","16.0.0-nightly.20210827","16.0.0-nightly.20210830","16.0.0-nightly.20210831","16.0.0-nightly.20210901"],"96.0.4664.45":["16.0.0","16.0.1"],"96.0.4664.55":["16.0.2"],"96.0.4664.4":["17.0.0-alpha.1","17.0.0-alpha.2","17.0.0-alpha.3","17.0.0-nightly.20211022","17.0.0-nightly.20211025","17.0.0-nightly.20211026","17.0.0-nightly.20211027","17.0.0-nightly.20211028","17.0.0-nightly.20211029","17.0.0-nightly.20211101","17.0.0-nightly.20211102","17.0.0-nightly.20211103","17.0.0-nightly.20211104","17.0.0-nightly.20211105","17.0.0-nightly.20211108","17.0.0-nightly.20211109","17.0.0-nightly.20211110","17.0.0-nightly.20211111","17.0.0-nightly.20211112","17.0.0-nightly.20211115","17.0.0-nightly.20211116","17.0.0-nightly.20211117","18.0.0-nightly.20211118","18.0.0-nightly.20211119","18.0.0-nightly.20211122","18.0.0-nightly.20211123"],"98.0.4706.0":["17.0.0-alpha.4","18.0.0-nightly.20211124","18.0.0-nightly.20211125","18.0.0-nightly.20211126"]} \ No newline at end of file +{"39.0.2171.65":["0.20.0","0.20.1","0.20.2","0.20.3","0.20.4","0.20.5","0.20.6","0.20.7","0.20.8"],"40.0.2214.91":["0.21.0","0.21.1","0.21.2"],"41.0.2272.76":["0.21.3","0.22.1","0.22.2","0.22.3","0.23.0","0.24.0"],"42.0.2311.107":["0.25.0","0.25.1","0.25.2","0.25.3","0.26.0","0.26.1","0.27.0","0.27.1"],"43.0.2357.65":["0.27.2","0.27.3","0.28.0","0.28.1","0.28.2","0.28.3","0.29.1","0.29.2"],"44.0.2403.125":["0.30.4","0.31.0"],"45.0.2454.85":["0.31.2","0.32.2","0.32.3","0.33.0","0.33.1","0.33.2","0.33.3","0.33.4","0.33.6","0.33.7","0.33.8","0.33.9","0.34.0","0.34.1","0.34.2","0.34.3","0.34.4","0.35.1","0.35.2","0.35.3","0.35.4","0.35.5"],"47.0.2526.73":["0.36.0","0.36.2","0.36.3","0.36.4"],"47.0.2526.110":["0.36.5","0.36.6","0.36.7","0.36.8","0.36.9","0.36.10","0.36.11","0.36.12"],"49.0.2623.75":["0.37.0","0.37.1","0.37.3","0.37.4","0.37.5","0.37.6","0.37.7","0.37.8","1.0.0","1.0.1","1.0.2"],"50.0.2661.102":["1.1.0","1.1.1","1.1.2","1.1.3"],"51.0.2704.63":["1.2.0","1.2.1"],"51.0.2704.84":["1.2.2","1.2.3"],"51.0.2704.103":["1.2.4","1.2.5"],"51.0.2704.106":["1.2.6","1.2.7","1.2.8"],"52.0.2743.82":["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.9","1.3.10","1.3.13","1.3.14","1.3.15"],"53.0.2785.113":["1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5"],"53.0.2785.143":["1.4.6","1.4.7","1.4.8","1.4.10","1.4.11","1.4.13","1.4.14","1.4.15","1.4.16"],"54.0.2840.51":["1.4.12"],"54.0.2840.101":["1.5.0","1.5.1"],"56.0.2924.87":["1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.6.6","1.6.7","1.6.8","1.6.9","1.6.10","1.6.11","1.6.12","1.6.13","1.6.14","1.6.15","1.6.16","1.6.17","1.6.18"],"58.0.3029.110":["1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.7","1.7.8","1.7.9","1.7.10","1.7.11","1.7.12","1.7.13","1.7.14","1.7.15","1.7.16"],"59.0.3071.115":["1.8.0","1.8.1","1.8.2-beta.1","1.8.2-beta.2","1.8.2-beta.3","1.8.2-beta.4","1.8.2-beta.5","1.8.2","1.8.3","1.8.4","1.8.5","1.8.6","1.8.7","1.8.8"],"61.0.3163.100":["2.0.0-beta.1","2.0.0-beta.2","2.0.0-beta.3","2.0.0-beta.4","2.0.0-beta.5","2.0.0-beta.6","2.0.0-beta.7","2.0.0-beta.8","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8-nightly.20180819","2.0.8-nightly.20180820","2.0.8","2.0.9","2.0.10","2.0.11","2.0.12","2.0.13","2.0.14","2.0.15","2.0.16","2.0.17","2.0.18","2.1.0-unsupported.20180809"],"66.0.3359.181":["3.0.0-beta.1","3.0.0-beta.2","3.0.0-beta.3","3.0.0-beta.4","3.0.0-beta.5","3.0.0-beta.6","3.0.0-beta.7","3.0.0-beta.8","3.0.0-beta.9","3.0.0-beta.10","3.0.0-beta.11","3.0.0-beta.12","3.0.0-beta.13","3.0.0-nightly.20180818","3.0.0-nightly.20180821","3.0.0-nightly.20180823","3.0.0-nightly.20180904","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.7","3.0.8","3.0.9","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.1.0-beta.1","3.1.0-beta.2","3.1.0-beta.3","3.1.0-beta.4","3.1.0-beta.5","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","3.1.10","3.1.11","3.1.12","3.1.13","4.0.0-nightly.20180817","4.0.0-nightly.20180819","4.0.0-nightly.20180821"],"69.0.3497.106":["4.0.0-beta.1","4.0.0-beta.2","4.0.0-beta.3","4.0.0-beta.4","4.0.0-beta.5","4.0.0-beta.6","4.0.0-beta.7","4.0.0-beta.8","4.0.0-beta.9","4.0.0-beta.10","4.0.0-beta.11","4.0.0-nightly.20181010","4.0.0","4.0.1","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6"],"67.0.3396.99":["4.0.0-nightly.20180929"],"68.0.3440.128":["4.0.0-nightly.20181006"],"69.0.3497.128":["4.0.7","4.0.8","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.1.5","4.2.0","4.2.1","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.2.10","4.2.11","4.2.12"],"72.0.3626.52":["5.0.0-beta.1","5.0.0-beta.2"],"73.0.3683.27":["5.0.0-beta.3"],"73.0.3683.54":["5.0.0-beta.4"],"73.0.3683.61":["5.0.0-beta.5"],"73.0.3683.84":["5.0.0-beta.6"],"73.0.3683.94":["5.0.0-beta.7"],"73.0.3683.104":["5.0.0-beta.8"],"73.0.3683.117":["5.0.0-beta.9"],"70.0.3538.110":["5.0.0-nightly.20190107"],"71.0.3578.98":["5.0.0-nightly.20190121","5.0.0-nightly.20190122"],"73.0.3683.119":["5.0.0"],"73.0.3683.121":["5.0.1","5.0.2","5.0.3","5.0.4","5.0.5","5.0.6","5.0.7","5.0.8","5.0.9","5.0.10","5.0.11","5.0.12","5.0.13"],"76.0.3774.1":["6.0.0-beta.1"],"76.0.3783.1":["6.0.0-beta.2","6.0.0-beta.3","6.0.0-beta.4"],"76.0.3805.4":["6.0.0-beta.5"],"76.0.3809.3":["6.0.0-beta.6"],"76.0.3809.22":["6.0.0-beta.7"],"76.0.3809.26":["6.0.0-beta.8","6.0.0-beta.9"],"76.0.3809.37":["6.0.0-beta.10"],"76.0.3809.42":["6.0.0-beta.11"],"76.0.3809.54":["6.0.0-beta.12"],"76.0.3809.60":["6.0.0-beta.13"],"76.0.3809.68":["6.0.0-beta.14"],"76.0.3809.74":["6.0.0-beta.15"],"72.0.3626.107":["6.0.0-nightly.20190212"],"72.0.3626.110":["6.0.0-nightly.20190213"],"74.0.3724.8":["6.0.0-nightly.20190311"],"76.0.3809.88":["6.0.0"],"76.0.3809.102":["6.0.1"],"76.0.3809.110":["6.0.2"],"76.0.3809.126":["6.0.3"],"76.0.3809.131":["6.0.4"],"76.0.3809.136":["6.0.5"],"76.0.3809.138":["6.0.6"],"76.0.3809.139":["6.0.7"],"76.0.3809.146":["6.0.8","6.0.9","6.0.10","6.0.11","6.0.12","6.1.0","6.1.1","6.1.2","6.1.3","6.1.4","6.1.5","6.1.6","6.1.7","6.1.8","6.1.9","6.1.10","6.1.11","6.1.12"],"78.0.3866.0":["7.0.0-beta.1","7.0.0-beta.2","7.0.0-beta.3","7.0.0-nightly.20190727","7.0.0-nightly.20190728","7.0.0-nightly.20190729","7.0.0-nightly.20190730","7.0.0-nightly.20190731","8.0.0-nightly.20190801","8.0.0-nightly.20190802"],"78.0.3896.6":["7.0.0-beta.4"],"78.0.3905.1":["7.0.0-beta.5","7.0.0-beta.6","7.0.0-beta.7","7.0.0"],"76.0.3784.0":["7.0.0-nightly.20190521"],"76.0.3806.0":["7.0.0-nightly.20190529","7.0.0-nightly.20190530","7.0.0-nightly.20190531","7.0.0-nightly.20190602","7.0.0-nightly.20190603"],"77.0.3814.0":["7.0.0-nightly.20190604"],"77.0.3815.0":["7.0.0-nightly.20190605","7.0.0-nightly.20190606","7.0.0-nightly.20190607","7.0.0-nightly.20190608","7.0.0-nightly.20190609","7.0.0-nightly.20190611","7.0.0-nightly.20190612","7.0.0-nightly.20190613","7.0.0-nightly.20190615","7.0.0-nightly.20190616","7.0.0-nightly.20190618","7.0.0-nightly.20190619","7.0.0-nightly.20190622","7.0.0-nightly.20190623","7.0.0-nightly.20190624","7.0.0-nightly.20190627","7.0.0-nightly.20190629","7.0.0-nightly.20190630","7.0.0-nightly.20190701","7.0.0-nightly.20190702"],"77.0.3843.0":["7.0.0-nightly.20190704","7.0.0-nightly.20190705"],"77.0.3848.0":["7.0.0-nightly.20190719","7.0.0-nightly.20190720","7.0.0-nightly.20190721"],"77.0.3864.0":["7.0.0-nightly.20190726"],"78.0.3904.92":["7.0.1"],"78.0.3904.94":["7.1.0"],"78.0.3904.99":["7.1.1"],"78.0.3904.113":["7.1.2"],"78.0.3904.126":["7.1.3"],"78.0.3904.130":["7.1.4","7.1.5","7.1.6","7.1.7","7.1.8","7.1.9","7.1.10","7.1.11","7.1.12","7.1.13","7.1.14","7.2.0","7.2.1","7.2.2","7.2.3","7.2.4","7.3.0","7.3.1","7.3.2","7.3.3"],"79.0.3931.0":["8.0.0-beta.1","8.0.0-beta.2","8.0.0-nightly.20191019","8.0.0-nightly.20191020","8.0.0-nightly.20191021","8.0.0-nightly.20191023"],"80.0.3955.0":["8.0.0-beta.3","8.0.0-beta.4"],"80.0.3987.14":["8.0.0-beta.5"],"80.0.3987.51":["8.0.0-beta.6"],"80.0.3987.59":["8.0.0-beta.7"],"80.0.3987.75":["8.0.0-beta.8","8.0.0-beta.9"],"78.0.3871.0":["8.0.0-nightly.20190803","8.0.0-nightly.20190806","8.0.0-nightly.20190807","8.0.0-nightly.20190808","8.0.0-nightly.20190809","8.0.0-nightly.20190810","8.0.0-nightly.20190811","8.0.0-nightly.20190812","8.0.0-nightly.20190813","8.0.0-nightly.20190814","8.0.0-nightly.20190815"],"78.0.3881.0":["8.0.0-nightly.20190816","8.0.0-nightly.20190817","8.0.0-nightly.20190818","8.0.0-nightly.20190819","8.0.0-nightly.20190820"],"78.0.3892.0":["8.0.0-nightly.20190824","8.0.0-nightly.20190825","8.0.0-nightly.20190827","8.0.0-nightly.20190828","8.0.0-nightly.20190830","8.0.0-nightly.20190901","8.0.0-nightly.20190902","8.0.0-nightly.20190907","8.0.0-nightly.20190909","8.0.0-nightly.20190910","8.0.0-nightly.20190911","8.0.0-nightly.20190913","8.0.0-nightly.20190914","8.0.0-nightly.20190915","8.0.0-nightly.20190917"],"79.0.3915.0":["8.0.0-nightly.20190919","8.0.0-nightly.20190920"],"79.0.3919.0":["8.0.0-nightly.20190923","8.0.0-nightly.20190924","8.0.0-nightly.20190926","8.0.0-nightly.20190929","8.0.0-nightly.20190930","8.0.0-nightly.20191001","8.0.0-nightly.20191004","8.0.0-nightly.20191005","8.0.0-nightly.20191006","8.0.0-nightly.20191009","8.0.0-nightly.20191011","8.0.0-nightly.20191012","8.0.0-nightly.20191017"],"80.0.3952.0":["8.0.0-nightly.20191101","8.0.0-nightly.20191105"],"80.0.3987.86":["8.0.0","8.0.1","8.0.2"],"80.0.3987.134":["8.0.3"],"80.0.3987.137":["8.1.0"],"80.0.3987.141":["8.1.1"],"80.0.3987.158":["8.2.0"],"80.0.3987.163":["8.2.1","8.2.2","8.2.3","8.5.3","8.5.4","8.5.5"],"80.0.3987.165":["8.2.4","8.2.5","8.3.0","8.3.1","8.3.2","8.3.3","8.3.4","8.4.0","8.4.1","8.5.0","8.5.1","8.5.2"],"82.0.4048.0":["9.0.0-beta.1","9.0.0-beta.2","9.0.0-beta.3","9.0.0-beta.4","9.0.0-beta.5"],"82.0.4058.2":["9.0.0-beta.6","9.0.0-beta.7","9.0.0-beta.9"],"82.0.4085.10":["9.0.0-beta.10"],"82.0.4085.14":["9.0.0-beta.12","9.0.0-beta.13"],"82.0.4085.27":["9.0.0-beta.14"],"83.0.4102.3":["9.0.0-beta.15","9.0.0-beta.16"],"83.0.4103.14":["9.0.0-beta.17"],"83.0.4103.16":["9.0.0-beta.18"],"83.0.4103.24":["9.0.0-beta.19"],"83.0.4103.26":["9.0.0-beta.20","9.0.0-beta.21"],"83.0.4103.34":["9.0.0-beta.22"],"83.0.4103.44":["9.0.0-beta.23"],"83.0.4103.45":["9.0.0-beta.24"],"80.0.3954.0":["9.0.0-nightly.20191121","9.0.0-nightly.20191122","9.0.0-nightly.20191123","9.0.0-nightly.20191124","9.0.0-nightly.20191129","9.0.0-nightly.20191130","9.0.0-nightly.20191201","9.0.0-nightly.20191202","9.0.0-nightly.20191203","9.0.0-nightly.20191204","9.0.0-nightly.20191210"],"81.0.3994.0":["9.0.0-nightly.20191220","9.0.0-nightly.20191221","9.0.0-nightly.20191222","9.0.0-nightly.20191223","9.0.0-nightly.20191224","9.0.0-nightly.20191225","9.0.0-nightly.20191226","9.0.0-nightly.20191228","9.0.0-nightly.20191229","9.0.0-nightly.20191230","9.0.0-nightly.20191231","9.0.0-nightly.20200101","9.0.0-nightly.20200103","9.0.0-nightly.20200104","9.0.0-nightly.20200105","9.0.0-nightly.20200106","9.0.0-nightly.20200108","9.0.0-nightly.20200109","9.0.0-nightly.20200110","9.0.0-nightly.20200111","9.0.0-nightly.20200113","9.0.0-nightly.20200115","9.0.0-nightly.20200116","9.0.0-nightly.20200117"],"81.0.4030.0":["9.0.0-nightly.20200119","9.0.0-nightly.20200121"],"83.0.4103.64":["9.0.0"],"83.0.4103.94":["9.0.1","9.0.2"],"83.0.4103.100":["9.0.3"],"83.0.4103.104":["9.0.4"],"83.0.4103.119":["9.0.5"],"83.0.4103.122":["9.1.0","9.1.1","9.1.2","9.2.0","9.2.1","9.3.0","9.3.1","9.3.2","9.3.3","9.3.4","9.3.5","9.4.0","9.4.1","9.4.2","9.4.3","9.4.4"],"84.0.4129.0":["10.0.0-beta.1","10.0.0-beta.2","10.0.0-nightly.20200501","10.0.0-nightly.20200504","10.0.0-nightly.20200505","10.0.0-nightly.20200506","10.0.0-nightly.20200507","10.0.0-nightly.20200508","10.0.0-nightly.20200511","10.0.0-nightly.20200512","10.0.0-nightly.20200513","10.0.0-nightly.20200514","10.0.0-nightly.20200515","10.0.0-nightly.20200518","10.0.0-nightly.20200519","10.0.0-nightly.20200520","10.0.0-nightly.20200521","11.0.0-nightly.20200525","11.0.0-nightly.20200526"],"85.0.4161.2":["10.0.0-beta.3","10.0.0-beta.4"],"85.0.4181.1":["10.0.0-beta.8","10.0.0-beta.9"],"85.0.4183.19":["10.0.0-beta.10"],"85.0.4183.20":["10.0.0-beta.11"],"85.0.4183.26":["10.0.0-beta.12"],"85.0.4183.39":["10.0.0-beta.13","10.0.0-beta.14","10.0.0-beta.15","10.0.0-beta.17","10.0.0-beta.19","10.0.0-beta.20","10.0.0-beta.21"],"85.0.4183.70":["10.0.0-beta.23"],"85.0.4183.78":["10.0.0-beta.24"],"85.0.4183.80":["10.0.0-beta.25"],"82.0.4050.0":["10.0.0-nightly.20200209","10.0.0-nightly.20200210","10.0.0-nightly.20200211","10.0.0-nightly.20200216","10.0.0-nightly.20200217","10.0.0-nightly.20200218","10.0.0-nightly.20200221","10.0.0-nightly.20200222","10.0.0-nightly.20200223","10.0.0-nightly.20200226","10.0.0-nightly.20200303"],"82.0.4076.0":["10.0.0-nightly.20200304","10.0.0-nightly.20200305","10.0.0-nightly.20200306","10.0.0-nightly.20200309","10.0.0-nightly.20200310"],"82.0.4083.0":["10.0.0-nightly.20200311"],"83.0.4086.0":["10.0.0-nightly.20200316"],"83.0.4087.0":["10.0.0-nightly.20200317","10.0.0-nightly.20200318","10.0.0-nightly.20200320","10.0.0-nightly.20200323","10.0.0-nightly.20200324","10.0.0-nightly.20200325","10.0.0-nightly.20200326","10.0.0-nightly.20200327","10.0.0-nightly.20200330","10.0.0-nightly.20200331","10.0.0-nightly.20200401","10.0.0-nightly.20200402","10.0.0-nightly.20200403","10.0.0-nightly.20200406"],"83.0.4095.0":["10.0.0-nightly.20200408","10.0.0-nightly.20200410","10.0.0-nightly.20200413"],"84.0.4114.0":["10.0.0-nightly.20200414"],"84.0.4115.0":["10.0.0-nightly.20200415","10.0.0-nightly.20200416","10.0.0-nightly.20200417"],"84.0.4121.0":["10.0.0-nightly.20200422","10.0.0-nightly.20200423"],"84.0.4125.0":["10.0.0-nightly.20200427","10.0.0-nightly.20200428","10.0.0-nightly.20200429","10.0.0-nightly.20200430"],"85.0.4183.84":["10.0.0"],"85.0.4183.86":["10.0.1"],"85.0.4183.87":["10.1.0"],"85.0.4183.93":["10.1.1"],"85.0.4183.98":["10.1.2"],"85.0.4183.121":["10.1.3","10.1.4","10.1.5","10.1.6","10.1.7","10.2.0","10.3.0","10.3.1","10.3.2","10.4.0","10.4.1","10.4.2","10.4.3","10.4.4","10.4.5","10.4.6","10.4.7"],"86.0.4234.0":["11.0.0-beta.1","11.0.0-beta.3","11.0.0-beta.4","11.0.0-beta.5","11.0.0-beta.6","11.0.0-beta.7","11.0.0-nightly.20200822","11.0.0-nightly.20200824","11.0.0-nightly.20200825","11.0.0-nightly.20200826","12.0.0-nightly.20200827","12.0.0-nightly.20200831","12.0.0-nightly.20200902","12.0.0-nightly.20200903","12.0.0-nightly.20200907","12.0.0-nightly.20200910","12.0.0-nightly.20200911","12.0.0-nightly.20200914"],"87.0.4251.1":["11.0.0-beta.8","11.0.0-beta.9","11.0.0-beta.11"],"87.0.4280.11":["11.0.0-beta.12","11.0.0-beta.13"],"87.0.4280.27":["11.0.0-beta.16","11.0.0-beta.17","11.0.0-beta.18","11.0.0-beta.19"],"87.0.4280.40":["11.0.0-beta.20"],"87.0.4280.47":["11.0.0-beta.22","11.0.0-beta.23"],"85.0.4156.0":["11.0.0-nightly.20200529"],"85.0.4162.0":["11.0.0-nightly.20200602","11.0.0-nightly.20200603","11.0.0-nightly.20200604","11.0.0-nightly.20200609","11.0.0-nightly.20200610","11.0.0-nightly.20200611","11.0.0-nightly.20200615","11.0.0-nightly.20200616","11.0.0-nightly.20200617","11.0.0-nightly.20200618","11.0.0-nightly.20200619"],"85.0.4179.0":["11.0.0-nightly.20200701","11.0.0-nightly.20200702","11.0.0-nightly.20200703","11.0.0-nightly.20200706","11.0.0-nightly.20200707","11.0.0-nightly.20200708","11.0.0-nightly.20200709"],"86.0.4203.0":["11.0.0-nightly.20200716","11.0.0-nightly.20200717","11.0.0-nightly.20200720","11.0.0-nightly.20200721"],"86.0.4209.0":["11.0.0-nightly.20200723","11.0.0-nightly.20200724","11.0.0-nightly.20200729","11.0.0-nightly.20200730","11.0.0-nightly.20200731","11.0.0-nightly.20200803","11.0.0-nightly.20200804","11.0.0-nightly.20200805","11.0.0-nightly.20200811","11.0.0-nightly.20200812"],"87.0.4280.60":["11.0.0","11.0.1"],"87.0.4280.67":["11.0.2","11.0.3","11.0.4"],"87.0.4280.88":["11.0.5","11.1.0","11.1.1"],"87.0.4280.141":["11.2.0","11.2.1","11.2.2","11.2.3","11.3.0","11.4.0","11.4.1","11.4.2","11.4.3","11.4.4","11.4.5","11.4.6","11.4.7","11.4.8","11.4.9","11.4.10","11.4.11","11.4.12","11.5.0"],"89.0.4328.0":["12.0.0-beta.1","12.0.0-beta.3","12.0.0-beta.4","12.0.0-beta.5","12.0.0-beta.6","12.0.0-beta.7","12.0.0-beta.8","12.0.0-beta.9","12.0.0-beta.10","12.0.0-beta.11","12.0.0-beta.12","12.0.0-beta.14","13.0.0-nightly.20201119","13.0.0-nightly.20201123","13.0.0-nightly.20201124","13.0.0-nightly.20201126","13.0.0-nightly.20201127","13.0.0-nightly.20201130","13.0.0-nightly.20201201","13.0.0-nightly.20201202","13.0.0-nightly.20201203","13.0.0-nightly.20201204","13.0.0-nightly.20201207","13.0.0-nightly.20201208","13.0.0-nightly.20201209","13.0.0-nightly.20201210","13.0.0-nightly.20201211","13.0.0-nightly.20201214"],"89.0.4348.1":["12.0.0-beta.16","12.0.0-beta.18","12.0.0-beta.19","12.0.0-beta.20"],"89.0.4388.2":["12.0.0-beta.21","12.0.0-beta.22","12.0.0-beta.23","12.0.0-beta.24","12.0.0-beta.25","12.0.0-beta.26"],"89.0.4389.23":["12.0.0-beta.27","12.0.0-beta.28","12.0.0-beta.29"],"89.0.4389.58":["12.0.0-beta.30","12.0.0-beta.31"],"87.0.4268.0":["12.0.0-nightly.20201013","12.0.0-nightly.20201014","12.0.0-nightly.20201015"],"88.0.4292.0":["12.0.0-nightly.20201023","12.0.0-nightly.20201026"],"88.0.4306.0":["12.0.0-nightly.20201030","12.0.0-nightly.20201102","12.0.0-nightly.20201103","12.0.0-nightly.20201104","12.0.0-nightly.20201105","12.0.0-nightly.20201106","12.0.0-nightly.20201111","12.0.0-nightly.20201112"],"88.0.4324.0":["12.0.0-nightly.20201116"],"89.0.4389.69":["12.0.0"],"89.0.4389.82":["12.0.1"],"89.0.4389.90":["12.0.2"],"89.0.4389.114":["12.0.3","12.0.4"],"89.0.4389.128":["12.0.5","12.0.6","12.0.7","12.0.8","12.0.9","12.0.10","12.0.11","12.0.12","12.0.13","12.0.14","12.0.15","12.0.16","12.0.17","12.0.18","12.1.0","12.1.1","12.1.2","12.2.0","12.2.1","12.2.2","12.2.3"],"90.0.4402.0":["13.0.0-beta.2","13.0.0-beta.3","13.0.0-nightly.20210210","13.0.0-nightly.20210211","13.0.0-nightly.20210212","13.0.0-nightly.20210216","13.0.0-nightly.20210217","13.0.0-nightly.20210218","13.0.0-nightly.20210219","13.0.0-nightly.20210222","13.0.0-nightly.20210225","13.0.0-nightly.20210226","13.0.0-nightly.20210301","13.0.0-nightly.20210302","13.0.0-nightly.20210303","14.0.0-nightly.20210304"],"90.0.4415.0":["13.0.0-beta.4","13.0.0-beta.5","13.0.0-beta.6","13.0.0-beta.7","13.0.0-beta.8","13.0.0-beta.9","13.0.0-beta.11","13.0.0-beta.12","13.0.0-beta.13","14.0.0-nightly.20210305","14.0.0-nightly.20210308","14.0.0-nightly.20210309","14.0.0-nightly.20210311","14.0.0-nightly.20210315","14.0.0-nightly.20210316","14.0.0-nightly.20210317","14.0.0-nightly.20210318","14.0.0-nightly.20210319","14.0.0-nightly.20210323","14.0.0-nightly.20210324","14.0.0-nightly.20210325","14.0.0-nightly.20210326","14.0.0-nightly.20210329","14.0.0-nightly.20210330"],"91.0.4448.0":["13.0.0-beta.14","13.0.0-beta.16","13.0.0-beta.17","13.0.0-beta.18","13.0.0-beta.20","14.0.0-nightly.20210331","14.0.0-nightly.20210401","14.0.0-nightly.20210402","14.0.0-nightly.20210406","14.0.0-nightly.20210407","14.0.0-nightly.20210408","14.0.0-nightly.20210409","14.0.0-nightly.20210413"],"91.0.4472.33":["13.0.0-beta.21","13.0.0-beta.22","13.0.0-beta.23"],"91.0.4472.38":["13.0.0-beta.24","13.0.0-beta.26","13.0.0-beta.27","13.0.0-beta.28"],"89.0.4349.0":["13.0.0-nightly.20201215","13.0.0-nightly.20201216","13.0.0-nightly.20201221","13.0.0-nightly.20201222"],"89.0.4359.0":["13.0.0-nightly.20201223","13.0.0-nightly.20210104","13.0.0-nightly.20210108","13.0.0-nightly.20210111"],"89.0.4386.0":["13.0.0-nightly.20210113","13.0.0-nightly.20210114","13.0.0-nightly.20210118","13.0.0-nightly.20210122","13.0.0-nightly.20210125"],"89.0.4389.0":["13.0.0-nightly.20210127","13.0.0-nightly.20210128","13.0.0-nightly.20210129","13.0.0-nightly.20210201","13.0.0-nightly.20210202","13.0.0-nightly.20210203","13.0.0-nightly.20210205","13.0.0-nightly.20210208","13.0.0-nightly.20210209"],"91.0.4472.69":["13.0.0","13.0.1"],"91.0.4472.77":["13.1.0","13.1.1","13.1.2"],"91.0.4472.106":["13.1.3","13.1.4"],"91.0.4472.124":["13.1.5","13.1.6","13.1.7"],"91.0.4472.164":["13.1.8","13.1.9","13.2.0","13.2.1","13.2.2","13.2.3","13.3.0","13.4.0","13.5.0","13.5.1","13.5.2","13.6.0","13.6.1","13.6.2","13.6.3"],"92.0.4511.0":["14.0.0-beta.1","14.0.0-beta.2","14.0.0-beta.3","14.0.0-nightly.20210520","14.0.0-nightly.20210523","14.0.0-nightly.20210524","15.0.0-nightly.20210527","15.0.0-nightly.20210528","15.0.0-nightly.20210531","15.0.0-nightly.20210601","15.0.0-nightly.20210602"],"93.0.4536.0":["14.0.0-beta.5","14.0.0-beta.6","14.0.0-beta.7","14.0.0-beta.8","15.0.0-nightly.20210609","15.0.0-nightly.20210610","15.0.0-nightly.20210611","15.0.0-nightly.20210614","15.0.0-nightly.20210615","15.0.0-nightly.20210616"],"93.0.4539.0":["14.0.0-beta.9","14.0.0-beta.10","15.0.0-nightly.20210617","15.0.0-nightly.20210618","15.0.0-nightly.20210621","15.0.0-nightly.20210622"],"93.0.4557.4":["14.0.0-beta.11","14.0.0-beta.12"],"93.0.4566.0":["14.0.0-beta.13","14.0.0-beta.14","14.0.0-beta.15","14.0.0-beta.16","14.0.0-beta.17","15.0.0-alpha.1","15.0.0-alpha.2","15.0.0-nightly.20210706","15.0.0-nightly.20210707","15.0.0-nightly.20210708","15.0.0-nightly.20210709","15.0.0-nightly.20210712","15.0.0-nightly.20210713","15.0.0-nightly.20210714","15.0.0-nightly.20210715","15.0.0-nightly.20210716","15.0.0-nightly.20210719","15.0.0-nightly.20210720","15.0.0-nightly.20210721","16.0.0-nightly.20210722","16.0.0-nightly.20210723","16.0.0-nightly.20210726"],"93.0.4577.15":["14.0.0-beta.18","14.0.0-beta.19","14.0.0-beta.20","14.0.0-beta.21"],"93.0.4577.25":["14.0.0-beta.22","14.0.0-beta.23"],"93.0.4577.51":["14.0.0-beta.24","14.0.0-beta.25"],"92.0.4475.0":["14.0.0-nightly.20210426","14.0.0-nightly.20210427"],"92.0.4488.0":["14.0.0-nightly.20210430","14.0.0-nightly.20210503"],"92.0.4496.0":["14.0.0-nightly.20210505"],"92.0.4498.0":["14.0.0-nightly.20210506"],"92.0.4499.0":["14.0.0-nightly.20210507","14.0.0-nightly.20210510","14.0.0-nightly.20210511","14.0.0-nightly.20210512","14.0.0-nightly.20210513"],"92.0.4505.0":["14.0.0-nightly.20210514","14.0.0-nightly.20210517","14.0.0-nightly.20210518","14.0.0-nightly.20210519"],"93.0.4577.58":["14.0.0"],"93.0.4577.63":["14.0.1"],"93.0.4577.82":["14.0.2","14.1.0","14.1.1","14.2.0","14.2.1","14.2.2"],"94.0.4584.0":["15.0.0-alpha.3","15.0.0-alpha.4","15.0.0-alpha.5","15.0.0-alpha.6","16.0.0-nightly.20210727","16.0.0-nightly.20210728","16.0.0-nightly.20210729","16.0.0-nightly.20210730","16.0.0-nightly.20210802","16.0.0-nightly.20210803","16.0.0-nightly.20210804","16.0.0-nightly.20210805","16.0.0-nightly.20210806","16.0.0-nightly.20210809","16.0.0-nightly.20210810","16.0.0-nightly.20210811"],"94.0.4590.2":["15.0.0-alpha.7","15.0.0-alpha.8","15.0.0-alpha.9","16.0.0-nightly.20210812","16.0.0-nightly.20210813","16.0.0-nightly.20210816","16.0.0-nightly.20210817","16.0.0-nightly.20210818","16.0.0-nightly.20210819","16.0.0-nightly.20210820","16.0.0-nightly.20210823"],"94.0.4606.12":["15.0.0-alpha.10"],"94.0.4606.20":["15.0.0-beta.1","15.0.0-beta.2"],"94.0.4606.31":["15.0.0-beta.3","15.0.0-beta.4","15.0.0-beta.5","15.0.0-beta.6","15.0.0-beta.7"],"93.0.4530.0":["15.0.0-nightly.20210603","15.0.0-nightly.20210604"],"93.0.4535.0":["15.0.0-nightly.20210608"],"93.0.4550.0":["15.0.0-nightly.20210623","15.0.0-nightly.20210624"],"93.0.4552.0":["15.0.0-nightly.20210625","15.0.0-nightly.20210628","15.0.0-nightly.20210629"],"93.0.4558.0":["15.0.0-nightly.20210630","15.0.0-nightly.20210701","15.0.0-nightly.20210702","15.0.0-nightly.20210705"],"94.0.4606.51":["15.0.0"],"94.0.4606.61":["15.1.0","15.1.1"],"94.0.4606.71":["15.1.2"],"94.0.4606.81":["15.2.0","15.3.0","15.3.1","15.3.2","15.3.3"],"95.0.4629.0":["16.0.0-alpha.1","16.0.0-alpha.2","16.0.0-alpha.3","16.0.0-alpha.4","16.0.0-alpha.5","16.0.0-alpha.6","16.0.0-alpha.7","16.0.0-nightly.20210902","16.0.0-nightly.20210903","16.0.0-nightly.20210906","16.0.0-nightly.20210907","16.0.0-nightly.20210908","16.0.0-nightly.20210909","16.0.0-nightly.20210910","16.0.0-nightly.20210913","16.0.0-nightly.20210914","16.0.0-nightly.20210915","16.0.0-nightly.20210916","16.0.0-nightly.20210917","16.0.0-nightly.20210920","16.0.0-nightly.20210921","16.0.0-nightly.20210922","17.0.0-nightly.20210923","17.0.0-nightly.20210924","17.0.0-nightly.20210927","17.0.0-nightly.20210928","17.0.0-nightly.20210929","17.0.0-nightly.20210930","17.0.0-nightly.20211001","17.0.0-nightly.20211004","17.0.0-nightly.20211005"],"96.0.4647.0":["16.0.0-alpha.8","16.0.0-alpha.9","16.0.0-beta.1","16.0.0-beta.2","16.0.0-beta.3","17.0.0-nightly.20211006","17.0.0-nightly.20211007","17.0.0-nightly.20211008","17.0.0-nightly.20211011","17.0.0-nightly.20211012","17.0.0-nightly.20211013","17.0.0-nightly.20211014","17.0.0-nightly.20211015","17.0.0-nightly.20211018","17.0.0-nightly.20211019","17.0.0-nightly.20211020","17.0.0-nightly.20211021"],"96.0.4664.18":["16.0.0-beta.4","16.0.0-beta.5"],"96.0.4664.27":["16.0.0-beta.6","16.0.0-beta.7"],"96.0.4664.35":["16.0.0-beta.8","16.0.0-beta.9"],"95.0.4612.5":["16.0.0-nightly.20210824","16.0.0-nightly.20210825","16.0.0-nightly.20210826","16.0.0-nightly.20210827","16.0.0-nightly.20210830","16.0.0-nightly.20210831","16.0.0-nightly.20210901"],"96.0.4664.45":["16.0.0","16.0.1"],"96.0.4664.55":["16.0.2","16.0.3"],"96.0.4664.4":["17.0.0-alpha.1","17.0.0-alpha.2","17.0.0-alpha.3","17.0.0-nightly.20211022","17.0.0-nightly.20211025","17.0.0-nightly.20211026","17.0.0-nightly.20211027","17.0.0-nightly.20211028","17.0.0-nightly.20211029","17.0.0-nightly.20211101","17.0.0-nightly.20211102","17.0.0-nightly.20211103","17.0.0-nightly.20211104","17.0.0-nightly.20211105","17.0.0-nightly.20211108","17.0.0-nightly.20211109","17.0.0-nightly.20211110","17.0.0-nightly.20211111","17.0.0-nightly.20211112","17.0.0-nightly.20211115","17.0.0-nightly.20211116","17.0.0-nightly.20211117","18.0.0-nightly.20211118","18.0.0-nightly.20211119","18.0.0-nightly.20211122","18.0.0-nightly.20211123"],"98.0.4706.0":["17.0.0-alpha.4","18.0.0-nightly.20211124","18.0.0-nightly.20211125","18.0.0-nightly.20211126","18.0.0-nightly.20211129","18.0.0-nightly.20211130"]} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.js b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.js index 39c991f3d57bd8..987ad46476256a 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.js +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.js @@ -970,6 +970,7 @@ module.exports = { "13.6.0": "91.0.4472.164", "13.6.1": "91.0.4472.164", "13.6.2": "91.0.4472.164", + "13.6.3": "91.0.4472.164", "14.0.0-beta.1": "92.0.4511.0", "14.0.0-beta.2": "92.0.4511.0", "14.0.0-beta.3": "92.0.4511.0", @@ -1043,6 +1044,7 @@ module.exports = { "14.1.1": "93.0.4577.82", "14.2.0": "93.0.4577.82", "14.2.1": "93.0.4577.82", + "14.2.2": "93.0.4577.82", "15.0.0-alpha.1": "93.0.4566.0", "15.0.0-alpha.2": "93.0.4566.0", "15.0.0-alpha.3": "94.0.4584.0", @@ -1107,6 +1109,7 @@ module.exports = { "15.3.0": "94.0.4606.81", "15.3.1": "94.0.4606.81", "15.3.2": "94.0.4606.81", + "15.3.3": "94.0.4606.81", "16.0.0-alpha.1": "95.0.4629.0", "16.0.0-alpha.2": "95.0.4629.0", "16.0.0-alpha.3": "95.0.4629.0", @@ -1173,6 +1176,7 @@ module.exports = { "16.0.0": "96.0.4664.45", "16.0.1": "96.0.4664.45", "16.0.2": "96.0.4664.55", + "16.0.3": "96.0.4664.55", "17.0.0-alpha.1": "96.0.4664.4", "17.0.0-alpha.2": "96.0.4664.4", "17.0.0-alpha.3": "96.0.4664.4", @@ -1223,5 +1227,7 @@ module.exports = { "18.0.0-nightly.20211123": "96.0.4664.4", "18.0.0-nightly.20211124": "98.0.4706.0", "18.0.0-nightly.20211125": "98.0.4706.0", - "18.0.0-nightly.20211126": "98.0.4706.0" + "18.0.0-nightly.20211126": "98.0.4706.0", + "18.0.0-nightly.20211129": "98.0.4706.0", + "18.0.0-nightly.20211130": "98.0.4706.0" }; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.json b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.json index e59482544744e8..60de657aae03cc 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.json +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/full-versions.json @@ -1 +1 @@ -{"0.20.0":"39.0.2171.65","0.20.1":"39.0.2171.65","0.20.2":"39.0.2171.65","0.20.3":"39.0.2171.65","0.20.4":"39.0.2171.65","0.20.5":"39.0.2171.65","0.20.6":"39.0.2171.65","0.20.7":"39.0.2171.65","0.20.8":"39.0.2171.65","0.21.0":"40.0.2214.91","0.21.1":"40.0.2214.91","0.21.2":"40.0.2214.91","0.21.3":"41.0.2272.76","0.22.1":"41.0.2272.76","0.22.2":"41.0.2272.76","0.22.3":"41.0.2272.76","0.23.0":"41.0.2272.76","0.24.0":"41.0.2272.76","0.25.0":"42.0.2311.107","0.25.1":"42.0.2311.107","0.25.2":"42.0.2311.107","0.25.3":"42.0.2311.107","0.26.0":"42.0.2311.107","0.26.1":"42.0.2311.107","0.27.0":"42.0.2311.107","0.27.1":"42.0.2311.107","0.27.2":"43.0.2357.65","0.27.3":"43.0.2357.65","0.28.0":"43.0.2357.65","0.28.1":"43.0.2357.65","0.28.2":"43.0.2357.65","0.28.3":"43.0.2357.65","0.29.1":"43.0.2357.65","0.29.2":"43.0.2357.65","0.30.4":"44.0.2403.125","0.31.0":"44.0.2403.125","0.31.2":"45.0.2454.85","0.32.2":"45.0.2454.85","0.32.3":"45.0.2454.85","0.33.0":"45.0.2454.85","0.33.1":"45.0.2454.85","0.33.2":"45.0.2454.85","0.33.3":"45.0.2454.85","0.33.4":"45.0.2454.85","0.33.6":"45.0.2454.85","0.33.7":"45.0.2454.85","0.33.8":"45.0.2454.85","0.33.9":"45.0.2454.85","0.34.0":"45.0.2454.85","0.34.1":"45.0.2454.85","0.34.2":"45.0.2454.85","0.34.3":"45.0.2454.85","0.34.4":"45.0.2454.85","0.35.1":"45.0.2454.85","0.35.2":"45.0.2454.85","0.35.3":"45.0.2454.85","0.35.4":"45.0.2454.85","0.35.5":"45.0.2454.85","0.36.0":"47.0.2526.73","0.36.2":"47.0.2526.73","0.36.3":"47.0.2526.73","0.36.4":"47.0.2526.73","0.36.5":"47.0.2526.110","0.36.6":"47.0.2526.110","0.36.7":"47.0.2526.110","0.36.8":"47.0.2526.110","0.36.9":"47.0.2526.110","0.36.10":"47.0.2526.110","0.36.11":"47.0.2526.110","0.36.12":"47.0.2526.110","0.37.0":"49.0.2623.75","0.37.1":"49.0.2623.75","0.37.3":"49.0.2623.75","0.37.4":"49.0.2623.75","0.37.5":"49.0.2623.75","0.37.6":"49.0.2623.75","0.37.7":"49.0.2623.75","0.37.8":"49.0.2623.75","1.0.0":"49.0.2623.75","1.0.1":"49.0.2623.75","1.0.2":"49.0.2623.75","1.1.0":"50.0.2661.102","1.1.1":"50.0.2661.102","1.1.2":"50.0.2661.102","1.1.3":"50.0.2661.102","1.2.0":"51.0.2704.63","1.2.1":"51.0.2704.63","1.2.2":"51.0.2704.84","1.2.3":"51.0.2704.84","1.2.4":"51.0.2704.103","1.2.5":"51.0.2704.103","1.2.6":"51.0.2704.106","1.2.7":"51.0.2704.106","1.2.8":"51.0.2704.106","1.3.0":"52.0.2743.82","1.3.1":"52.0.2743.82","1.3.2":"52.0.2743.82","1.3.3":"52.0.2743.82","1.3.4":"52.0.2743.82","1.3.5":"52.0.2743.82","1.3.6":"52.0.2743.82","1.3.7":"52.0.2743.82","1.3.9":"52.0.2743.82","1.3.10":"52.0.2743.82","1.3.13":"52.0.2743.82","1.3.14":"52.0.2743.82","1.3.15":"52.0.2743.82","1.4.0":"53.0.2785.113","1.4.1":"53.0.2785.113","1.4.2":"53.0.2785.113","1.4.3":"53.0.2785.113","1.4.4":"53.0.2785.113","1.4.5":"53.0.2785.113","1.4.6":"53.0.2785.143","1.4.7":"53.0.2785.143","1.4.8":"53.0.2785.143","1.4.10":"53.0.2785.143","1.4.11":"53.0.2785.143","1.4.12":"54.0.2840.51","1.4.13":"53.0.2785.143","1.4.14":"53.0.2785.143","1.4.15":"53.0.2785.143","1.4.16":"53.0.2785.143","1.5.0":"54.0.2840.101","1.5.1":"54.0.2840.101","1.6.0":"56.0.2924.87","1.6.1":"56.0.2924.87","1.6.2":"56.0.2924.87","1.6.3":"56.0.2924.87","1.6.4":"56.0.2924.87","1.6.5":"56.0.2924.87","1.6.6":"56.0.2924.87","1.6.7":"56.0.2924.87","1.6.8":"56.0.2924.87","1.6.9":"56.0.2924.87","1.6.10":"56.0.2924.87","1.6.11":"56.0.2924.87","1.6.12":"56.0.2924.87","1.6.13":"56.0.2924.87","1.6.14":"56.0.2924.87","1.6.15":"56.0.2924.87","1.6.16":"56.0.2924.87","1.6.17":"56.0.2924.87","1.6.18":"56.0.2924.87","1.7.0":"58.0.3029.110","1.7.1":"58.0.3029.110","1.7.2":"58.0.3029.110","1.7.3":"58.0.3029.110","1.7.4":"58.0.3029.110","1.7.5":"58.0.3029.110","1.7.6":"58.0.3029.110","1.7.7":"58.0.3029.110","1.7.8":"58.0.3029.110","1.7.9":"58.0.3029.110","1.7.10":"58.0.3029.110","1.7.11":"58.0.3029.110","1.7.12":"58.0.3029.110","1.7.13":"58.0.3029.110","1.7.14":"58.0.3029.110","1.7.15":"58.0.3029.110","1.7.16":"58.0.3029.110","1.8.0":"59.0.3071.115","1.8.1":"59.0.3071.115","1.8.2-beta.1":"59.0.3071.115","1.8.2-beta.2":"59.0.3071.115","1.8.2-beta.3":"59.0.3071.115","1.8.2-beta.4":"59.0.3071.115","1.8.2-beta.5":"59.0.3071.115","1.8.2":"59.0.3071.115","1.8.3":"59.0.3071.115","1.8.4":"59.0.3071.115","1.8.5":"59.0.3071.115","1.8.6":"59.0.3071.115","1.8.7":"59.0.3071.115","1.8.8":"59.0.3071.115","2.0.0-beta.1":"61.0.3163.100","2.0.0-beta.2":"61.0.3163.100","2.0.0-beta.3":"61.0.3163.100","2.0.0-beta.4":"61.0.3163.100","2.0.0-beta.5":"61.0.3163.100","2.0.0-beta.6":"61.0.3163.100","2.0.0-beta.7":"61.0.3163.100","2.0.0-beta.8":"61.0.3163.100","2.0.0":"61.0.3163.100","2.0.1":"61.0.3163.100","2.0.2":"61.0.3163.100","2.0.3":"61.0.3163.100","2.0.4":"61.0.3163.100","2.0.5":"61.0.3163.100","2.0.6":"61.0.3163.100","2.0.7":"61.0.3163.100","2.0.8-nightly.20180819":"61.0.3163.100","2.0.8-nightly.20180820":"61.0.3163.100","2.0.8":"61.0.3163.100","2.0.9":"61.0.3163.100","2.0.10":"61.0.3163.100","2.0.11":"61.0.3163.100","2.0.12":"61.0.3163.100","2.0.13":"61.0.3163.100","2.0.14":"61.0.3163.100","2.0.15":"61.0.3163.100","2.0.16":"61.0.3163.100","2.0.17":"61.0.3163.100","2.0.18":"61.0.3163.100","2.1.0-unsupported.20180809":"61.0.3163.100","3.0.0-beta.1":"66.0.3359.181","3.0.0-beta.2":"66.0.3359.181","3.0.0-beta.3":"66.0.3359.181","3.0.0-beta.4":"66.0.3359.181","3.0.0-beta.5":"66.0.3359.181","3.0.0-beta.6":"66.0.3359.181","3.0.0-beta.7":"66.0.3359.181","3.0.0-beta.8":"66.0.3359.181","3.0.0-beta.9":"66.0.3359.181","3.0.0-beta.10":"66.0.3359.181","3.0.0-beta.11":"66.0.3359.181","3.0.0-beta.12":"66.0.3359.181","3.0.0-beta.13":"66.0.3359.181","3.0.0-nightly.20180818":"66.0.3359.181","3.0.0-nightly.20180821":"66.0.3359.181","3.0.0-nightly.20180823":"66.0.3359.181","3.0.0-nightly.20180904":"66.0.3359.181","3.0.0":"66.0.3359.181","3.0.1":"66.0.3359.181","3.0.2":"66.0.3359.181","3.0.3":"66.0.3359.181","3.0.4":"66.0.3359.181","3.0.5":"66.0.3359.181","3.0.6":"66.0.3359.181","3.0.7":"66.0.3359.181","3.0.8":"66.0.3359.181","3.0.9":"66.0.3359.181","3.0.10":"66.0.3359.181","3.0.11":"66.0.3359.181","3.0.12":"66.0.3359.181","3.0.13":"66.0.3359.181","3.0.14":"66.0.3359.181","3.0.15":"66.0.3359.181","3.0.16":"66.0.3359.181","3.1.0-beta.1":"66.0.3359.181","3.1.0-beta.2":"66.0.3359.181","3.1.0-beta.3":"66.0.3359.181","3.1.0-beta.4":"66.0.3359.181","3.1.0-beta.5":"66.0.3359.181","3.1.0":"66.0.3359.181","3.1.1":"66.0.3359.181","3.1.2":"66.0.3359.181","3.1.3":"66.0.3359.181","3.1.4":"66.0.3359.181","3.1.5":"66.0.3359.181","3.1.6":"66.0.3359.181","3.1.7":"66.0.3359.181","3.1.8":"66.0.3359.181","3.1.9":"66.0.3359.181","3.1.10":"66.0.3359.181","3.1.11":"66.0.3359.181","3.1.12":"66.0.3359.181","3.1.13":"66.0.3359.181","4.0.0-beta.1":"69.0.3497.106","4.0.0-beta.2":"69.0.3497.106","4.0.0-beta.3":"69.0.3497.106","4.0.0-beta.4":"69.0.3497.106","4.0.0-beta.5":"69.0.3497.106","4.0.0-beta.6":"69.0.3497.106","4.0.0-beta.7":"69.0.3497.106","4.0.0-beta.8":"69.0.3497.106","4.0.0-beta.9":"69.0.3497.106","4.0.0-beta.10":"69.0.3497.106","4.0.0-beta.11":"69.0.3497.106","4.0.0-nightly.20180817":"66.0.3359.181","4.0.0-nightly.20180819":"66.0.3359.181","4.0.0-nightly.20180821":"66.0.3359.181","4.0.0-nightly.20180929":"67.0.3396.99","4.0.0-nightly.20181006":"68.0.3440.128","4.0.0-nightly.20181010":"69.0.3497.106","4.0.0":"69.0.3497.106","4.0.1":"69.0.3497.106","4.0.2":"69.0.3497.106","4.0.3":"69.0.3497.106","4.0.4":"69.0.3497.106","4.0.5":"69.0.3497.106","4.0.6":"69.0.3497.106","4.0.7":"69.0.3497.128","4.0.8":"69.0.3497.128","4.1.0":"69.0.3497.128","4.1.1":"69.0.3497.128","4.1.2":"69.0.3497.128","4.1.3":"69.0.3497.128","4.1.4":"69.0.3497.128","4.1.5":"69.0.3497.128","4.2.0":"69.0.3497.128","4.2.1":"69.0.3497.128","4.2.2":"69.0.3497.128","4.2.3":"69.0.3497.128","4.2.4":"69.0.3497.128","4.2.5":"69.0.3497.128","4.2.6":"69.0.3497.128","4.2.7":"69.0.3497.128","4.2.8":"69.0.3497.128","4.2.9":"69.0.3497.128","4.2.10":"69.0.3497.128","4.2.11":"69.0.3497.128","4.2.12":"69.0.3497.128","5.0.0-beta.1":"72.0.3626.52","5.0.0-beta.2":"72.0.3626.52","5.0.0-beta.3":"73.0.3683.27","5.0.0-beta.4":"73.0.3683.54","5.0.0-beta.5":"73.0.3683.61","5.0.0-beta.6":"73.0.3683.84","5.0.0-beta.7":"73.0.3683.94","5.0.0-beta.8":"73.0.3683.104","5.0.0-beta.9":"73.0.3683.117","5.0.0-nightly.20190107":"70.0.3538.110","5.0.0-nightly.20190121":"71.0.3578.98","5.0.0-nightly.20190122":"71.0.3578.98","5.0.0":"73.0.3683.119","5.0.1":"73.0.3683.121","5.0.2":"73.0.3683.121","5.0.3":"73.0.3683.121","5.0.4":"73.0.3683.121","5.0.5":"73.0.3683.121","5.0.6":"73.0.3683.121","5.0.7":"73.0.3683.121","5.0.8":"73.0.3683.121","5.0.9":"73.0.3683.121","5.0.10":"73.0.3683.121","5.0.11":"73.0.3683.121","5.0.12":"73.0.3683.121","5.0.13":"73.0.3683.121","6.0.0-beta.1":"76.0.3774.1","6.0.0-beta.2":"76.0.3783.1","6.0.0-beta.3":"76.0.3783.1","6.0.0-beta.4":"76.0.3783.1","6.0.0-beta.5":"76.0.3805.4","6.0.0-beta.6":"76.0.3809.3","6.0.0-beta.7":"76.0.3809.22","6.0.0-beta.8":"76.0.3809.26","6.0.0-beta.9":"76.0.3809.26","6.0.0-beta.10":"76.0.3809.37","6.0.0-beta.11":"76.0.3809.42","6.0.0-beta.12":"76.0.3809.54","6.0.0-beta.13":"76.0.3809.60","6.0.0-beta.14":"76.0.3809.68","6.0.0-beta.15":"76.0.3809.74","6.0.0-nightly.20190212":"72.0.3626.107","6.0.0-nightly.20190213":"72.0.3626.110","6.0.0-nightly.20190311":"74.0.3724.8","6.0.0":"76.0.3809.88","6.0.1":"76.0.3809.102","6.0.2":"76.0.3809.110","6.0.3":"76.0.3809.126","6.0.4":"76.0.3809.131","6.0.5":"76.0.3809.136","6.0.6":"76.0.3809.138","6.0.7":"76.0.3809.139","6.0.8":"76.0.3809.146","6.0.9":"76.0.3809.146","6.0.10":"76.0.3809.146","6.0.11":"76.0.3809.146","6.0.12":"76.0.3809.146","6.1.0":"76.0.3809.146","6.1.1":"76.0.3809.146","6.1.2":"76.0.3809.146","6.1.3":"76.0.3809.146","6.1.4":"76.0.3809.146","6.1.5":"76.0.3809.146","6.1.6":"76.0.3809.146","6.1.7":"76.0.3809.146","6.1.8":"76.0.3809.146","6.1.9":"76.0.3809.146","6.1.10":"76.0.3809.146","6.1.11":"76.0.3809.146","6.1.12":"76.0.3809.146","7.0.0-beta.1":"78.0.3866.0","7.0.0-beta.2":"78.0.3866.0","7.0.0-beta.3":"78.0.3866.0","7.0.0-beta.4":"78.0.3896.6","7.0.0-beta.5":"78.0.3905.1","7.0.0-beta.6":"78.0.3905.1","7.0.0-beta.7":"78.0.3905.1","7.0.0-nightly.20190521":"76.0.3784.0","7.0.0-nightly.20190529":"76.0.3806.0","7.0.0-nightly.20190530":"76.0.3806.0","7.0.0-nightly.20190531":"76.0.3806.0","7.0.0-nightly.20190602":"76.0.3806.0","7.0.0-nightly.20190603":"76.0.3806.0","7.0.0-nightly.20190604":"77.0.3814.0","7.0.0-nightly.20190605":"77.0.3815.0","7.0.0-nightly.20190606":"77.0.3815.0","7.0.0-nightly.20190607":"77.0.3815.0","7.0.0-nightly.20190608":"77.0.3815.0","7.0.0-nightly.20190609":"77.0.3815.0","7.0.0-nightly.20190611":"77.0.3815.0","7.0.0-nightly.20190612":"77.0.3815.0","7.0.0-nightly.20190613":"77.0.3815.0","7.0.0-nightly.20190615":"77.0.3815.0","7.0.0-nightly.20190616":"77.0.3815.0","7.0.0-nightly.20190618":"77.0.3815.0","7.0.0-nightly.20190619":"77.0.3815.0","7.0.0-nightly.20190622":"77.0.3815.0","7.0.0-nightly.20190623":"77.0.3815.0","7.0.0-nightly.20190624":"77.0.3815.0","7.0.0-nightly.20190627":"77.0.3815.0","7.0.0-nightly.20190629":"77.0.3815.0","7.0.0-nightly.20190630":"77.0.3815.0","7.0.0-nightly.20190701":"77.0.3815.0","7.0.0-nightly.20190702":"77.0.3815.0","7.0.0-nightly.20190704":"77.0.3843.0","7.0.0-nightly.20190705":"77.0.3843.0","7.0.0-nightly.20190719":"77.0.3848.0","7.0.0-nightly.20190720":"77.0.3848.0","7.0.0-nightly.20190721":"77.0.3848.0","7.0.0-nightly.20190726":"77.0.3864.0","7.0.0-nightly.20190727":"78.0.3866.0","7.0.0-nightly.20190728":"78.0.3866.0","7.0.0-nightly.20190729":"78.0.3866.0","7.0.0-nightly.20190730":"78.0.3866.0","7.0.0-nightly.20190731":"78.0.3866.0","7.0.0":"78.0.3905.1","7.0.1":"78.0.3904.92","7.1.0":"78.0.3904.94","7.1.1":"78.0.3904.99","7.1.2":"78.0.3904.113","7.1.3":"78.0.3904.126","7.1.4":"78.0.3904.130","7.1.5":"78.0.3904.130","7.1.6":"78.0.3904.130","7.1.7":"78.0.3904.130","7.1.8":"78.0.3904.130","7.1.9":"78.0.3904.130","7.1.10":"78.0.3904.130","7.1.11":"78.0.3904.130","7.1.12":"78.0.3904.130","7.1.13":"78.0.3904.130","7.1.14":"78.0.3904.130","7.2.0":"78.0.3904.130","7.2.1":"78.0.3904.130","7.2.2":"78.0.3904.130","7.2.3":"78.0.3904.130","7.2.4":"78.0.3904.130","7.3.0":"78.0.3904.130","7.3.1":"78.0.3904.130","7.3.2":"78.0.3904.130","7.3.3":"78.0.3904.130","8.0.0-beta.1":"79.0.3931.0","8.0.0-beta.2":"79.0.3931.0","8.0.0-beta.3":"80.0.3955.0","8.0.0-beta.4":"80.0.3955.0","8.0.0-beta.5":"80.0.3987.14","8.0.0-beta.6":"80.0.3987.51","8.0.0-beta.7":"80.0.3987.59","8.0.0-beta.8":"80.0.3987.75","8.0.0-beta.9":"80.0.3987.75","8.0.0-nightly.20190801":"78.0.3866.0","8.0.0-nightly.20190802":"78.0.3866.0","8.0.0-nightly.20190803":"78.0.3871.0","8.0.0-nightly.20190806":"78.0.3871.0","8.0.0-nightly.20190807":"78.0.3871.0","8.0.0-nightly.20190808":"78.0.3871.0","8.0.0-nightly.20190809":"78.0.3871.0","8.0.0-nightly.20190810":"78.0.3871.0","8.0.0-nightly.20190811":"78.0.3871.0","8.0.0-nightly.20190812":"78.0.3871.0","8.0.0-nightly.20190813":"78.0.3871.0","8.0.0-nightly.20190814":"78.0.3871.0","8.0.0-nightly.20190815":"78.0.3871.0","8.0.0-nightly.20190816":"78.0.3881.0","8.0.0-nightly.20190817":"78.0.3881.0","8.0.0-nightly.20190818":"78.0.3881.0","8.0.0-nightly.20190819":"78.0.3881.0","8.0.0-nightly.20190820":"78.0.3881.0","8.0.0-nightly.20190824":"78.0.3892.0","8.0.0-nightly.20190825":"78.0.3892.0","8.0.0-nightly.20190827":"78.0.3892.0","8.0.0-nightly.20190828":"78.0.3892.0","8.0.0-nightly.20190830":"78.0.3892.0","8.0.0-nightly.20190901":"78.0.3892.0","8.0.0-nightly.20190902":"78.0.3892.0","8.0.0-nightly.20190907":"78.0.3892.0","8.0.0-nightly.20190909":"78.0.3892.0","8.0.0-nightly.20190910":"78.0.3892.0","8.0.0-nightly.20190911":"78.0.3892.0","8.0.0-nightly.20190913":"78.0.3892.0","8.0.0-nightly.20190914":"78.0.3892.0","8.0.0-nightly.20190915":"78.0.3892.0","8.0.0-nightly.20190917":"78.0.3892.0","8.0.0-nightly.20190919":"79.0.3915.0","8.0.0-nightly.20190920":"79.0.3915.0","8.0.0-nightly.20190923":"79.0.3919.0","8.0.0-nightly.20190924":"79.0.3919.0","8.0.0-nightly.20190926":"79.0.3919.0","8.0.0-nightly.20190929":"79.0.3919.0","8.0.0-nightly.20190930":"79.0.3919.0","8.0.0-nightly.20191001":"79.0.3919.0","8.0.0-nightly.20191004":"79.0.3919.0","8.0.0-nightly.20191005":"79.0.3919.0","8.0.0-nightly.20191006":"79.0.3919.0","8.0.0-nightly.20191009":"79.0.3919.0","8.0.0-nightly.20191011":"79.0.3919.0","8.0.0-nightly.20191012":"79.0.3919.0","8.0.0-nightly.20191017":"79.0.3919.0","8.0.0-nightly.20191019":"79.0.3931.0","8.0.0-nightly.20191020":"79.0.3931.0","8.0.0-nightly.20191021":"79.0.3931.0","8.0.0-nightly.20191023":"79.0.3931.0","8.0.0-nightly.20191101":"80.0.3952.0","8.0.0-nightly.20191105":"80.0.3952.0","8.0.0":"80.0.3987.86","8.0.1":"80.0.3987.86","8.0.2":"80.0.3987.86","8.0.3":"80.0.3987.134","8.1.0":"80.0.3987.137","8.1.1":"80.0.3987.141","8.2.0":"80.0.3987.158","8.2.1":"80.0.3987.163","8.2.2":"80.0.3987.163","8.2.3":"80.0.3987.163","8.2.4":"80.0.3987.165","8.2.5":"80.0.3987.165","8.3.0":"80.0.3987.165","8.3.1":"80.0.3987.165","8.3.2":"80.0.3987.165","8.3.3":"80.0.3987.165","8.3.4":"80.0.3987.165","8.4.0":"80.0.3987.165","8.4.1":"80.0.3987.165","8.5.0":"80.0.3987.165","8.5.1":"80.0.3987.165","8.5.2":"80.0.3987.165","8.5.3":"80.0.3987.163","8.5.4":"80.0.3987.163","8.5.5":"80.0.3987.163","9.0.0-beta.1":"82.0.4048.0","9.0.0-beta.2":"82.0.4048.0","9.0.0-beta.3":"82.0.4048.0","9.0.0-beta.4":"82.0.4048.0","9.0.0-beta.5":"82.0.4048.0","9.0.0-beta.6":"82.0.4058.2","9.0.0-beta.7":"82.0.4058.2","9.0.0-beta.9":"82.0.4058.2","9.0.0-beta.10":"82.0.4085.10","9.0.0-beta.12":"82.0.4085.14","9.0.0-beta.13":"82.0.4085.14","9.0.0-beta.14":"82.0.4085.27","9.0.0-beta.15":"83.0.4102.3","9.0.0-beta.16":"83.0.4102.3","9.0.0-beta.17":"83.0.4103.14","9.0.0-beta.18":"83.0.4103.16","9.0.0-beta.19":"83.0.4103.24","9.0.0-beta.20":"83.0.4103.26","9.0.0-beta.21":"83.0.4103.26","9.0.0-beta.22":"83.0.4103.34","9.0.0-beta.23":"83.0.4103.44","9.0.0-beta.24":"83.0.4103.45","9.0.0-nightly.20191121":"80.0.3954.0","9.0.0-nightly.20191122":"80.0.3954.0","9.0.0-nightly.20191123":"80.0.3954.0","9.0.0-nightly.20191124":"80.0.3954.0","9.0.0-nightly.20191129":"80.0.3954.0","9.0.0-nightly.20191130":"80.0.3954.0","9.0.0-nightly.20191201":"80.0.3954.0","9.0.0-nightly.20191202":"80.0.3954.0","9.0.0-nightly.20191203":"80.0.3954.0","9.0.0-nightly.20191204":"80.0.3954.0","9.0.0-nightly.20191210":"80.0.3954.0","9.0.0-nightly.20191220":"81.0.3994.0","9.0.0-nightly.20191221":"81.0.3994.0","9.0.0-nightly.20191222":"81.0.3994.0","9.0.0-nightly.20191223":"81.0.3994.0","9.0.0-nightly.20191224":"81.0.3994.0","9.0.0-nightly.20191225":"81.0.3994.0","9.0.0-nightly.20191226":"81.0.3994.0","9.0.0-nightly.20191228":"81.0.3994.0","9.0.0-nightly.20191229":"81.0.3994.0","9.0.0-nightly.20191230":"81.0.3994.0","9.0.0-nightly.20191231":"81.0.3994.0","9.0.0-nightly.20200101":"81.0.3994.0","9.0.0-nightly.20200103":"81.0.3994.0","9.0.0-nightly.20200104":"81.0.3994.0","9.0.0-nightly.20200105":"81.0.3994.0","9.0.0-nightly.20200106":"81.0.3994.0","9.0.0-nightly.20200108":"81.0.3994.0","9.0.0-nightly.20200109":"81.0.3994.0","9.0.0-nightly.20200110":"81.0.3994.0","9.0.0-nightly.20200111":"81.0.3994.0","9.0.0-nightly.20200113":"81.0.3994.0","9.0.0-nightly.20200115":"81.0.3994.0","9.0.0-nightly.20200116":"81.0.3994.0","9.0.0-nightly.20200117":"81.0.3994.0","9.0.0-nightly.20200119":"81.0.4030.0","9.0.0-nightly.20200121":"81.0.4030.0","9.0.0":"83.0.4103.64","9.0.1":"83.0.4103.94","9.0.2":"83.0.4103.94","9.0.3":"83.0.4103.100","9.0.4":"83.0.4103.104","9.0.5":"83.0.4103.119","9.1.0":"83.0.4103.122","9.1.1":"83.0.4103.122","9.1.2":"83.0.4103.122","9.2.0":"83.0.4103.122","9.2.1":"83.0.4103.122","9.3.0":"83.0.4103.122","9.3.1":"83.0.4103.122","9.3.2":"83.0.4103.122","9.3.3":"83.0.4103.122","9.3.4":"83.0.4103.122","9.3.5":"83.0.4103.122","9.4.0":"83.0.4103.122","9.4.1":"83.0.4103.122","9.4.2":"83.0.4103.122","9.4.3":"83.0.4103.122","9.4.4":"83.0.4103.122","10.0.0-beta.1":"84.0.4129.0","10.0.0-beta.2":"84.0.4129.0","10.0.0-beta.3":"85.0.4161.2","10.0.0-beta.4":"85.0.4161.2","10.0.0-beta.8":"85.0.4181.1","10.0.0-beta.9":"85.0.4181.1","10.0.0-beta.10":"85.0.4183.19","10.0.0-beta.11":"85.0.4183.20","10.0.0-beta.12":"85.0.4183.26","10.0.0-beta.13":"85.0.4183.39","10.0.0-beta.14":"85.0.4183.39","10.0.0-beta.15":"85.0.4183.39","10.0.0-beta.17":"85.0.4183.39","10.0.0-beta.19":"85.0.4183.39","10.0.0-beta.20":"85.0.4183.39","10.0.0-beta.21":"85.0.4183.39","10.0.0-beta.23":"85.0.4183.70","10.0.0-beta.24":"85.0.4183.78","10.0.0-beta.25":"85.0.4183.80","10.0.0-nightly.20200209":"82.0.4050.0","10.0.0-nightly.20200210":"82.0.4050.0","10.0.0-nightly.20200211":"82.0.4050.0","10.0.0-nightly.20200216":"82.0.4050.0","10.0.0-nightly.20200217":"82.0.4050.0","10.0.0-nightly.20200218":"82.0.4050.0","10.0.0-nightly.20200221":"82.0.4050.0","10.0.0-nightly.20200222":"82.0.4050.0","10.0.0-nightly.20200223":"82.0.4050.0","10.0.0-nightly.20200226":"82.0.4050.0","10.0.0-nightly.20200303":"82.0.4050.0","10.0.0-nightly.20200304":"82.0.4076.0","10.0.0-nightly.20200305":"82.0.4076.0","10.0.0-nightly.20200306":"82.0.4076.0","10.0.0-nightly.20200309":"82.0.4076.0","10.0.0-nightly.20200310":"82.0.4076.0","10.0.0-nightly.20200311":"82.0.4083.0","10.0.0-nightly.20200316":"83.0.4086.0","10.0.0-nightly.20200317":"83.0.4087.0","10.0.0-nightly.20200318":"83.0.4087.0","10.0.0-nightly.20200320":"83.0.4087.0","10.0.0-nightly.20200323":"83.0.4087.0","10.0.0-nightly.20200324":"83.0.4087.0","10.0.0-nightly.20200325":"83.0.4087.0","10.0.0-nightly.20200326":"83.0.4087.0","10.0.0-nightly.20200327":"83.0.4087.0","10.0.0-nightly.20200330":"83.0.4087.0","10.0.0-nightly.20200331":"83.0.4087.0","10.0.0-nightly.20200401":"83.0.4087.0","10.0.0-nightly.20200402":"83.0.4087.0","10.0.0-nightly.20200403":"83.0.4087.0","10.0.0-nightly.20200406":"83.0.4087.0","10.0.0-nightly.20200408":"83.0.4095.0","10.0.0-nightly.20200410":"83.0.4095.0","10.0.0-nightly.20200413":"83.0.4095.0","10.0.0-nightly.20200414":"84.0.4114.0","10.0.0-nightly.20200415":"84.0.4115.0","10.0.0-nightly.20200416":"84.0.4115.0","10.0.0-nightly.20200417":"84.0.4115.0","10.0.0-nightly.20200422":"84.0.4121.0","10.0.0-nightly.20200423":"84.0.4121.0","10.0.0-nightly.20200427":"84.0.4125.0","10.0.0-nightly.20200428":"84.0.4125.0","10.0.0-nightly.20200429":"84.0.4125.0","10.0.0-nightly.20200430":"84.0.4125.0","10.0.0-nightly.20200501":"84.0.4129.0","10.0.0-nightly.20200504":"84.0.4129.0","10.0.0-nightly.20200505":"84.0.4129.0","10.0.0-nightly.20200506":"84.0.4129.0","10.0.0-nightly.20200507":"84.0.4129.0","10.0.0-nightly.20200508":"84.0.4129.0","10.0.0-nightly.20200511":"84.0.4129.0","10.0.0-nightly.20200512":"84.0.4129.0","10.0.0-nightly.20200513":"84.0.4129.0","10.0.0-nightly.20200514":"84.0.4129.0","10.0.0-nightly.20200515":"84.0.4129.0","10.0.0-nightly.20200518":"84.0.4129.0","10.0.0-nightly.20200519":"84.0.4129.0","10.0.0-nightly.20200520":"84.0.4129.0","10.0.0-nightly.20200521":"84.0.4129.0","10.0.0":"85.0.4183.84","10.0.1":"85.0.4183.86","10.1.0":"85.0.4183.87","10.1.1":"85.0.4183.93","10.1.2":"85.0.4183.98","10.1.3":"85.0.4183.121","10.1.4":"85.0.4183.121","10.1.5":"85.0.4183.121","10.1.6":"85.0.4183.121","10.1.7":"85.0.4183.121","10.2.0":"85.0.4183.121","10.3.0":"85.0.4183.121","10.3.1":"85.0.4183.121","10.3.2":"85.0.4183.121","10.4.0":"85.0.4183.121","10.4.1":"85.0.4183.121","10.4.2":"85.0.4183.121","10.4.3":"85.0.4183.121","10.4.4":"85.0.4183.121","10.4.5":"85.0.4183.121","10.4.6":"85.0.4183.121","10.4.7":"85.0.4183.121","11.0.0-beta.1":"86.0.4234.0","11.0.0-beta.3":"86.0.4234.0","11.0.0-beta.4":"86.0.4234.0","11.0.0-beta.5":"86.0.4234.0","11.0.0-beta.6":"86.0.4234.0","11.0.0-beta.7":"86.0.4234.0","11.0.0-beta.8":"87.0.4251.1","11.0.0-beta.9":"87.0.4251.1","11.0.0-beta.11":"87.0.4251.1","11.0.0-beta.12":"87.0.4280.11","11.0.0-beta.13":"87.0.4280.11","11.0.0-beta.16":"87.0.4280.27","11.0.0-beta.17":"87.0.4280.27","11.0.0-beta.18":"87.0.4280.27","11.0.0-beta.19":"87.0.4280.27","11.0.0-beta.20":"87.0.4280.40","11.0.0-beta.22":"87.0.4280.47","11.0.0-beta.23":"87.0.4280.47","11.0.0-nightly.20200525":"84.0.4129.0","11.0.0-nightly.20200526":"84.0.4129.0","11.0.0-nightly.20200529":"85.0.4156.0","11.0.0-nightly.20200602":"85.0.4162.0","11.0.0-nightly.20200603":"85.0.4162.0","11.0.0-nightly.20200604":"85.0.4162.0","11.0.0-nightly.20200609":"85.0.4162.0","11.0.0-nightly.20200610":"85.0.4162.0","11.0.0-nightly.20200611":"85.0.4162.0","11.0.0-nightly.20200615":"85.0.4162.0","11.0.0-nightly.20200616":"85.0.4162.0","11.0.0-nightly.20200617":"85.0.4162.0","11.0.0-nightly.20200618":"85.0.4162.0","11.0.0-nightly.20200619":"85.0.4162.0","11.0.0-nightly.20200701":"85.0.4179.0","11.0.0-nightly.20200702":"85.0.4179.0","11.0.0-nightly.20200703":"85.0.4179.0","11.0.0-nightly.20200706":"85.0.4179.0","11.0.0-nightly.20200707":"85.0.4179.0","11.0.0-nightly.20200708":"85.0.4179.0","11.0.0-nightly.20200709":"85.0.4179.0","11.0.0-nightly.20200716":"86.0.4203.0","11.0.0-nightly.20200717":"86.0.4203.0","11.0.0-nightly.20200720":"86.0.4203.0","11.0.0-nightly.20200721":"86.0.4203.0","11.0.0-nightly.20200723":"86.0.4209.0","11.0.0-nightly.20200724":"86.0.4209.0","11.0.0-nightly.20200729":"86.0.4209.0","11.0.0-nightly.20200730":"86.0.4209.0","11.0.0-nightly.20200731":"86.0.4209.0","11.0.0-nightly.20200803":"86.0.4209.0","11.0.0-nightly.20200804":"86.0.4209.0","11.0.0-nightly.20200805":"86.0.4209.0","11.0.0-nightly.20200811":"86.0.4209.0","11.0.0-nightly.20200812":"86.0.4209.0","11.0.0-nightly.20200822":"86.0.4234.0","11.0.0-nightly.20200824":"86.0.4234.0","11.0.0-nightly.20200825":"86.0.4234.0","11.0.0-nightly.20200826":"86.0.4234.0","11.0.0":"87.0.4280.60","11.0.1":"87.0.4280.60","11.0.2":"87.0.4280.67","11.0.3":"87.0.4280.67","11.0.4":"87.0.4280.67","11.0.5":"87.0.4280.88","11.1.0":"87.0.4280.88","11.1.1":"87.0.4280.88","11.2.0":"87.0.4280.141","11.2.1":"87.0.4280.141","11.2.2":"87.0.4280.141","11.2.3":"87.0.4280.141","11.3.0":"87.0.4280.141","11.4.0":"87.0.4280.141","11.4.1":"87.0.4280.141","11.4.2":"87.0.4280.141","11.4.3":"87.0.4280.141","11.4.4":"87.0.4280.141","11.4.5":"87.0.4280.141","11.4.6":"87.0.4280.141","11.4.7":"87.0.4280.141","11.4.8":"87.0.4280.141","11.4.9":"87.0.4280.141","11.4.10":"87.0.4280.141","11.4.11":"87.0.4280.141","11.4.12":"87.0.4280.141","11.5.0":"87.0.4280.141","12.0.0-beta.1":"89.0.4328.0","12.0.0-beta.3":"89.0.4328.0","12.0.0-beta.4":"89.0.4328.0","12.0.0-beta.5":"89.0.4328.0","12.0.0-beta.6":"89.0.4328.0","12.0.0-beta.7":"89.0.4328.0","12.0.0-beta.8":"89.0.4328.0","12.0.0-beta.9":"89.0.4328.0","12.0.0-beta.10":"89.0.4328.0","12.0.0-beta.11":"89.0.4328.0","12.0.0-beta.12":"89.0.4328.0","12.0.0-beta.14":"89.0.4328.0","12.0.0-beta.16":"89.0.4348.1","12.0.0-beta.18":"89.0.4348.1","12.0.0-beta.19":"89.0.4348.1","12.0.0-beta.20":"89.0.4348.1","12.0.0-beta.21":"89.0.4388.2","12.0.0-beta.22":"89.0.4388.2","12.0.0-beta.23":"89.0.4388.2","12.0.0-beta.24":"89.0.4388.2","12.0.0-beta.25":"89.0.4388.2","12.0.0-beta.26":"89.0.4388.2","12.0.0-beta.27":"89.0.4389.23","12.0.0-beta.28":"89.0.4389.23","12.0.0-beta.29":"89.0.4389.23","12.0.0-beta.30":"89.0.4389.58","12.0.0-beta.31":"89.0.4389.58","12.0.0-nightly.20200827":"86.0.4234.0","12.0.0-nightly.20200831":"86.0.4234.0","12.0.0-nightly.20200902":"86.0.4234.0","12.0.0-nightly.20200903":"86.0.4234.0","12.0.0-nightly.20200907":"86.0.4234.0","12.0.0-nightly.20200910":"86.0.4234.0","12.0.0-nightly.20200911":"86.0.4234.0","12.0.0-nightly.20200914":"86.0.4234.0","12.0.0-nightly.20201013":"87.0.4268.0","12.0.0-nightly.20201014":"87.0.4268.0","12.0.0-nightly.20201015":"87.0.4268.0","12.0.0-nightly.20201023":"88.0.4292.0","12.0.0-nightly.20201026":"88.0.4292.0","12.0.0-nightly.20201030":"88.0.4306.0","12.0.0-nightly.20201102":"88.0.4306.0","12.0.0-nightly.20201103":"88.0.4306.0","12.0.0-nightly.20201104":"88.0.4306.0","12.0.0-nightly.20201105":"88.0.4306.0","12.0.0-nightly.20201106":"88.0.4306.0","12.0.0-nightly.20201111":"88.0.4306.0","12.0.0-nightly.20201112":"88.0.4306.0","12.0.0-nightly.20201116":"88.0.4324.0","12.0.0":"89.0.4389.69","12.0.1":"89.0.4389.82","12.0.2":"89.0.4389.90","12.0.3":"89.0.4389.114","12.0.4":"89.0.4389.114","12.0.5":"89.0.4389.128","12.0.6":"89.0.4389.128","12.0.7":"89.0.4389.128","12.0.8":"89.0.4389.128","12.0.9":"89.0.4389.128","12.0.10":"89.0.4389.128","12.0.11":"89.0.4389.128","12.0.12":"89.0.4389.128","12.0.13":"89.0.4389.128","12.0.14":"89.0.4389.128","12.0.15":"89.0.4389.128","12.0.16":"89.0.4389.128","12.0.17":"89.0.4389.128","12.0.18":"89.0.4389.128","12.1.0":"89.0.4389.128","12.1.1":"89.0.4389.128","12.1.2":"89.0.4389.128","12.2.0":"89.0.4389.128","12.2.1":"89.0.4389.128","12.2.2":"89.0.4389.128","12.2.3":"89.0.4389.128","13.0.0-beta.2":"90.0.4402.0","13.0.0-beta.3":"90.0.4402.0","13.0.0-beta.4":"90.0.4415.0","13.0.0-beta.5":"90.0.4415.0","13.0.0-beta.6":"90.0.4415.0","13.0.0-beta.7":"90.0.4415.0","13.0.0-beta.8":"90.0.4415.0","13.0.0-beta.9":"90.0.4415.0","13.0.0-beta.11":"90.0.4415.0","13.0.0-beta.12":"90.0.4415.0","13.0.0-beta.13":"90.0.4415.0","13.0.0-beta.14":"91.0.4448.0","13.0.0-beta.16":"91.0.4448.0","13.0.0-beta.17":"91.0.4448.0","13.0.0-beta.18":"91.0.4448.0","13.0.0-beta.20":"91.0.4448.0","13.0.0-beta.21":"91.0.4472.33","13.0.0-beta.22":"91.0.4472.33","13.0.0-beta.23":"91.0.4472.33","13.0.0-beta.24":"91.0.4472.38","13.0.0-beta.26":"91.0.4472.38","13.0.0-beta.27":"91.0.4472.38","13.0.0-beta.28":"91.0.4472.38","13.0.0-nightly.20201119":"89.0.4328.0","13.0.0-nightly.20201123":"89.0.4328.0","13.0.0-nightly.20201124":"89.0.4328.0","13.0.0-nightly.20201126":"89.0.4328.0","13.0.0-nightly.20201127":"89.0.4328.0","13.0.0-nightly.20201130":"89.0.4328.0","13.0.0-nightly.20201201":"89.0.4328.0","13.0.0-nightly.20201202":"89.0.4328.0","13.0.0-nightly.20201203":"89.0.4328.0","13.0.0-nightly.20201204":"89.0.4328.0","13.0.0-nightly.20201207":"89.0.4328.0","13.0.0-nightly.20201208":"89.0.4328.0","13.0.0-nightly.20201209":"89.0.4328.0","13.0.0-nightly.20201210":"89.0.4328.0","13.0.0-nightly.20201211":"89.0.4328.0","13.0.0-nightly.20201214":"89.0.4328.0","13.0.0-nightly.20201215":"89.0.4349.0","13.0.0-nightly.20201216":"89.0.4349.0","13.0.0-nightly.20201221":"89.0.4349.0","13.0.0-nightly.20201222":"89.0.4349.0","13.0.0-nightly.20201223":"89.0.4359.0","13.0.0-nightly.20210104":"89.0.4359.0","13.0.0-nightly.20210108":"89.0.4359.0","13.0.0-nightly.20210111":"89.0.4359.0","13.0.0-nightly.20210113":"89.0.4386.0","13.0.0-nightly.20210114":"89.0.4386.0","13.0.0-nightly.20210118":"89.0.4386.0","13.0.0-nightly.20210122":"89.0.4386.0","13.0.0-nightly.20210125":"89.0.4386.0","13.0.0-nightly.20210127":"89.0.4389.0","13.0.0-nightly.20210128":"89.0.4389.0","13.0.0-nightly.20210129":"89.0.4389.0","13.0.0-nightly.20210201":"89.0.4389.0","13.0.0-nightly.20210202":"89.0.4389.0","13.0.0-nightly.20210203":"89.0.4389.0","13.0.0-nightly.20210205":"89.0.4389.0","13.0.0-nightly.20210208":"89.0.4389.0","13.0.0-nightly.20210209":"89.0.4389.0","13.0.0-nightly.20210210":"90.0.4402.0","13.0.0-nightly.20210211":"90.0.4402.0","13.0.0-nightly.20210212":"90.0.4402.0","13.0.0-nightly.20210216":"90.0.4402.0","13.0.0-nightly.20210217":"90.0.4402.0","13.0.0-nightly.20210218":"90.0.4402.0","13.0.0-nightly.20210219":"90.0.4402.0","13.0.0-nightly.20210222":"90.0.4402.0","13.0.0-nightly.20210225":"90.0.4402.0","13.0.0-nightly.20210226":"90.0.4402.0","13.0.0-nightly.20210301":"90.0.4402.0","13.0.0-nightly.20210302":"90.0.4402.0","13.0.0-nightly.20210303":"90.0.4402.0","13.0.0":"91.0.4472.69","13.0.1":"91.0.4472.69","13.1.0":"91.0.4472.77","13.1.1":"91.0.4472.77","13.1.2":"91.0.4472.77","13.1.3":"91.0.4472.106","13.1.4":"91.0.4472.106","13.1.5":"91.0.4472.124","13.1.6":"91.0.4472.124","13.1.7":"91.0.4472.124","13.1.8":"91.0.4472.164","13.1.9":"91.0.4472.164","13.2.0":"91.0.4472.164","13.2.1":"91.0.4472.164","13.2.2":"91.0.4472.164","13.2.3":"91.0.4472.164","13.3.0":"91.0.4472.164","13.4.0":"91.0.4472.164","13.5.0":"91.0.4472.164","13.5.1":"91.0.4472.164","13.5.2":"91.0.4472.164","13.6.0":"91.0.4472.164","13.6.1":"91.0.4472.164","13.6.2":"91.0.4472.164","14.0.0-beta.1":"92.0.4511.0","14.0.0-beta.2":"92.0.4511.0","14.0.0-beta.3":"92.0.4511.0","14.0.0-beta.5":"93.0.4536.0","14.0.0-beta.6":"93.0.4536.0","14.0.0-beta.7":"93.0.4536.0","14.0.0-beta.8":"93.0.4536.0","14.0.0-beta.9":"93.0.4539.0","14.0.0-beta.10":"93.0.4539.0","14.0.0-beta.11":"93.0.4557.4","14.0.0-beta.12":"93.0.4557.4","14.0.0-beta.13":"93.0.4566.0","14.0.0-beta.14":"93.0.4566.0","14.0.0-beta.15":"93.0.4566.0","14.0.0-beta.16":"93.0.4566.0","14.0.0-beta.17":"93.0.4566.0","14.0.0-beta.18":"93.0.4577.15","14.0.0-beta.19":"93.0.4577.15","14.0.0-beta.20":"93.0.4577.15","14.0.0-beta.21":"93.0.4577.15","14.0.0-beta.22":"93.0.4577.25","14.0.0-beta.23":"93.0.4577.25","14.0.0-beta.24":"93.0.4577.51","14.0.0-beta.25":"93.0.4577.51","14.0.0-nightly.20210304":"90.0.4402.0","14.0.0-nightly.20210305":"90.0.4415.0","14.0.0-nightly.20210308":"90.0.4415.0","14.0.0-nightly.20210309":"90.0.4415.0","14.0.0-nightly.20210311":"90.0.4415.0","14.0.0-nightly.20210315":"90.0.4415.0","14.0.0-nightly.20210316":"90.0.4415.0","14.0.0-nightly.20210317":"90.0.4415.0","14.0.0-nightly.20210318":"90.0.4415.0","14.0.0-nightly.20210319":"90.0.4415.0","14.0.0-nightly.20210323":"90.0.4415.0","14.0.0-nightly.20210324":"90.0.4415.0","14.0.0-nightly.20210325":"90.0.4415.0","14.0.0-nightly.20210326":"90.0.4415.0","14.0.0-nightly.20210329":"90.0.4415.0","14.0.0-nightly.20210330":"90.0.4415.0","14.0.0-nightly.20210331":"91.0.4448.0","14.0.0-nightly.20210401":"91.0.4448.0","14.0.0-nightly.20210402":"91.0.4448.0","14.0.0-nightly.20210406":"91.0.4448.0","14.0.0-nightly.20210407":"91.0.4448.0","14.0.0-nightly.20210408":"91.0.4448.0","14.0.0-nightly.20210409":"91.0.4448.0","14.0.0-nightly.20210413":"91.0.4448.0","14.0.0-nightly.20210426":"92.0.4475.0","14.0.0-nightly.20210427":"92.0.4475.0","14.0.0-nightly.20210430":"92.0.4488.0","14.0.0-nightly.20210503":"92.0.4488.0","14.0.0-nightly.20210505":"92.0.4496.0","14.0.0-nightly.20210506":"92.0.4498.0","14.0.0-nightly.20210507":"92.0.4499.0","14.0.0-nightly.20210510":"92.0.4499.0","14.0.0-nightly.20210511":"92.0.4499.0","14.0.0-nightly.20210512":"92.0.4499.0","14.0.0-nightly.20210513":"92.0.4499.0","14.0.0-nightly.20210514":"92.0.4505.0","14.0.0-nightly.20210517":"92.0.4505.0","14.0.0-nightly.20210518":"92.0.4505.0","14.0.0-nightly.20210519":"92.0.4505.0","14.0.0-nightly.20210520":"92.0.4511.0","14.0.0-nightly.20210523":"92.0.4511.0","14.0.0-nightly.20210524":"92.0.4511.0","14.0.0":"93.0.4577.58","14.0.1":"93.0.4577.63","14.0.2":"93.0.4577.82","14.1.0":"93.0.4577.82","14.1.1":"93.0.4577.82","14.2.0":"93.0.4577.82","14.2.1":"93.0.4577.82","15.0.0-alpha.1":"93.0.4566.0","15.0.0-alpha.2":"93.0.4566.0","15.0.0-alpha.3":"94.0.4584.0","15.0.0-alpha.4":"94.0.4584.0","15.0.0-alpha.5":"94.0.4584.0","15.0.0-alpha.6":"94.0.4584.0","15.0.0-alpha.7":"94.0.4590.2","15.0.0-alpha.8":"94.0.4590.2","15.0.0-alpha.9":"94.0.4590.2","15.0.0-alpha.10":"94.0.4606.12","15.0.0-beta.1":"94.0.4606.20","15.0.0-beta.2":"94.0.4606.20","15.0.0-beta.3":"94.0.4606.31","15.0.0-beta.4":"94.0.4606.31","15.0.0-beta.5":"94.0.4606.31","15.0.0-beta.6":"94.0.4606.31","15.0.0-beta.7":"94.0.4606.31","15.0.0-nightly.20210527":"92.0.4511.0","15.0.0-nightly.20210528":"92.0.4511.0","15.0.0-nightly.20210531":"92.0.4511.0","15.0.0-nightly.20210601":"92.0.4511.0","15.0.0-nightly.20210602":"92.0.4511.0","15.0.0-nightly.20210603":"93.0.4530.0","15.0.0-nightly.20210604":"93.0.4530.0","15.0.0-nightly.20210608":"93.0.4535.0","15.0.0-nightly.20210609":"93.0.4536.0","15.0.0-nightly.20210610":"93.0.4536.0","15.0.0-nightly.20210611":"93.0.4536.0","15.0.0-nightly.20210614":"93.0.4536.0","15.0.0-nightly.20210615":"93.0.4536.0","15.0.0-nightly.20210616":"93.0.4536.0","15.0.0-nightly.20210617":"93.0.4539.0","15.0.0-nightly.20210618":"93.0.4539.0","15.0.0-nightly.20210621":"93.0.4539.0","15.0.0-nightly.20210622":"93.0.4539.0","15.0.0-nightly.20210623":"93.0.4550.0","15.0.0-nightly.20210624":"93.0.4550.0","15.0.0-nightly.20210625":"93.0.4552.0","15.0.0-nightly.20210628":"93.0.4552.0","15.0.0-nightly.20210629":"93.0.4552.0","15.0.0-nightly.20210630":"93.0.4558.0","15.0.0-nightly.20210701":"93.0.4558.0","15.0.0-nightly.20210702":"93.0.4558.0","15.0.0-nightly.20210705":"93.0.4558.0","15.0.0-nightly.20210706":"93.0.4566.0","15.0.0-nightly.20210707":"93.0.4566.0","15.0.0-nightly.20210708":"93.0.4566.0","15.0.0-nightly.20210709":"93.0.4566.0","15.0.0-nightly.20210712":"93.0.4566.0","15.0.0-nightly.20210713":"93.0.4566.0","15.0.0-nightly.20210714":"93.0.4566.0","15.0.0-nightly.20210715":"93.0.4566.0","15.0.0-nightly.20210716":"93.0.4566.0","15.0.0-nightly.20210719":"93.0.4566.0","15.0.0-nightly.20210720":"93.0.4566.0","15.0.0-nightly.20210721":"93.0.4566.0","15.0.0":"94.0.4606.51","15.1.0":"94.0.4606.61","15.1.1":"94.0.4606.61","15.1.2":"94.0.4606.71","15.2.0":"94.0.4606.81","15.3.0":"94.0.4606.81","15.3.1":"94.0.4606.81","15.3.2":"94.0.4606.81","16.0.0-alpha.1":"95.0.4629.0","16.0.0-alpha.2":"95.0.4629.0","16.0.0-alpha.3":"95.0.4629.0","16.0.0-alpha.4":"95.0.4629.0","16.0.0-alpha.5":"95.0.4629.0","16.0.0-alpha.6":"95.0.4629.0","16.0.0-alpha.7":"95.0.4629.0","16.0.0-alpha.8":"96.0.4647.0","16.0.0-alpha.9":"96.0.4647.0","16.0.0-beta.1":"96.0.4647.0","16.0.0-beta.2":"96.0.4647.0","16.0.0-beta.3":"96.0.4647.0","16.0.0-beta.4":"96.0.4664.18","16.0.0-beta.5":"96.0.4664.18","16.0.0-beta.6":"96.0.4664.27","16.0.0-beta.7":"96.0.4664.27","16.0.0-beta.8":"96.0.4664.35","16.0.0-beta.9":"96.0.4664.35","16.0.0-nightly.20210722":"93.0.4566.0","16.0.0-nightly.20210723":"93.0.4566.0","16.0.0-nightly.20210726":"93.0.4566.0","16.0.0-nightly.20210727":"94.0.4584.0","16.0.0-nightly.20210728":"94.0.4584.0","16.0.0-nightly.20210729":"94.0.4584.0","16.0.0-nightly.20210730":"94.0.4584.0","16.0.0-nightly.20210802":"94.0.4584.0","16.0.0-nightly.20210803":"94.0.4584.0","16.0.0-nightly.20210804":"94.0.4584.0","16.0.0-nightly.20210805":"94.0.4584.0","16.0.0-nightly.20210806":"94.0.4584.0","16.0.0-nightly.20210809":"94.0.4584.0","16.0.0-nightly.20210810":"94.0.4584.0","16.0.0-nightly.20210811":"94.0.4584.0","16.0.0-nightly.20210812":"94.0.4590.2","16.0.0-nightly.20210813":"94.0.4590.2","16.0.0-nightly.20210816":"94.0.4590.2","16.0.0-nightly.20210817":"94.0.4590.2","16.0.0-nightly.20210818":"94.0.4590.2","16.0.0-nightly.20210819":"94.0.4590.2","16.0.0-nightly.20210820":"94.0.4590.2","16.0.0-nightly.20210823":"94.0.4590.2","16.0.0-nightly.20210824":"95.0.4612.5","16.0.0-nightly.20210825":"95.0.4612.5","16.0.0-nightly.20210826":"95.0.4612.5","16.0.0-nightly.20210827":"95.0.4612.5","16.0.0-nightly.20210830":"95.0.4612.5","16.0.0-nightly.20210831":"95.0.4612.5","16.0.0-nightly.20210901":"95.0.4612.5","16.0.0-nightly.20210902":"95.0.4629.0","16.0.0-nightly.20210903":"95.0.4629.0","16.0.0-nightly.20210906":"95.0.4629.0","16.0.0-nightly.20210907":"95.0.4629.0","16.0.0-nightly.20210908":"95.0.4629.0","16.0.0-nightly.20210909":"95.0.4629.0","16.0.0-nightly.20210910":"95.0.4629.0","16.0.0-nightly.20210913":"95.0.4629.0","16.0.0-nightly.20210914":"95.0.4629.0","16.0.0-nightly.20210915":"95.0.4629.0","16.0.0-nightly.20210916":"95.0.4629.0","16.0.0-nightly.20210917":"95.0.4629.0","16.0.0-nightly.20210920":"95.0.4629.0","16.0.0-nightly.20210921":"95.0.4629.0","16.0.0-nightly.20210922":"95.0.4629.0","16.0.0":"96.0.4664.45","16.0.1":"96.0.4664.45","16.0.2":"96.0.4664.55","17.0.0-alpha.1":"96.0.4664.4","17.0.0-alpha.2":"96.0.4664.4","17.0.0-alpha.3":"96.0.4664.4","17.0.0-alpha.4":"98.0.4706.0","17.0.0-nightly.20210923":"95.0.4629.0","17.0.0-nightly.20210924":"95.0.4629.0","17.0.0-nightly.20210927":"95.0.4629.0","17.0.0-nightly.20210928":"95.0.4629.0","17.0.0-nightly.20210929":"95.0.4629.0","17.0.0-nightly.20210930":"95.0.4629.0","17.0.0-nightly.20211001":"95.0.4629.0","17.0.0-nightly.20211004":"95.0.4629.0","17.0.0-nightly.20211005":"95.0.4629.0","17.0.0-nightly.20211006":"96.0.4647.0","17.0.0-nightly.20211007":"96.0.4647.0","17.0.0-nightly.20211008":"96.0.4647.0","17.0.0-nightly.20211011":"96.0.4647.0","17.0.0-nightly.20211012":"96.0.4647.0","17.0.0-nightly.20211013":"96.0.4647.0","17.0.0-nightly.20211014":"96.0.4647.0","17.0.0-nightly.20211015":"96.0.4647.0","17.0.0-nightly.20211018":"96.0.4647.0","17.0.0-nightly.20211019":"96.0.4647.0","17.0.0-nightly.20211020":"96.0.4647.0","17.0.0-nightly.20211021":"96.0.4647.0","17.0.0-nightly.20211022":"96.0.4664.4","17.0.0-nightly.20211025":"96.0.4664.4","17.0.0-nightly.20211026":"96.0.4664.4","17.0.0-nightly.20211027":"96.0.4664.4","17.0.0-nightly.20211028":"96.0.4664.4","17.0.0-nightly.20211029":"96.0.4664.4","17.0.0-nightly.20211101":"96.0.4664.4","17.0.0-nightly.20211102":"96.0.4664.4","17.0.0-nightly.20211103":"96.0.4664.4","17.0.0-nightly.20211104":"96.0.4664.4","17.0.0-nightly.20211105":"96.0.4664.4","17.0.0-nightly.20211108":"96.0.4664.4","17.0.0-nightly.20211109":"96.0.4664.4","17.0.0-nightly.20211110":"96.0.4664.4","17.0.0-nightly.20211111":"96.0.4664.4","17.0.0-nightly.20211112":"96.0.4664.4","17.0.0-nightly.20211115":"96.0.4664.4","17.0.0-nightly.20211116":"96.0.4664.4","17.0.0-nightly.20211117":"96.0.4664.4","18.0.0-nightly.20211118":"96.0.4664.4","18.0.0-nightly.20211119":"96.0.4664.4","18.0.0-nightly.20211122":"96.0.4664.4","18.0.0-nightly.20211123":"96.0.4664.4","18.0.0-nightly.20211124":"98.0.4706.0","18.0.0-nightly.20211125":"98.0.4706.0","18.0.0-nightly.20211126":"98.0.4706.0"} \ No newline at end of file +{"0.20.0":"39.0.2171.65","0.20.1":"39.0.2171.65","0.20.2":"39.0.2171.65","0.20.3":"39.0.2171.65","0.20.4":"39.0.2171.65","0.20.5":"39.0.2171.65","0.20.6":"39.0.2171.65","0.20.7":"39.0.2171.65","0.20.8":"39.0.2171.65","0.21.0":"40.0.2214.91","0.21.1":"40.0.2214.91","0.21.2":"40.0.2214.91","0.21.3":"41.0.2272.76","0.22.1":"41.0.2272.76","0.22.2":"41.0.2272.76","0.22.3":"41.0.2272.76","0.23.0":"41.0.2272.76","0.24.0":"41.0.2272.76","0.25.0":"42.0.2311.107","0.25.1":"42.0.2311.107","0.25.2":"42.0.2311.107","0.25.3":"42.0.2311.107","0.26.0":"42.0.2311.107","0.26.1":"42.0.2311.107","0.27.0":"42.0.2311.107","0.27.1":"42.0.2311.107","0.27.2":"43.0.2357.65","0.27.3":"43.0.2357.65","0.28.0":"43.0.2357.65","0.28.1":"43.0.2357.65","0.28.2":"43.0.2357.65","0.28.3":"43.0.2357.65","0.29.1":"43.0.2357.65","0.29.2":"43.0.2357.65","0.30.4":"44.0.2403.125","0.31.0":"44.0.2403.125","0.31.2":"45.0.2454.85","0.32.2":"45.0.2454.85","0.32.3":"45.0.2454.85","0.33.0":"45.0.2454.85","0.33.1":"45.0.2454.85","0.33.2":"45.0.2454.85","0.33.3":"45.0.2454.85","0.33.4":"45.0.2454.85","0.33.6":"45.0.2454.85","0.33.7":"45.0.2454.85","0.33.8":"45.0.2454.85","0.33.9":"45.0.2454.85","0.34.0":"45.0.2454.85","0.34.1":"45.0.2454.85","0.34.2":"45.0.2454.85","0.34.3":"45.0.2454.85","0.34.4":"45.0.2454.85","0.35.1":"45.0.2454.85","0.35.2":"45.0.2454.85","0.35.3":"45.0.2454.85","0.35.4":"45.0.2454.85","0.35.5":"45.0.2454.85","0.36.0":"47.0.2526.73","0.36.2":"47.0.2526.73","0.36.3":"47.0.2526.73","0.36.4":"47.0.2526.73","0.36.5":"47.0.2526.110","0.36.6":"47.0.2526.110","0.36.7":"47.0.2526.110","0.36.8":"47.0.2526.110","0.36.9":"47.0.2526.110","0.36.10":"47.0.2526.110","0.36.11":"47.0.2526.110","0.36.12":"47.0.2526.110","0.37.0":"49.0.2623.75","0.37.1":"49.0.2623.75","0.37.3":"49.0.2623.75","0.37.4":"49.0.2623.75","0.37.5":"49.0.2623.75","0.37.6":"49.0.2623.75","0.37.7":"49.0.2623.75","0.37.8":"49.0.2623.75","1.0.0":"49.0.2623.75","1.0.1":"49.0.2623.75","1.0.2":"49.0.2623.75","1.1.0":"50.0.2661.102","1.1.1":"50.0.2661.102","1.1.2":"50.0.2661.102","1.1.3":"50.0.2661.102","1.2.0":"51.0.2704.63","1.2.1":"51.0.2704.63","1.2.2":"51.0.2704.84","1.2.3":"51.0.2704.84","1.2.4":"51.0.2704.103","1.2.5":"51.0.2704.103","1.2.6":"51.0.2704.106","1.2.7":"51.0.2704.106","1.2.8":"51.0.2704.106","1.3.0":"52.0.2743.82","1.3.1":"52.0.2743.82","1.3.2":"52.0.2743.82","1.3.3":"52.0.2743.82","1.3.4":"52.0.2743.82","1.3.5":"52.0.2743.82","1.3.6":"52.0.2743.82","1.3.7":"52.0.2743.82","1.3.9":"52.0.2743.82","1.3.10":"52.0.2743.82","1.3.13":"52.0.2743.82","1.3.14":"52.0.2743.82","1.3.15":"52.0.2743.82","1.4.0":"53.0.2785.113","1.4.1":"53.0.2785.113","1.4.2":"53.0.2785.113","1.4.3":"53.0.2785.113","1.4.4":"53.0.2785.113","1.4.5":"53.0.2785.113","1.4.6":"53.0.2785.143","1.4.7":"53.0.2785.143","1.4.8":"53.0.2785.143","1.4.10":"53.0.2785.143","1.4.11":"53.0.2785.143","1.4.12":"54.0.2840.51","1.4.13":"53.0.2785.143","1.4.14":"53.0.2785.143","1.4.15":"53.0.2785.143","1.4.16":"53.0.2785.143","1.5.0":"54.0.2840.101","1.5.1":"54.0.2840.101","1.6.0":"56.0.2924.87","1.6.1":"56.0.2924.87","1.6.2":"56.0.2924.87","1.6.3":"56.0.2924.87","1.6.4":"56.0.2924.87","1.6.5":"56.0.2924.87","1.6.6":"56.0.2924.87","1.6.7":"56.0.2924.87","1.6.8":"56.0.2924.87","1.6.9":"56.0.2924.87","1.6.10":"56.0.2924.87","1.6.11":"56.0.2924.87","1.6.12":"56.0.2924.87","1.6.13":"56.0.2924.87","1.6.14":"56.0.2924.87","1.6.15":"56.0.2924.87","1.6.16":"56.0.2924.87","1.6.17":"56.0.2924.87","1.6.18":"56.0.2924.87","1.7.0":"58.0.3029.110","1.7.1":"58.0.3029.110","1.7.2":"58.0.3029.110","1.7.3":"58.0.3029.110","1.7.4":"58.0.3029.110","1.7.5":"58.0.3029.110","1.7.6":"58.0.3029.110","1.7.7":"58.0.3029.110","1.7.8":"58.0.3029.110","1.7.9":"58.0.3029.110","1.7.10":"58.0.3029.110","1.7.11":"58.0.3029.110","1.7.12":"58.0.3029.110","1.7.13":"58.0.3029.110","1.7.14":"58.0.3029.110","1.7.15":"58.0.3029.110","1.7.16":"58.0.3029.110","1.8.0":"59.0.3071.115","1.8.1":"59.0.3071.115","1.8.2-beta.1":"59.0.3071.115","1.8.2-beta.2":"59.0.3071.115","1.8.2-beta.3":"59.0.3071.115","1.8.2-beta.4":"59.0.3071.115","1.8.2-beta.5":"59.0.3071.115","1.8.2":"59.0.3071.115","1.8.3":"59.0.3071.115","1.8.4":"59.0.3071.115","1.8.5":"59.0.3071.115","1.8.6":"59.0.3071.115","1.8.7":"59.0.3071.115","1.8.8":"59.0.3071.115","2.0.0-beta.1":"61.0.3163.100","2.0.0-beta.2":"61.0.3163.100","2.0.0-beta.3":"61.0.3163.100","2.0.0-beta.4":"61.0.3163.100","2.0.0-beta.5":"61.0.3163.100","2.0.0-beta.6":"61.0.3163.100","2.0.0-beta.7":"61.0.3163.100","2.0.0-beta.8":"61.0.3163.100","2.0.0":"61.0.3163.100","2.0.1":"61.0.3163.100","2.0.2":"61.0.3163.100","2.0.3":"61.0.3163.100","2.0.4":"61.0.3163.100","2.0.5":"61.0.3163.100","2.0.6":"61.0.3163.100","2.0.7":"61.0.3163.100","2.0.8-nightly.20180819":"61.0.3163.100","2.0.8-nightly.20180820":"61.0.3163.100","2.0.8":"61.0.3163.100","2.0.9":"61.0.3163.100","2.0.10":"61.0.3163.100","2.0.11":"61.0.3163.100","2.0.12":"61.0.3163.100","2.0.13":"61.0.3163.100","2.0.14":"61.0.3163.100","2.0.15":"61.0.3163.100","2.0.16":"61.0.3163.100","2.0.17":"61.0.3163.100","2.0.18":"61.0.3163.100","2.1.0-unsupported.20180809":"61.0.3163.100","3.0.0-beta.1":"66.0.3359.181","3.0.0-beta.2":"66.0.3359.181","3.0.0-beta.3":"66.0.3359.181","3.0.0-beta.4":"66.0.3359.181","3.0.0-beta.5":"66.0.3359.181","3.0.0-beta.6":"66.0.3359.181","3.0.0-beta.7":"66.0.3359.181","3.0.0-beta.8":"66.0.3359.181","3.0.0-beta.9":"66.0.3359.181","3.0.0-beta.10":"66.0.3359.181","3.0.0-beta.11":"66.0.3359.181","3.0.0-beta.12":"66.0.3359.181","3.0.0-beta.13":"66.0.3359.181","3.0.0-nightly.20180818":"66.0.3359.181","3.0.0-nightly.20180821":"66.0.3359.181","3.0.0-nightly.20180823":"66.0.3359.181","3.0.0-nightly.20180904":"66.0.3359.181","3.0.0":"66.0.3359.181","3.0.1":"66.0.3359.181","3.0.2":"66.0.3359.181","3.0.3":"66.0.3359.181","3.0.4":"66.0.3359.181","3.0.5":"66.0.3359.181","3.0.6":"66.0.3359.181","3.0.7":"66.0.3359.181","3.0.8":"66.0.3359.181","3.0.9":"66.0.3359.181","3.0.10":"66.0.3359.181","3.0.11":"66.0.3359.181","3.0.12":"66.0.3359.181","3.0.13":"66.0.3359.181","3.0.14":"66.0.3359.181","3.0.15":"66.0.3359.181","3.0.16":"66.0.3359.181","3.1.0-beta.1":"66.0.3359.181","3.1.0-beta.2":"66.0.3359.181","3.1.0-beta.3":"66.0.3359.181","3.1.0-beta.4":"66.0.3359.181","3.1.0-beta.5":"66.0.3359.181","3.1.0":"66.0.3359.181","3.1.1":"66.0.3359.181","3.1.2":"66.0.3359.181","3.1.3":"66.0.3359.181","3.1.4":"66.0.3359.181","3.1.5":"66.0.3359.181","3.1.6":"66.0.3359.181","3.1.7":"66.0.3359.181","3.1.8":"66.0.3359.181","3.1.9":"66.0.3359.181","3.1.10":"66.0.3359.181","3.1.11":"66.0.3359.181","3.1.12":"66.0.3359.181","3.1.13":"66.0.3359.181","4.0.0-beta.1":"69.0.3497.106","4.0.0-beta.2":"69.0.3497.106","4.0.0-beta.3":"69.0.3497.106","4.0.0-beta.4":"69.0.3497.106","4.0.0-beta.5":"69.0.3497.106","4.0.0-beta.6":"69.0.3497.106","4.0.0-beta.7":"69.0.3497.106","4.0.0-beta.8":"69.0.3497.106","4.0.0-beta.9":"69.0.3497.106","4.0.0-beta.10":"69.0.3497.106","4.0.0-beta.11":"69.0.3497.106","4.0.0-nightly.20180817":"66.0.3359.181","4.0.0-nightly.20180819":"66.0.3359.181","4.0.0-nightly.20180821":"66.0.3359.181","4.0.0-nightly.20180929":"67.0.3396.99","4.0.0-nightly.20181006":"68.0.3440.128","4.0.0-nightly.20181010":"69.0.3497.106","4.0.0":"69.0.3497.106","4.0.1":"69.0.3497.106","4.0.2":"69.0.3497.106","4.0.3":"69.0.3497.106","4.0.4":"69.0.3497.106","4.0.5":"69.0.3497.106","4.0.6":"69.0.3497.106","4.0.7":"69.0.3497.128","4.0.8":"69.0.3497.128","4.1.0":"69.0.3497.128","4.1.1":"69.0.3497.128","4.1.2":"69.0.3497.128","4.1.3":"69.0.3497.128","4.1.4":"69.0.3497.128","4.1.5":"69.0.3497.128","4.2.0":"69.0.3497.128","4.2.1":"69.0.3497.128","4.2.2":"69.0.3497.128","4.2.3":"69.0.3497.128","4.2.4":"69.0.3497.128","4.2.5":"69.0.3497.128","4.2.6":"69.0.3497.128","4.2.7":"69.0.3497.128","4.2.8":"69.0.3497.128","4.2.9":"69.0.3497.128","4.2.10":"69.0.3497.128","4.2.11":"69.0.3497.128","4.2.12":"69.0.3497.128","5.0.0-beta.1":"72.0.3626.52","5.0.0-beta.2":"72.0.3626.52","5.0.0-beta.3":"73.0.3683.27","5.0.0-beta.4":"73.0.3683.54","5.0.0-beta.5":"73.0.3683.61","5.0.0-beta.6":"73.0.3683.84","5.0.0-beta.7":"73.0.3683.94","5.0.0-beta.8":"73.0.3683.104","5.0.0-beta.9":"73.0.3683.117","5.0.0-nightly.20190107":"70.0.3538.110","5.0.0-nightly.20190121":"71.0.3578.98","5.0.0-nightly.20190122":"71.0.3578.98","5.0.0":"73.0.3683.119","5.0.1":"73.0.3683.121","5.0.2":"73.0.3683.121","5.0.3":"73.0.3683.121","5.0.4":"73.0.3683.121","5.0.5":"73.0.3683.121","5.0.6":"73.0.3683.121","5.0.7":"73.0.3683.121","5.0.8":"73.0.3683.121","5.0.9":"73.0.3683.121","5.0.10":"73.0.3683.121","5.0.11":"73.0.3683.121","5.0.12":"73.0.3683.121","5.0.13":"73.0.3683.121","6.0.0-beta.1":"76.0.3774.1","6.0.0-beta.2":"76.0.3783.1","6.0.0-beta.3":"76.0.3783.1","6.0.0-beta.4":"76.0.3783.1","6.0.0-beta.5":"76.0.3805.4","6.0.0-beta.6":"76.0.3809.3","6.0.0-beta.7":"76.0.3809.22","6.0.0-beta.8":"76.0.3809.26","6.0.0-beta.9":"76.0.3809.26","6.0.0-beta.10":"76.0.3809.37","6.0.0-beta.11":"76.0.3809.42","6.0.0-beta.12":"76.0.3809.54","6.0.0-beta.13":"76.0.3809.60","6.0.0-beta.14":"76.0.3809.68","6.0.0-beta.15":"76.0.3809.74","6.0.0-nightly.20190212":"72.0.3626.107","6.0.0-nightly.20190213":"72.0.3626.110","6.0.0-nightly.20190311":"74.0.3724.8","6.0.0":"76.0.3809.88","6.0.1":"76.0.3809.102","6.0.2":"76.0.3809.110","6.0.3":"76.0.3809.126","6.0.4":"76.0.3809.131","6.0.5":"76.0.3809.136","6.0.6":"76.0.3809.138","6.0.7":"76.0.3809.139","6.0.8":"76.0.3809.146","6.0.9":"76.0.3809.146","6.0.10":"76.0.3809.146","6.0.11":"76.0.3809.146","6.0.12":"76.0.3809.146","6.1.0":"76.0.3809.146","6.1.1":"76.0.3809.146","6.1.2":"76.0.3809.146","6.1.3":"76.0.3809.146","6.1.4":"76.0.3809.146","6.1.5":"76.0.3809.146","6.1.6":"76.0.3809.146","6.1.7":"76.0.3809.146","6.1.8":"76.0.3809.146","6.1.9":"76.0.3809.146","6.1.10":"76.0.3809.146","6.1.11":"76.0.3809.146","6.1.12":"76.0.3809.146","7.0.0-beta.1":"78.0.3866.0","7.0.0-beta.2":"78.0.3866.0","7.0.0-beta.3":"78.0.3866.0","7.0.0-beta.4":"78.0.3896.6","7.0.0-beta.5":"78.0.3905.1","7.0.0-beta.6":"78.0.3905.1","7.0.0-beta.7":"78.0.3905.1","7.0.0-nightly.20190521":"76.0.3784.0","7.0.0-nightly.20190529":"76.0.3806.0","7.0.0-nightly.20190530":"76.0.3806.0","7.0.0-nightly.20190531":"76.0.3806.0","7.0.0-nightly.20190602":"76.0.3806.0","7.0.0-nightly.20190603":"76.0.3806.0","7.0.0-nightly.20190604":"77.0.3814.0","7.0.0-nightly.20190605":"77.0.3815.0","7.0.0-nightly.20190606":"77.0.3815.0","7.0.0-nightly.20190607":"77.0.3815.0","7.0.0-nightly.20190608":"77.0.3815.0","7.0.0-nightly.20190609":"77.0.3815.0","7.0.0-nightly.20190611":"77.0.3815.0","7.0.0-nightly.20190612":"77.0.3815.0","7.0.0-nightly.20190613":"77.0.3815.0","7.0.0-nightly.20190615":"77.0.3815.0","7.0.0-nightly.20190616":"77.0.3815.0","7.0.0-nightly.20190618":"77.0.3815.0","7.0.0-nightly.20190619":"77.0.3815.0","7.0.0-nightly.20190622":"77.0.3815.0","7.0.0-nightly.20190623":"77.0.3815.0","7.0.0-nightly.20190624":"77.0.3815.0","7.0.0-nightly.20190627":"77.0.3815.0","7.0.0-nightly.20190629":"77.0.3815.0","7.0.0-nightly.20190630":"77.0.3815.0","7.0.0-nightly.20190701":"77.0.3815.0","7.0.0-nightly.20190702":"77.0.3815.0","7.0.0-nightly.20190704":"77.0.3843.0","7.0.0-nightly.20190705":"77.0.3843.0","7.0.0-nightly.20190719":"77.0.3848.0","7.0.0-nightly.20190720":"77.0.3848.0","7.0.0-nightly.20190721":"77.0.3848.0","7.0.0-nightly.20190726":"77.0.3864.0","7.0.0-nightly.20190727":"78.0.3866.0","7.0.0-nightly.20190728":"78.0.3866.0","7.0.0-nightly.20190729":"78.0.3866.0","7.0.0-nightly.20190730":"78.0.3866.0","7.0.0-nightly.20190731":"78.0.3866.0","7.0.0":"78.0.3905.1","7.0.1":"78.0.3904.92","7.1.0":"78.0.3904.94","7.1.1":"78.0.3904.99","7.1.2":"78.0.3904.113","7.1.3":"78.0.3904.126","7.1.4":"78.0.3904.130","7.1.5":"78.0.3904.130","7.1.6":"78.0.3904.130","7.1.7":"78.0.3904.130","7.1.8":"78.0.3904.130","7.1.9":"78.0.3904.130","7.1.10":"78.0.3904.130","7.1.11":"78.0.3904.130","7.1.12":"78.0.3904.130","7.1.13":"78.0.3904.130","7.1.14":"78.0.3904.130","7.2.0":"78.0.3904.130","7.2.1":"78.0.3904.130","7.2.2":"78.0.3904.130","7.2.3":"78.0.3904.130","7.2.4":"78.0.3904.130","7.3.0":"78.0.3904.130","7.3.1":"78.0.3904.130","7.3.2":"78.0.3904.130","7.3.3":"78.0.3904.130","8.0.0-beta.1":"79.0.3931.0","8.0.0-beta.2":"79.0.3931.0","8.0.0-beta.3":"80.0.3955.0","8.0.0-beta.4":"80.0.3955.0","8.0.0-beta.5":"80.0.3987.14","8.0.0-beta.6":"80.0.3987.51","8.0.0-beta.7":"80.0.3987.59","8.0.0-beta.8":"80.0.3987.75","8.0.0-beta.9":"80.0.3987.75","8.0.0-nightly.20190801":"78.0.3866.0","8.0.0-nightly.20190802":"78.0.3866.0","8.0.0-nightly.20190803":"78.0.3871.0","8.0.0-nightly.20190806":"78.0.3871.0","8.0.0-nightly.20190807":"78.0.3871.0","8.0.0-nightly.20190808":"78.0.3871.0","8.0.0-nightly.20190809":"78.0.3871.0","8.0.0-nightly.20190810":"78.0.3871.0","8.0.0-nightly.20190811":"78.0.3871.0","8.0.0-nightly.20190812":"78.0.3871.0","8.0.0-nightly.20190813":"78.0.3871.0","8.0.0-nightly.20190814":"78.0.3871.0","8.0.0-nightly.20190815":"78.0.3871.0","8.0.0-nightly.20190816":"78.0.3881.0","8.0.0-nightly.20190817":"78.0.3881.0","8.0.0-nightly.20190818":"78.0.3881.0","8.0.0-nightly.20190819":"78.0.3881.0","8.0.0-nightly.20190820":"78.0.3881.0","8.0.0-nightly.20190824":"78.0.3892.0","8.0.0-nightly.20190825":"78.0.3892.0","8.0.0-nightly.20190827":"78.0.3892.0","8.0.0-nightly.20190828":"78.0.3892.0","8.0.0-nightly.20190830":"78.0.3892.0","8.0.0-nightly.20190901":"78.0.3892.0","8.0.0-nightly.20190902":"78.0.3892.0","8.0.0-nightly.20190907":"78.0.3892.0","8.0.0-nightly.20190909":"78.0.3892.0","8.0.0-nightly.20190910":"78.0.3892.0","8.0.0-nightly.20190911":"78.0.3892.0","8.0.0-nightly.20190913":"78.0.3892.0","8.0.0-nightly.20190914":"78.0.3892.0","8.0.0-nightly.20190915":"78.0.3892.0","8.0.0-nightly.20190917":"78.0.3892.0","8.0.0-nightly.20190919":"79.0.3915.0","8.0.0-nightly.20190920":"79.0.3915.0","8.0.0-nightly.20190923":"79.0.3919.0","8.0.0-nightly.20190924":"79.0.3919.0","8.0.0-nightly.20190926":"79.0.3919.0","8.0.0-nightly.20190929":"79.0.3919.0","8.0.0-nightly.20190930":"79.0.3919.0","8.0.0-nightly.20191001":"79.0.3919.0","8.0.0-nightly.20191004":"79.0.3919.0","8.0.0-nightly.20191005":"79.0.3919.0","8.0.0-nightly.20191006":"79.0.3919.0","8.0.0-nightly.20191009":"79.0.3919.0","8.0.0-nightly.20191011":"79.0.3919.0","8.0.0-nightly.20191012":"79.0.3919.0","8.0.0-nightly.20191017":"79.0.3919.0","8.0.0-nightly.20191019":"79.0.3931.0","8.0.0-nightly.20191020":"79.0.3931.0","8.0.0-nightly.20191021":"79.0.3931.0","8.0.0-nightly.20191023":"79.0.3931.0","8.0.0-nightly.20191101":"80.0.3952.0","8.0.0-nightly.20191105":"80.0.3952.0","8.0.0":"80.0.3987.86","8.0.1":"80.0.3987.86","8.0.2":"80.0.3987.86","8.0.3":"80.0.3987.134","8.1.0":"80.0.3987.137","8.1.1":"80.0.3987.141","8.2.0":"80.0.3987.158","8.2.1":"80.0.3987.163","8.2.2":"80.0.3987.163","8.2.3":"80.0.3987.163","8.2.4":"80.0.3987.165","8.2.5":"80.0.3987.165","8.3.0":"80.0.3987.165","8.3.1":"80.0.3987.165","8.3.2":"80.0.3987.165","8.3.3":"80.0.3987.165","8.3.4":"80.0.3987.165","8.4.0":"80.0.3987.165","8.4.1":"80.0.3987.165","8.5.0":"80.0.3987.165","8.5.1":"80.0.3987.165","8.5.2":"80.0.3987.165","8.5.3":"80.0.3987.163","8.5.4":"80.0.3987.163","8.5.5":"80.0.3987.163","9.0.0-beta.1":"82.0.4048.0","9.0.0-beta.2":"82.0.4048.0","9.0.0-beta.3":"82.0.4048.0","9.0.0-beta.4":"82.0.4048.0","9.0.0-beta.5":"82.0.4048.0","9.0.0-beta.6":"82.0.4058.2","9.0.0-beta.7":"82.0.4058.2","9.0.0-beta.9":"82.0.4058.2","9.0.0-beta.10":"82.0.4085.10","9.0.0-beta.12":"82.0.4085.14","9.0.0-beta.13":"82.0.4085.14","9.0.0-beta.14":"82.0.4085.27","9.0.0-beta.15":"83.0.4102.3","9.0.0-beta.16":"83.0.4102.3","9.0.0-beta.17":"83.0.4103.14","9.0.0-beta.18":"83.0.4103.16","9.0.0-beta.19":"83.0.4103.24","9.0.0-beta.20":"83.0.4103.26","9.0.0-beta.21":"83.0.4103.26","9.0.0-beta.22":"83.0.4103.34","9.0.0-beta.23":"83.0.4103.44","9.0.0-beta.24":"83.0.4103.45","9.0.0-nightly.20191121":"80.0.3954.0","9.0.0-nightly.20191122":"80.0.3954.0","9.0.0-nightly.20191123":"80.0.3954.0","9.0.0-nightly.20191124":"80.0.3954.0","9.0.0-nightly.20191129":"80.0.3954.0","9.0.0-nightly.20191130":"80.0.3954.0","9.0.0-nightly.20191201":"80.0.3954.0","9.0.0-nightly.20191202":"80.0.3954.0","9.0.0-nightly.20191203":"80.0.3954.0","9.0.0-nightly.20191204":"80.0.3954.0","9.0.0-nightly.20191210":"80.0.3954.0","9.0.0-nightly.20191220":"81.0.3994.0","9.0.0-nightly.20191221":"81.0.3994.0","9.0.0-nightly.20191222":"81.0.3994.0","9.0.0-nightly.20191223":"81.0.3994.0","9.0.0-nightly.20191224":"81.0.3994.0","9.0.0-nightly.20191225":"81.0.3994.0","9.0.0-nightly.20191226":"81.0.3994.0","9.0.0-nightly.20191228":"81.0.3994.0","9.0.0-nightly.20191229":"81.0.3994.0","9.0.0-nightly.20191230":"81.0.3994.0","9.0.0-nightly.20191231":"81.0.3994.0","9.0.0-nightly.20200101":"81.0.3994.0","9.0.0-nightly.20200103":"81.0.3994.0","9.0.0-nightly.20200104":"81.0.3994.0","9.0.0-nightly.20200105":"81.0.3994.0","9.0.0-nightly.20200106":"81.0.3994.0","9.0.0-nightly.20200108":"81.0.3994.0","9.0.0-nightly.20200109":"81.0.3994.0","9.0.0-nightly.20200110":"81.0.3994.0","9.0.0-nightly.20200111":"81.0.3994.0","9.0.0-nightly.20200113":"81.0.3994.0","9.0.0-nightly.20200115":"81.0.3994.0","9.0.0-nightly.20200116":"81.0.3994.0","9.0.0-nightly.20200117":"81.0.3994.0","9.0.0-nightly.20200119":"81.0.4030.0","9.0.0-nightly.20200121":"81.0.4030.0","9.0.0":"83.0.4103.64","9.0.1":"83.0.4103.94","9.0.2":"83.0.4103.94","9.0.3":"83.0.4103.100","9.0.4":"83.0.4103.104","9.0.5":"83.0.4103.119","9.1.0":"83.0.4103.122","9.1.1":"83.0.4103.122","9.1.2":"83.0.4103.122","9.2.0":"83.0.4103.122","9.2.1":"83.0.4103.122","9.3.0":"83.0.4103.122","9.3.1":"83.0.4103.122","9.3.2":"83.0.4103.122","9.3.3":"83.0.4103.122","9.3.4":"83.0.4103.122","9.3.5":"83.0.4103.122","9.4.0":"83.0.4103.122","9.4.1":"83.0.4103.122","9.4.2":"83.0.4103.122","9.4.3":"83.0.4103.122","9.4.4":"83.0.4103.122","10.0.0-beta.1":"84.0.4129.0","10.0.0-beta.2":"84.0.4129.0","10.0.0-beta.3":"85.0.4161.2","10.0.0-beta.4":"85.0.4161.2","10.0.0-beta.8":"85.0.4181.1","10.0.0-beta.9":"85.0.4181.1","10.0.0-beta.10":"85.0.4183.19","10.0.0-beta.11":"85.0.4183.20","10.0.0-beta.12":"85.0.4183.26","10.0.0-beta.13":"85.0.4183.39","10.0.0-beta.14":"85.0.4183.39","10.0.0-beta.15":"85.0.4183.39","10.0.0-beta.17":"85.0.4183.39","10.0.0-beta.19":"85.0.4183.39","10.0.0-beta.20":"85.0.4183.39","10.0.0-beta.21":"85.0.4183.39","10.0.0-beta.23":"85.0.4183.70","10.0.0-beta.24":"85.0.4183.78","10.0.0-beta.25":"85.0.4183.80","10.0.0-nightly.20200209":"82.0.4050.0","10.0.0-nightly.20200210":"82.0.4050.0","10.0.0-nightly.20200211":"82.0.4050.0","10.0.0-nightly.20200216":"82.0.4050.0","10.0.0-nightly.20200217":"82.0.4050.0","10.0.0-nightly.20200218":"82.0.4050.0","10.0.0-nightly.20200221":"82.0.4050.0","10.0.0-nightly.20200222":"82.0.4050.0","10.0.0-nightly.20200223":"82.0.4050.0","10.0.0-nightly.20200226":"82.0.4050.0","10.0.0-nightly.20200303":"82.0.4050.0","10.0.0-nightly.20200304":"82.0.4076.0","10.0.0-nightly.20200305":"82.0.4076.0","10.0.0-nightly.20200306":"82.0.4076.0","10.0.0-nightly.20200309":"82.0.4076.0","10.0.0-nightly.20200310":"82.0.4076.0","10.0.0-nightly.20200311":"82.0.4083.0","10.0.0-nightly.20200316":"83.0.4086.0","10.0.0-nightly.20200317":"83.0.4087.0","10.0.0-nightly.20200318":"83.0.4087.0","10.0.0-nightly.20200320":"83.0.4087.0","10.0.0-nightly.20200323":"83.0.4087.0","10.0.0-nightly.20200324":"83.0.4087.0","10.0.0-nightly.20200325":"83.0.4087.0","10.0.0-nightly.20200326":"83.0.4087.0","10.0.0-nightly.20200327":"83.0.4087.0","10.0.0-nightly.20200330":"83.0.4087.0","10.0.0-nightly.20200331":"83.0.4087.0","10.0.0-nightly.20200401":"83.0.4087.0","10.0.0-nightly.20200402":"83.0.4087.0","10.0.0-nightly.20200403":"83.0.4087.0","10.0.0-nightly.20200406":"83.0.4087.0","10.0.0-nightly.20200408":"83.0.4095.0","10.0.0-nightly.20200410":"83.0.4095.0","10.0.0-nightly.20200413":"83.0.4095.0","10.0.0-nightly.20200414":"84.0.4114.0","10.0.0-nightly.20200415":"84.0.4115.0","10.0.0-nightly.20200416":"84.0.4115.0","10.0.0-nightly.20200417":"84.0.4115.0","10.0.0-nightly.20200422":"84.0.4121.0","10.0.0-nightly.20200423":"84.0.4121.0","10.0.0-nightly.20200427":"84.0.4125.0","10.0.0-nightly.20200428":"84.0.4125.0","10.0.0-nightly.20200429":"84.0.4125.0","10.0.0-nightly.20200430":"84.0.4125.0","10.0.0-nightly.20200501":"84.0.4129.0","10.0.0-nightly.20200504":"84.0.4129.0","10.0.0-nightly.20200505":"84.0.4129.0","10.0.0-nightly.20200506":"84.0.4129.0","10.0.0-nightly.20200507":"84.0.4129.0","10.0.0-nightly.20200508":"84.0.4129.0","10.0.0-nightly.20200511":"84.0.4129.0","10.0.0-nightly.20200512":"84.0.4129.0","10.0.0-nightly.20200513":"84.0.4129.0","10.0.0-nightly.20200514":"84.0.4129.0","10.0.0-nightly.20200515":"84.0.4129.0","10.0.0-nightly.20200518":"84.0.4129.0","10.0.0-nightly.20200519":"84.0.4129.0","10.0.0-nightly.20200520":"84.0.4129.0","10.0.0-nightly.20200521":"84.0.4129.0","10.0.0":"85.0.4183.84","10.0.1":"85.0.4183.86","10.1.0":"85.0.4183.87","10.1.1":"85.0.4183.93","10.1.2":"85.0.4183.98","10.1.3":"85.0.4183.121","10.1.4":"85.0.4183.121","10.1.5":"85.0.4183.121","10.1.6":"85.0.4183.121","10.1.7":"85.0.4183.121","10.2.0":"85.0.4183.121","10.3.0":"85.0.4183.121","10.3.1":"85.0.4183.121","10.3.2":"85.0.4183.121","10.4.0":"85.0.4183.121","10.4.1":"85.0.4183.121","10.4.2":"85.0.4183.121","10.4.3":"85.0.4183.121","10.4.4":"85.0.4183.121","10.4.5":"85.0.4183.121","10.4.6":"85.0.4183.121","10.4.7":"85.0.4183.121","11.0.0-beta.1":"86.0.4234.0","11.0.0-beta.3":"86.0.4234.0","11.0.0-beta.4":"86.0.4234.0","11.0.0-beta.5":"86.0.4234.0","11.0.0-beta.6":"86.0.4234.0","11.0.0-beta.7":"86.0.4234.0","11.0.0-beta.8":"87.0.4251.1","11.0.0-beta.9":"87.0.4251.1","11.0.0-beta.11":"87.0.4251.1","11.0.0-beta.12":"87.0.4280.11","11.0.0-beta.13":"87.0.4280.11","11.0.0-beta.16":"87.0.4280.27","11.0.0-beta.17":"87.0.4280.27","11.0.0-beta.18":"87.0.4280.27","11.0.0-beta.19":"87.0.4280.27","11.0.0-beta.20":"87.0.4280.40","11.0.0-beta.22":"87.0.4280.47","11.0.0-beta.23":"87.0.4280.47","11.0.0-nightly.20200525":"84.0.4129.0","11.0.0-nightly.20200526":"84.0.4129.0","11.0.0-nightly.20200529":"85.0.4156.0","11.0.0-nightly.20200602":"85.0.4162.0","11.0.0-nightly.20200603":"85.0.4162.0","11.0.0-nightly.20200604":"85.0.4162.0","11.0.0-nightly.20200609":"85.0.4162.0","11.0.0-nightly.20200610":"85.0.4162.0","11.0.0-nightly.20200611":"85.0.4162.0","11.0.0-nightly.20200615":"85.0.4162.0","11.0.0-nightly.20200616":"85.0.4162.0","11.0.0-nightly.20200617":"85.0.4162.0","11.0.0-nightly.20200618":"85.0.4162.0","11.0.0-nightly.20200619":"85.0.4162.0","11.0.0-nightly.20200701":"85.0.4179.0","11.0.0-nightly.20200702":"85.0.4179.0","11.0.0-nightly.20200703":"85.0.4179.0","11.0.0-nightly.20200706":"85.0.4179.0","11.0.0-nightly.20200707":"85.0.4179.0","11.0.0-nightly.20200708":"85.0.4179.0","11.0.0-nightly.20200709":"85.0.4179.0","11.0.0-nightly.20200716":"86.0.4203.0","11.0.0-nightly.20200717":"86.0.4203.0","11.0.0-nightly.20200720":"86.0.4203.0","11.0.0-nightly.20200721":"86.0.4203.0","11.0.0-nightly.20200723":"86.0.4209.0","11.0.0-nightly.20200724":"86.0.4209.0","11.0.0-nightly.20200729":"86.0.4209.0","11.0.0-nightly.20200730":"86.0.4209.0","11.0.0-nightly.20200731":"86.0.4209.0","11.0.0-nightly.20200803":"86.0.4209.0","11.0.0-nightly.20200804":"86.0.4209.0","11.0.0-nightly.20200805":"86.0.4209.0","11.0.0-nightly.20200811":"86.0.4209.0","11.0.0-nightly.20200812":"86.0.4209.0","11.0.0-nightly.20200822":"86.0.4234.0","11.0.0-nightly.20200824":"86.0.4234.0","11.0.0-nightly.20200825":"86.0.4234.0","11.0.0-nightly.20200826":"86.0.4234.0","11.0.0":"87.0.4280.60","11.0.1":"87.0.4280.60","11.0.2":"87.0.4280.67","11.0.3":"87.0.4280.67","11.0.4":"87.0.4280.67","11.0.5":"87.0.4280.88","11.1.0":"87.0.4280.88","11.1.1":"87.0.4280.88","11.2.0":"87.0.4280.141","11.2.1":"87.0.4280.141","11.2.2":"87.0.4280.141","11.2.3":"87.0.4280.141","11.3.0":"87.0.4280.141","11.4.0":"87.0.4280.141","11.4.1":"87.0.4280.141","11.4.2":"87.0.4280.141","11.4.3":"87.0.4280.141","11.4.4":"87.0.4280.141","11.4.5":"87.0.4280.141","11.4.6":"87.0.4280.141","11.4.7":"87.0.4280.141","11.4.8":"87.0.4280.141","11.4.9":"87.0.4280.141","11.4.10":"87.0.4280.141","11.4.11":"87.0.4280.141","11.4.12":"87.0.4280.141","11.5.0":"87.0.4280.141","12.0.0-beta.1":"89.0.4328.0","12.0.0-beta.3":"89.0.4328.0","12.0.0-beta.4":"89.0.4328.0","12.0.0-beta.5":"89.0.4328.0","12.0.0-beta.6":"89.0.4328.0","12.0.0-beta.7":"89.0.4328.0","12.0.0-beta.8":"89.0.4328.0","12.0.0-beta.9":"89.0.4328.0","12.0.0-beta.10":"89.0.4328.0","12.0.0-beta.11":"89.0.4328.0","12.0.0-beta.12":"89.0.4328.0","12.0.0-beta.14":"89.0.4328.0","12.0.0-beta.16":"89.0.4348.1","12.0.0-beta.18":"89.0.4348.1","12.0.0-beta.19":"89.0.4348.1","12.0.0-beta.20":"89.0.4348.1","12.0.0-beta.21":"89.0.4388.2","12.0.0-beta.22":"89.0.4388.2","12.0.0-beta.23":"89.0.4388.2","12.0.0-beta.24":"89.0.4388.2","12.0.0-beta.25":"89.0.4388.2","12.0.0-beta.26":"89.0.4388.2","12.0.0-beta.27":"89.0.4389.23","12.0.0-beta.28":"89.0.4389.23","12.0.0-beta.29":"89.0.4389.23","12.0.0-beta.30":"89.0.4389.58","12.0.0-beta.31":"89.0.4389.58","12.0.0-nightly.20200827":"86.0.4234.0","12.0.0-nightly.20200831":"86.0.4234.0","12.0.0-nightly.20200902":"86.0.4234.0","12.0.0-nightly.20200903":"86.0.4234.0","12.0.0-nightly.20200907":"86.0.4234.0","12.0.0-nightly.20200910":"86.0.4234.0","12.0.0-nightly.20200911":"86.0.4234.0","12.0.0-nightly.20200914":"86.0.4234.0","12.0.0-nightly.20201013":"87.0.4268.0","12.0.0-nightly.20201014":"87.0.4268.0","12.0.0-nightly.20201015":"87.0.4268.0","12.0.0-nightly.20201023":"88.0.4292.0","12.0.0-nightly.20201026":"88.0.4292.0","12.0.0-nightly.20201030":"88.0.4306.0","12.0.0-nightly.20201102":"88.0.4306.0","12.0.0-nightly.20201103":"88.0.4306.0","12.0.0-nightly.20201104":"88.0.4306.0","12.0.0-nightly.20201105":"88.0.4306.0","12.0.0-nightly.20201106":"88.0.4306.0","12.0.0-nightly.20201111":"88.0.4306.0","12.0.0-nightly.20201112":"88.0.4306.0","12.0.0-nightly.20201116":"88.0.4324.0","12.0.0":"89.0.4389.69","12.0.1":"89.0.4389.82","12.0.2":"89.0.4389.90","12.0.3":"89.0.4389.114","12.0.4":"89.0.4389.114","12.0.5":"89.0.4389.128","12.0.6":"89.0.4389.128","12.0.7":"89.0.4389.128","12.0.8":"89.0.4389.128","12.0.9":"89.0.4389.128","12.0.10":"89.0.4389.128","12.0.11":"89.0.4389.128","12.0.12":"89.0.4389.128","12.0.13":"89.0.4389.128","12.0.14":"89.0.4389.128","12.0.15":"89.0.4389.128","12.0.16":"89.0.4389.128","12.0.17":"89.0.4389.128","12.0.18":"89.0.4389.128","12.1.0":"89.0.4389.128","12.1.1":"89.0.4389.128","12.1.2":"89.0.4389.128","12.2.0":"89.0.4389.128","12.2.1":"89.0.4389.128","12.2.2":"89.0.4389.128","12.2.3":"89.0.4389.128","13.0.0-beta.2":"90.0.4402.0","13.0.0-beta.3":"90.0.4402.0","13.0.0-beta.4":"90.0.4415.0","13.0.0-beta.5":"90.0.4415.0","13.0.0-beta.6":"90.0.4415.0","13.0.0-beta.7":"90.0.4415.0","13.0.0-beta.8":"90.0.4415.0","13.0.0-beta.9":"90.0.4415.0","13.0.0-beta.11":"90.0.4415.0","13.0.0-beta.12":"90.0.4415.0","13.0.0-beta.13":"90.0.4415.0","13.0.0-beta.14":"91.0.4448.0","13.0.0-beta.16":"91.0.4448.0","13.0.0-beta.17":"91.0.4448.0","13.0.0-beta.18":"91.0.4448.0","13.0.0-beta.20":"91.0.4448.0","13.0.0-beta.21":"91.0.4472.33","13.0.0-beta.22":"91.0.4472.33","13.0.0-beta.23":"91.0.4472.33","13.0.0-beta.24":"91.0.4472.38","13.0.0-beta.26":"91.0.4472.38","13.0.0-beta.27":"91.0.4472.38","13.0.0-beta.28":"91.0.4472.38","13.0.0-nightly.20201119":"89.0.4328.0","13.0.0-nightly.20201123":"89.0.4328.0","13.0.0-nightly.20201124":"89.0.4328.0","13.0.0-nightly.20201126":"89.0.4328.0","13.0.0-nightly.20201127":"89.0.4328.0","13.0.0-nightly.20201130":"89.0.4328.0","13.0.0-nightly.20201201":"89.0.4328.0","13.0.0-nightly.20201202":"89.0.4328.0","13.0.0-nightly.20201203":"89.0.4328.0","13.0.0-nightly.20201204":"89.0.4328.0","13.0.0-nightly.20201207":"89.0.4328.0","13.0.0-nightly.20201208":"89.0.4328.0","13.0.0-nightly.20201209":"89.0.4328.0","13.0.0-nightly.20201210":"89.0.4328.0","13.0.0-nightly.20201211":"89.0.4328.0","13.0.0-nightly.20201214":"89.0.4328.0","13.0.0-nightly.20201215":"89.0.4349.0","13.0.0-nightly.20201216":"89.0.4349.0","13.0.0-nightly.20201221":"89.0.4349.0","13.0.0-nightly.20201222":"89.0.4349.0","13.0.0-nightly.20201223":"89.0.4359.0","13.0.0-nightly.20210104":"89.0.4359.0","13.0.0-nightly.20210108":"89.0.4359.0","13.0.0-nightly.20210111":"89.0.4359.0","13.0.0-nightly.20210113":"89.0.4386.0","13.0.0-nightly.20210114":"89.0.4386.0","13.0.0-nightly.20210118":"89.0.4386.0","13.0.0-nightly.20210122":"89.0.4386.0","13.0.0-nightly.20210125":"89.0.4386.0","13.0.0-nightly.20210127":"89.0.4389.0","13.0.0-nightly.20210128":"89.0.4389.0","13.0.0-nightly.20210129":"89.0.4389.0","13.0.0-nightly.20210201":"89.0.4389.0","13.0.0-nightly.20210202":"89.0.4389.0","13.0.0-nightly.20210203":"89.0.4389.0","13.0.0-nightly.20210205":"89.0.4389.0","13.0.0-nightly.20210208":"89.0.4389.0","13.0.0-nightly.20210209":"89.0.4389.0","13.0.0-nightly.20210210":"90.0.4402.0","13.0.0-nightly.20210211":"90.0.4402.0","13.0.0-nightly.20210212":"90.0.4402.0","13.0.0-nightly.20210216":"90.0.4402.0","13.0.0-nightly.20210217":"90.0.4402.0","13.0.0-nightly.20210218":"90.0.4402.0","13.0.0-nightly.20210219":"90.0.4402.0","13.0.0-nightly.20210222":"90.0.4402.0","13.0.0-nightly.20210225":"90.0.4402.0","13.0.0-nightly.20210226":"90.0.4402.0","13.0.0-nightly.20210301":"90.0.4402.0","13.0.0-nightly.20210302":"90.0.4402.0","13.0.0-nightly.20210303":"90.0.4402.0","13.0.0":"91.0.4472.69","13.0.1":"91.0.4472.69","13.1.0":"91.0.4472.77","13.1.1":"91.0.4472.77","13.1.2":"91.0.4472.77","13.1.3":"91.0.4472.106","13.1.4":"91.0.4472.106","13.1.5":"91.0.4472.124","13.1.6":"91.0.4472.124","13.1.7":"91.0.4472.124","13.1.8":"91.0.4472.164","13.1.9":"91.0.4472.164","13.2.0":"91.0.4472.164","13.2.1":"91.0.4472.164","13.2.2":"91.0.4472.164","13.2.3":"91.0.4472.164","13.3.0":"91.0.4472.164","13.4.0":"91.0.4472.164","13.5.0":"91.0.4472.164","13.5.1":"91.0.4472.164","13.5.2":"91.0.4472.164","13.6.0":"91.0.4472.164","13.6.1":"91.0.4472.164","13.6.2":"91.0.4472.164","13.6.3":"91.0.4472.164","14.0.0-beta.1":"92.0.4511.0","14.0.0-beta.2":"92.0.4511.0","14.0.0-beta.3":"92.0.4511.0","14.0.0-beta.5":"93.0.4536.0","14.0.0-beta.6":"93.0.4536.0","14.0.0-beta.7":"93.0.4536.0","14.0.0-beta.8":"93.0.4536.0","14.0.0-beta.9":"93.0.4539.0","14.0.0-beta.10":"93.0.4539.0","14.0.0-beta.11":"93.0.4557.4","14.0.0-beta.12":"93.0.4557.4","14.0.0-beta.13":"93.0.4566.0","14.0.0-beta.14":"93.0.4566.0","14.0.0-beta.15":"93.0.4566.0","14.0.0-beta.16":"93.0.4566.0","14.0.0-beta.17":"93.0.4566.0","14.0.0-beta.18":"93.0.4577.15","14.0.0-beta.19":"93.0.4577.15","14.0.0-beta.20":"93.0.4577.15","14.0.0-beta.21":"93.0.4577.15","14.0.0-beta.22":"93.0.4577.25","14.0.0-beta.23":"93.0.4577.25","14.0.0-beta.24":"93.0.4577.51","14.0.0-beta.25":"93.0.4577.51","14.0.0-nightly.20210304":"90.0.4402.0","14.0.0-nightly.20210305":"90.0.4415.0","14.0.0-nightly.20210308":"90.0.4415.0","14.0.0-nightly.20210309":"90.0.4415.0","14.0.0-nightly.20210311":"90.0.4415.0","14.0.0-nightly.20210315":"90.0.4415.0","14.0.0-nightly.20210316":"90.0.4415.0","14.0.0-nightly.20210317":"90.0.4415.0","14.0.0-nightly.20210318":"90.0.4415.0","14.0.0-nightly.20210319":"90.0.4415.0","14.0.0-nightly.20210323":"90.0.4415.0","14.0.0-nightly.20210324":"90.0.4415.0","14.0.0-nightly.20210325":"90.0.4415.0","14.0.0-nightly.20210326":"90.0.4415.0","14.0.0-nightly.20210329":"90.0.4415.0","14.0.0-nightly.20210330":"90.0.4415.0","14.0.0-nightly.20210331":"91.0.4448.0","14.0.0-nightly.20210401":"91.0.4448.0","14.0.0-nightly.20210402":"91.0.4448.0","14.0.0-nightly.20210406":"91.0.4448.0","14.0.0-nightly.20210407":"91.0.4448.0","14.0.0-nightly.20210408":"91.0.4448.0","14.0.0-nightly.20210409":"91.0.4448.0","14.0.0-nightly.20210413":"91.0.4448.0","14.0.0-nightly.20210426":"92.0.4475.0","14.0.0-nightly.20210427":"92.0.4475.0","14.0.0-nightly.20210430":"92.0.4488.0","14.0.0-nightly.20210503":"92.0.4488.0","14.0.0-nightly.20210505":"92.0.4496.0","14.0.0-nightly.20210506":"92.0.4498.0","14.0.0-nightly.20210507":"92.0.4499.0","14.0.0-nightly.20210510":"92.0.4499.0","14.0.0-nightly.20210511":"92.0.4499.0","14.0.0-nightly.20210512":"92.0.4499.0","14.0.0-nightly.20210513":"92.0.4499.0","14.0.0-nightly.20210514":"92.0.4505.0","14.0.0-nightly.20210517":"92.0.4505.0","14.0.0-nightly.20210518":"92.0.4505.0","14.0.0-nightly.20210519":"92.0.4505.0","14.0.0-nightly.20210520":"92.0.4511.0","14.0.0-nightly.20210523":"92.0.4511.0","14.0.0-nightly.20210524":"92.0.4511.0","14.0.0":"93.0.4577.58","14.0.1":"93.0.4577.63","14.0.2":"93.0.4577.82","14.1.0":"93.0.4577.82","14.1.1":"93.0.4577.82","14.2.0":"93.0.4577.82","14.2.1":"93.0.4577.82","14.2.2":"93.0.4577.82","15.0.0-alpha.1":"93.0.4566.0","15.0.0-alpha.2":"93.0.4566.0","15.0.0-alpha.3":"94.0.4584.0","15.0.0-alpha.4":"94.0.4584.0","15.0.0-alpha.5":"94.0.4584.0","15.0.0-alpha.6":"94.0.4584.0","15.0.0-alpha.7":"94.0.4590.2","15.0.0-alpha.8":"94.0.4590.2","15.0.0-alpha.9":"94.0.4590.2","15.0.0-alpha.10":"94.0.4606.12","15.0.0-beta.1":"94.0.4606.20","15.0.0-beta.2":"94.0.4606.20","15.0.0-beta.3":"94.0.4606.31","15.0.0-beta.4":"94.0.4606.31","15.0.0-beta.5":"94.0.4606.31","15.0.0-beta.6":"94.0.4606.31","15.0.0-beta.7":"94.0.4606.31","15.0.0-nightly.20210527":"92.0.4511.0","15.0.0-nightly.20210528":"92.0.4511.0","15.0.0-nightly.20210531":"92.0.4511.0","15.0.0-nightly.20210601":"92.0.4511.0","15.0.0-nightly.20210602":"92.0.4511.0","15.0.0-nightly.20210603":"93.0.4530.0","15.0.0-nightly.20210604":"93.0.4530.0","15.0.0-nightly.20210608":"93.0.4535.0","15.0.0-nightly.20210609":"93.0.4536.0","15.0.0-nightly.20210610":"93.0.4536.0","15.0.0-nightly.20210611":"93.0.4536.0","15.0.0-nightly.20210614":"93.0.4536.0","15.0.0-nightly.20210615":"93.0.4536.0","15.0.0-nightly.20210616":"93.0.4536.0","15.0.0-nightly.20210617":"93.0.4539.0","15.0.0-nightly.20210618":"93.0.4539.0","15.0.0-nightly.20210621":"93.0.4539.0","15.0.0-nightly.20210622":"93.0.4539.0","15.0.0-nightly.20210623":"93.0.4550.0","15.0.0-nightly.20210624":"93.0.4550.0","15.0.0-nightly.20210625":"93.0.4552.0","15.0.0-nightly.20210628":"93.0.4552.0","15.0.0-nightly.20210629":"93.0.4552.0","15.0.0-nightly.20210630":"93.0.4558.0","15.0.0-nightly.20210701":"93.0.4558.0","15.0.0-nightly.20210702":"93.0.4558.0","15.0.0-nightly.20210705":"93.0.4558.0","15.0.0-nightly.20210706":"93.0.4566.0","15.0.0-nightly.20210707":"93.0.4566.0","15.0.0-nightly.20210708":"93.0.4566.0","15.0.0-nightly.20210709":"93.0.4566.0","15.0.0-nightly.20210712":"93.0.4566.0","15.0.0-nightly.20210713":"93.0.4566.0","15.0.0-nightly.20210714":"93.0.4566.0","15.0.0-nightly.20210715":"93.0.4566.0","15.0.0-nightly.20210716":"93.0.4566.0","15.0.0-nightly.20210719":"93.0.4566.0","15.0.0-nightly.20210720":"93.0.4566.0","15.0.0-nightly.20210721":"93.0.4566.0","15.0.0":"94.0.4606.51","15.1.0":"94.0.4606.61","15.1.1":"94.0.4606.61","15.1.2":"94.0.4606.71","15.2.0":"94.0.4606.81","15.3.0":"94.0.4606.81","15.3.1":"94.0.4606.81","15.3.2":"94.0.4606.81","15.3.3":"94.0.4606.81","16.0.0-alpha.1":"95.0.4629.0","16.0.0-alpha.2":"95.0.4629.0","16.0.0-alpha.3":"95.0.4629.0","16.0.0-alpha.4":"95.0.4629.0","16.0.0-alpha.5":"95.0.4629.0","16.0.0-alpha.6":"95.0.4629.0","16.0.0-alpha.7":"95.0.4629.0","16.0.0-alpha.8":"96.0.4647.0","16.0.0-alpha.9":"96.0.4647.0","16.0.0-beta.1":"96.0.4647.0","16.0.0-beta.2":"96.0.4647.0","16.0.0-beta.3":"96.0.4647.0","16.0.0-beta.4":"96.0.4664.18","16.0.0-beta.5":"96.0.4664.18","16.0.0-beta.6":"96.0.4664.27","16.0.0-beta.7":"96.0.4664.27","16.0.0-beta.8":"96.0.4664.35","16.0.0-beta.9":"96.0.4664.35","16.0.0-nightly.20210722":"93.0.4566.0","16.0.0-nightly.20210723":"93.0.4566.0","16.0.0-nightly.20210726":"93.0.4566.0","16.0.0-nightly.20210727":"94.0.4584.0","16.0.0-nightly.20210728":"94.0.4584.0","16.0.0-nightly.20210729":"94.0.4584.0","16.0.0-nightly.20210730":"94.0.4584.0","16.0.0-nightly.20210802":"94.0.4584.0","16.0.0-nightly.20210803":"94.0.4584.0","16.0.0-nightly.20210804":"94.0.4584.0","16.0.0-nightly.20210805":"94.0.4584.0","16.0.0-nightly.20210806":"94.0.4584.0","16.0.0-nightly.20210809":"94.0.4584.0","16.0.0-nightly.20210810":"94.0.4584.0","16.0.0-nightly.20210811":"94.0.4584.0","16.0.0-nightly.20210812":"94.0.4590.2","16.0.0-nightly.20210813":"94.0.4590.2","16.0.0-nightly.20210816":"94.0.4590.2","16.0.0-nightly.20210817":"94.0.4590.2","16.0.0-nightly.20210818":"94.0.4590.2","16.0.0-nightly.20210819":"94.0.4590.2","16.0.0-nightly.20210820":"94.0.4590.2","16.0.0-nightly.20210823":"94.0.4590.2","16.0.0-nightly.20210824":"95.0.4612.5","16.0.0-nightly.20210825":"95.0.4612.5","16.0.0-nightly.20210826":"95.0.4612.5","16.0.0-nightly.20210827":"95.0.4612.5","16.0.0-nightly.20210830":"95.0.4612.5","16.0.0-nightly.20210831":"95.0.4612.5","16.0.0-nightly.20210901":"95.0.4612.5","16.0.0-nightly.20210902":"95.0.4629.0","16.0.0-nightly.20210903":"95.0.4629.0","16.0.0-nightly.20210906":"95.0.4629.0","16.0.0-nightly.20210907":"95.0.4629.0","16.0.0-nightly.20210908":"95.0.4629.0","16.0.0-nightly.20210909":"95.0.4629.0","16.0.0-nightly.20210910":"95.0.4629.0","16.0.0-nightly.20210913":"95.0.4629.0","16.0.0-nightly.20210914":"95.0.4629.0","16.0.0-nightly.20210915":"95.0.4629.0","16.0.0-nightly.20210916":"95.0.4629.0","16.0.0-nightly.20210917":"95.0.4629.0","16.0.0-nightly.20210920":"95.0.4629.0","16.0.0-nightly.20210921":"95.0.4629.0","16.0.0-nightly.20210922":"95.0.4629.0","16.0.0":"96.0.4664.45","16.0.1":"96.0.4664.45","16.0.2":"96.0.4664.55","16.0.3":"96.0.4664.55","17.0.0-alpha.1":"96.0.4664.4","17.0.0-alpha.2":"96.0.4664.4","17.0.0-alpha.3":"96.0.4664.4","17.0.0-alpha.4":"98.0.4706.0","17.0.0-nightly.20210923":"95.0.4629.0","17.0.0-nightly.20210924":"95.0.4629.0","17.0.0-nightly.20210927":"95.0.4629.0","17.0.0-nightly.20210928":"95.0.4629.0","17.0.0-nightly.20210929":"95.0.4629.0","17.0.0-nightly.20210930":"95.0.4629.0","17.0.0-nightly.20211001":"95.0.4629.0","17.0.0-nightly.20211004":"95.0.4629.0","17.0.0-nightly.20211005":"95.0.4629.0","17.0.0-nightly.20211006":"96.0.4647.0","17.0.0-nightly.20211007":"96.0.4647.0","17.0.0-nightly.20211008":"96.0.4647.0","17.0.0-nightly.20211011":"96.0.4647.0","17.0.0-nightly.20211012":"96.0.4647.0","17.0.0-nightly.20211013":"96.0.4647.0","17.0.0-nightly.20211014":"96.0.4647.0","17.0.0-nightly.20211015":"96.0.4647.0","17.0.0-nightly.20211018":"96.0.4647.0","17.0.0-nightly.20211019":"96.0.4647.0","17.0.0-nightly.20211020":"96.0.4647.0","17.0.0-nightly.20211021":"96.0.4647.0","17.0.0-nightly.20211022":"96.0.4664.4","17.0.0-nightly.20211025":"96.0.4664.4","17.0.0-nightly.20211026":"96.0.4664.4","17.0.0-nightly.20211027":"96.0.4664.4","17.0.0-nightly.20211028":"96.0.4664.4","17.0.0-nightly.20211029":"96.0.4664.4","17.0.0-nightly.20211101":"96.0.4664.4","17.0.0-nightly.20211102":"96.0.4664.4","17.0.0-nightly.20211103":"96.0.4664.4","17.0.0-nightly.20211104":"96.0.4664.4","17.0.0-nightly.20211105":"96.0.4664.4","17.0.0-nightly.20211108":"96.0.4664.4","17.0.0-nightly.20211109":"96.0.4664.4","17.0.0-nightly.20211110":"96.0.4664.4","17.0.0-nightly.20211111":"96.0.4664.4","17.0.0-nightly.20211112":"96.0.4664.4","17.0.0-nightly.20211115":"96.0.4664.4","17.0.0-nightly.20211116":"96.0.4664.4","17.0.0-nightly.20211117":"96.0.4664.4","18.0.0-nightly.20211118":"96.0.4664.4","18.0.0-nightly.20211119":"96.0.4664.4","18.0.0-nightly.20211122":"96.0.4664.4","18.0.0-nightly.20211123":"96.0.4664.4","18.0.0-nightly.20211124":"98.0.4706.0","18.0.0-nightly.20211125":"98.0.4706.0","18.0.0-nightly.20211126":"98.0.4706.0","18.0.0-nightly.20211129":"98.0.4706.0","18.0.0-nightly.20211130":"98.0.4706.0"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/electron-to-chromium/package.json b/tools/node_modules/eslint/node_modules/electron-to-chromium/package.json index e86a9438604be3..eecbd398a58363 100644 --- a/tools/node_modules/eslint/node_modules/electron-to-chromium/package.json +++ b/tools/node_modules/eslint/node_modules/electron-to-chromium/package.json @@ -1,6 +1,6 @@ { "name": "electron-to-chromium", - "version": "1.4.4", + "version": "1.4.7", "description": "Provides a list of electron-to-chromium version mappings", "main": "index.js", "files": [ diff --git a/tools/node_modules/eslint/node_modules/enquirer/README.md b/tools/node_modules/eslint/node_modules/enquirer/README.md deleted file mode 100644 index 1598742285b664..00000000000000 --- a/tools/node_modules/eslint/node_modules/enquirer/README.md +++ /dev/null @@ -1,1752 +0,0 @@ -

Enquirer

- -

- -version - - -travis - - -downloads - -

- -
-
- -

-Stylish CLI prompts that are user-friendly, intuitive and easy to create.
->_ Prompts should be more like conversations than inquisitions▌ -

- -
- -

-(Example shows Enquirer's Survey Prompt) -Enquirer Survey Prompt
-The terminal in all examples is Hyper, theme is hyper-monokai-extended.

-See more prompt examples -

- -
-
- -Created by [jonschlinkert](https://github.com/jonschlinkert) and [doowb](https://github.com/doowb), Enquirer is fast, easy to use, and lightweight enough for small projects, while also being powerful and customizable enough for the most advanced use cases. - -* **Fast** - [Loads in ~4ms](#-performance) (that's about _3-4 times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps_) -* **Lightweight** - Only one dependency, the excellent [ansi-colors](https://github.com/doowb/ansi-colors) by [Brian Woodward](https://github.com/doowb). -* **Easy to implement** - Uses promises and async/await and sensible defaults to make prompts easy to create and implement. -* **Easy to use** - Thrill your users with a better experience! Navigating around input and choices is a breeze. You can even create [quizzes](examples/fun/countdown.js), or [record](examples/fun/record.js) and [playback](examples/fun/play.js) key bindings to aid with tutorials and videos. -* **Intuitive** - Keypress combos are available to simplify usage. -* **Flexible** - All prompts can be used standalone or chained together. -* **Stylish** - Easily override semantic styles and symbols for any part of the prompt. -* **Extensible** - Easily create and use custom prompts by extending Enquirer's built-in [prompts](#-prompts). -* **Pluggable** - Add advanced features to Enquirer using plugins. -* **Validation** - Optionally validate user input with any prompt. -* **Well tested** - All prompts are well-tested, and tests are easy to create without having to use brittle, hacky solutions to spy on prompts or "inject" values. -* **Examples** - There are numerous [examples](examples) available to help you get started. - -If you like Enquirer, please consider starring or tweeting about this project to show your support. Thanks! - -
- -

->_ Ready to start making prompts your users will love? ▌
-Enquirer Select Prompt with heartbeat example -

- -
-
- -## ❯ Getting started - -Get started with Enquirer, the most powerful and easy-to-use Node.js library for creating interactive CLI prompts. - -* [Install](#-install) -* [Usage](#-usage) -* [Enquirer](#-enquirer) -* [Prompts](#-prompts) - - [Built-in Prompts](#-prompts) - - [Custom Prompts](#-custom-prompts) -* [Key Bindings](#-key-bindings) -* [Options](#-options) -* [Release History](#-release-history) -* [Performance](#-performance) -* [About](#-about) - -
- -## ❯ Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install enquirer --save -``` -Install with [yarn](https://yarnpkg.com/en/): - -```sh -$ yarn add enquirer -``` - -

-Install Enquirer with NPM -

- -_(Requires Node.js 8.6 or higher. Please let us know if you need support for an earlier version by creating an [issue](../../issues/new).)_ - -
- -## ❯ Usage - -### Single prompt - -The easiest way to get started with enquirer is to pass a [question object](#prompt-options) to the `prompt` method. - -```js -const { prompt } = require('enquirer'); - -const response = await prompt({ - type: 'input', - name: 'username', - message: 'What is your username?' -}); - -console.log(response); // { username: 'jonschlinkert' } -``` - -_(Examples with `await` need to be run inside an `async` function)_ - -### Multiple prompts - -Pass an array of ["question" objects](#prompt-options) to run a series of prompts. - -```js -const response = await prompt([ - { - type: 'input', - name: 'name', - message: 'What is your name?' - }, - { - type: 'input', - name: 'username', - message: 'What is your username?' - } -]); - -console.log(response); // { name: 'Edward Chan', username: 'edwardmchan' } -``` - -### Different ways to run enquirer - -#### 1. By importing the specific `built-in prompt` - -```js -const { Confirm } = require('enquirer'); - -const prompt = new Confirm({ - name: 'question', - message: 'Did you like enquirer?' -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)); -``` - -#### 2. By passing the options to `prompt` - -```js -const { prompt } = require('enquirer'); - -prompt({ - type: 'confirm', - name: 'question', - message: 'Did you like enquirer?' -}) - .then(answer => console.log('Answer:', answer)); -``` - -**Jump to**: [Getting Started](#-getting-started) · [Prompts](#-prompts) · [Options](#-options) · [Key Bindings](#-key-bindings) - -
- -## ❯ Enquirer - -**Enquirer is a prompt runner** - -Add Enquirer to your JavaScript project with following line of code. - -```js -const Enquirer = require('enquirer'); -``` - -The main export of this library is the `Enquirer` class, which has methods and features designed to simplify running prompts. - -```js -const { prompt } = require('enquirer'); -const question = [ - { - type: 'input', - name: 'username', - message: 'What is your username?' - }, - { - type: 'password', - name: 'password', - message: 'What is your password?' - } -]; - -let answers = await prompt(question); -console.log(answers); -``` - -**Prompts control how values are rendered and returned** - -Each individual prompt is a class with special features and functionality for rendering the types of values you want to show users in the terminal, and subsequently returning the types of values you need to use in your application. - -**How can I customize prompts?** - -Below in this guide you will find information about creating [custom prompts](#-custom-prompts). For now, we'll focus on how to customize an existing prompt. - -All of the individual [prompt classes](#built-in-prompts) in this library are exposed as static properties on Enquirer. This allows them to be used directly without using `enquirer.prompt()`. - -Use this approach if you need to modify a prompt instance, or listen for events on the prompt. - -**Example** - -```js -const { Input } = require('enquirer'); -const prompt = new Input({ - name: 'username', - message: 'What is your username?' -}); - -prompt.run() - .then(answer => console.log('Username:', answer)) - .catch(console.error); -``` - -### [Enquirer](index.js#L20) - -Create an instance of `Enquirer`. - -**Params** - -* `options` **{Object}**: (optional) Options to use with all prompts. -* `answers` **{Object}**: (optional) Answers object to initialize with. - -**Example** - -```js -const Enquirer = require('enquirer'); -const enquirer = new Enquirer(); -``` - -### [register()](index.js#L42) - -Register a custom prompt type. - -**Params** - -* `type` **{String}** -* `fn` **{Function|Prompt}**: `Prompt` class, or a function that returns a `Prompt` class. -* `returns` **{Object}**: Returns the Enquirer instance - -**Example** - -```js -const Enquirer = require('enquirer'); -const enquirer = new Enquirer(); -enquirer.register('customType', require('./custom-prompt')); -``` - -### [prompt()](index.js#L78) - -Prompt function that takes a "question" object or array of question objects, and returns an object with responses from the user. - -**Params** - -* `questions` **{Array|Object}**: Options objects for one or more prompts to run. -* `returns` **{Promise}**: Promise that returns an "answers" object with the user's responses. - -**Example** - -```js -const Enquirer = require('enquirer'); -const enquirer = new Enquirer(); - -const response = await enquirer.prompt({ - type: 'input', - name: 'username', - message: 'What is your username?' -}); -console.log(response); -``` - -### [use()](index.js#L160) - -Use an enquirer plugin. - -**Params** - -* `plugin` **{Function}**: Plugin function that takes an instance of Enquirer. -* `returns` **{Object}**: Returns the Enquirer instance. - -**Example** - -```js -const Enquirer = require('enquirer'); -const enquirer = new Enquirer(); -const plugin = enquirer => { - // do stuff to enquire instance -}; -enquirer.use(plugin); -``` - -### [Enquirer#prompt](index.js#L210) - -Prompt function that takes a "question" object or array of question objects, and returns an object with responses from the user. - -**Params** - -* `questions` **{Array|Object}**: Options objects for one or more prompts to run. -* `returns` **{Promise}**: Promise that returns an "answers" object with the user's responses. - -**Example** - -```js -const { prompt } = require('enquirer'); -const response = await prompt({ - type: 'input', - name: 'username', - message: 'What is your username?' -}); -console.log(response); -``` - -
- -## ❯ Prompts - -This section is about Enquirer's prompts: what they look like, how they work, how to run them, available options, and how to customize the prompts or create your own prompt concept. - -**Getting started with Enquirer's prompts** - -* [Prompt](#prompt) - The base `Prompt` class used by other prompts - - [Prompt Options](#prompt-options) -* [Built-in prompts](#built-in-prompts) -* [Prompt Types](#prompt-types) - The base `Prompt` class used by other prompts -* [Custom prompts](#%E2%9D%AF-custom-prompts) - Enquirer 2.0 introduced the concept of prompt "types", with the goal of making custom prompts easier than ever to create and use. - -### Prompt - -The base `Prompt` class is used to create all other prompts. - -```js -const { Prompt } = require('enquirer'); -class MyCustomPrompt extends Prompt {} -``` - -See the documentation for [creating custom prompts](#-custom-prompts) to learn more about how this works. - -#### Prompt Options - -Each prompt takes an options object (aka "question" object), that implements the following interface: - -```js -{ - // required - type: string | function, - name: string | function, - message: string | function | async function, - - // optional - skip: boolean | function | async function, - initial: string | function | async function, - format: function | async function, - result: function | async function, - validate: function | async function, -} -``` -Each property of the options object is described below: - -| **Property** | **Required?** | **Type** | **Description** | -| ------------ | ------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | yes | `string\|function` | Enquirer uses this value to determine the type of prompt to run, but it's optional when prompts are run directly. | -| `name` | yes | `string\|function` | Used as the key for the answer on the returned values (answers) object. | -| `message` | yes | `string\|function` | The message to display when the prompt is rendered in the terminal. | -| `skip` | no | `boolean\|function` | If `true` it will not ask that prompt. | -| `initial` | no | `string\|function` | The default value to return if the user does not supply a value. | -| `format` | no | `function` | Function to format user input in the terminal. | -| `result` | no | `function` | Function to format the final submitted value before it's returned. | -| `validate` | no | `function` | Function to validate the submitted value before it's returned. This function may return a boolean or a string. If a string is returned it will be used as the validation error message. | - -**Example usage** - -```js -const { prompt } = require('enquirer'); - -const question = { - type: 'input', - name: 'username', - message: 'What is your username?' -}; - -prompt(question) - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -
- -### Built-in prompts - -* [AutoComplete Prompt](#autocomplete-prompt) -* [BasicAuth Prompt](#basicauth-prompt) -* [Confirm Prompt](#confirm-prompt) -* [Form Prompt](#form-prompt) -* [Input Prompt](#input-prompt) -* [Invisible Prompt](#invisible-prompt) -* [List Prompt](#list-prompt) -* [MultiSelect Prompt](#multiselect-prompt) -* [Numeral Prompt](#numeral-prompt) -* [Password Prompt](#password-prompt) -* [Quiz Prompt](#quiz-prompt) -* [Survey Prompt](#survey-prompt) -* [Scale Prompt](#scale-prompt) -* [Select Prompt](#select-prompt) -* [Sort Prompt](#sort-prompt) -* [Snippet Prompt](#snippet-prompt) -* [Toggle Prompt](#toggle-prompt) - -### AutoComplete Prompt - -Prompt that auto-completes as the user types, and returns the selected value as a string. - -

-Enquirer AutoComplete Prompt -

- -**Example Usage** - -```js -const { AutoComplete } = require('enquirer'); - -const prompt = new AutoComplete({ - name: 'flavor', - message: 'Pick your favorite flavor', - limit: 10, - initial: 2, - choices: [ - 'Almond', - 'Apple', - 'Banana', - 'Blackberry', - 'Blueberry', - 'Cherry', - 'Chocolate', - 'Cinnamon', - 'Coconut', - 'Cranberry', - 'Grape', - 'Nougat', - 'Orange', - 'Pear', - 'Pineapple', - 'Raspberry', - 'Strawberry', - 'Vanilla', - 'Watermelon', - 'Wintergreen' - ] -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -**AutoComplete Options** - -| Option | Type | Default | Description | -| ----------- | ---------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -| `highlight` | `function` | `dim` version of primary style | The color to use when "highlighting" characters in the list that match user input. | -| `multiple` | `boolean` | `false` | Allow multiple choices to be selected. | -| `suggest` | `function` | Greedy match, returns true if choice message contains input string. | Function that filters choices. Takes user input and a choices array, and returns a list of matching choices. | -| `initial` | `number` | 0 | Preselected item in the list of choices. | -| `footer` | `function` | None | Function that displays [footer text](https://github.com/enquirer/enquirer/blob/6c2819518a1e2ed284242a99a685655fbaabfa28/examples/autocomplete/option-footer.js#L10) | - -**Related prompts** - -* [Select](#select-prompt) -* [MultiSelect](#multiselect-prompt) -* [Survey](#survey-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### BasicAuth Prompt - -Prompt that asks for username and password to authenticate the user. The default implementation of `authenticate` function in `BasicAuth` prompt is to compare the username and password with the values supplied while running the prompt. The implementer is expected to override the `authenticate` function with a custom logic such as making an API request to a server to authenticate the username and password entered and expect a token back. - -

-Enquirer BasicAuth Prompt -

- -**Example Usage** - -```js -const { BasicAuth } = require('enquirer'); - - const prompt = new BasicAuth({ - name: 'password', - message: 'Please enter your password', - username: 'rajat-sr', - password: '123', - showPassword: true -}); - - prompt - .run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Confirm Prompt - -Prompt that returns `true` or `false`. - -

-Enquirer Confirm Prompt -

- -**Example Usage** - -```js -const { Confirm } = require('enquirer'); - -const prompt = new Confirm({ - name: 'question', - message: 'Want to answer?' -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -**Related prompts** - -* [Input](#input-prompt) -* [Numeral](#numeral-prompt) -* [Password](#password-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Form Prompt - -Prompt that allows the user to enter and submit multiple values on a single terminal screen. - -

-Enquirer Form Prompt -

- -**Example Usage** - -```js -const { Form } = require('enquirer'); - -const prompt = new Form({ - name: 'user', - message: 'Please provide the following information:', - choices: [ - { name: 'firstname', message: 'First Name', initial: 'Jon' }, - { name: 'lastname', message: 'Last Name', initial: 'Schlinkert' }, - { name: 'username', message: 'GitHub username', initial: 'jonschlinkert' } - ] -}); - -prompt.run() - .then(value => console.log('Answer:', value)) - .catch(console.error); -``` - -**Related prompts** - -* [Input](#input-prompt) -* [Survey](#survey-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Input Prompt - -Prompt that takes user input and returns a string. - -

-Enquirer Input Prompt -

- -**Example Usage** - -```js -const { Input } = require('enquirer'); -const prompt = new Input({ - message: 'What is your username?', - initial: 'jonschlinkert' -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.log); -``` - -You can use [data-store](https://github.com/jonschlinkert/data-store) to store [input history](https://github.com/enquirer/enquirer/blob/master/examples/input/option-history.js) that the user can cycle through (see [source](https://github.com/enquirer/enquirer/blob/8407dc3579123df5e6e20215078e33bb605b0c37/lib/prompts/input.js)). - -**Related prompts** - -* [Confirm](#confirm-prompt) -* [Numeral](#numeral-prompt) -* [Password](#password-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Invisible Prompt - -Prompt that takes user input, hides it from the terminal, and returns a string. - -

-Enquirer Invisible Prompt -

- -**Example Usage** - -```js -const { Invisible } = require('enquirer'); -const prompt = new Invisible({ - name: 'secret', - message: 'What is your secret?' -}); - -prompt.run() - .then(answer => console.log('Answer:', { secret: answer })) - .catch(console.error); -``` - -**Related prompts** - -* [Password](#password-prompt) -* [Input](#input-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### List Prompt - -Prompt that returns a list of values, created by splitting the user input. The default split character is `,` with optional trailing whitespace. - -

-Enquirer List Prompt -

- -**Example Usage** - -```js -const { List } = require('enquirer'); -const prompt = new List({ - name: 'keywords', - message: 'Type comma-separated keywords' -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -**Related prompts** - -* [Sort](#sort-prompt) -* [Select](#select-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### MultiSelect Prompt - -Prompt that allows the user to select multiple items from a list of options. - -

-Enquirer MultiSelect Prompt -

- -**Example Usage** - -```js -const { MultiSelect } = require('enquirer'); - -const prompt = new MultiSelect({ - name: 'value', - message: 'Pick your favorite colors', - limit: 7, - choices: [ - { name: 'aqua', value: '#00ffff' }, - { name: 'black', value: '#000000' }, - { name: 'blue', value: '#0000ff' }, - { name: 'fuchsia', value: '#ff00ff' }, - { name: 'gray', value: '#808080' }, - { name: 'green', value: '#008000' }, - { name: 'lime', value: '#00ff00' }, - { name: 'maroon', value: '#800000' }, - { name: 'navy', value: '#000080' }, - { name: 'olive', value: '#808000' }, - { name: 'purple', value: '#800080' }, - { name: 'red', value: '#ff0000' }, - { name: 'silver', value: '#c0c0c0' }, - { name: 'teal', value: '#008080' }, - { name: 'white', value: '#ffffff' }, - { name: 'yellow', value: '#ffff00' } - ] -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); - -// Answer: ['aqua', 'blue', 'fuchsia'] -``` - -**Example key-value pairs** - -Optionally, pass a `result` function and use the `.map` method to return an object of key-value pairs of the selected names and values: [example](./examples/multiselect/option-result.js) - -```js -const { MultiSelect } = require('enquirer'); - -const prompt = new MultiSelect({ - name: 'value', - message: 'Pick your favorite colors', - limit: 7, - choices: [ - { name: 'aqua', value: '#00ffff' }, - { name: 'black', value: '#000000' }, - { name: 'blue', value: '#0000ff' }, - { name: 'fuchsia', value: '#ff00ff' }, - { name: 'gray', value: '#808080' }, - { name: 'green', value: '#008000' }, - { name: 'lime', value: '#00ff00' }, - { name: 'maroon', value: '#800000' }, - { name: 'navy', value: '#000080' }, - { name: 'olive', value: '#808000' }, - { name: 'purple', value: '#800080' }, - { name: 'red', value: '#ff0000' }, - { name: 'silver', value: '#c0c0c0' }, - { name: 'teal', value: '#008080' }, - { name: 'white', value: '#ffffff' }, - { name: 'yellow', value: '#ffff00' } - ], - result(names) { - return this.map(names); - } -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); - -// Answer: { aqua: '#00ffff', blue: '#0000ff', fuchsia: '#ff00ff' } -``` - -**Related prompts** - -* [AutoComplete](#autocomplete-prompt) -* [Select](#select-prompt) -* [Survey](#survey-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Numeral Prompt - -Prompt that takes a number as input. - -

-Enquirer Numeral Prompt -

- -**Example Usage** - -```js -const { NumberPrompt } = require('enquirer'); - -const prompt = new NumberPrompt({ - name: 'number', - message: 'Please enter a number' -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -**Related prompts** - -* [Input](#input-prompt) -* [Confirm](#confirm-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Password Prompt - -Prompt that takes user input and masks it in the terminal. Also see the [invisible prompt](#invisible-prompt) - -

-Enquirer Password Prompt -

- -**Example Usage** - -```js -const { Password } = require('enquirer'); - -const prompt = new Password({ - name: 'password', - message: 'What is your password?' -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -**Related prompts** - -* [Input](#input-prompt) -* [Invisible](#invisible-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Quiz Prompt - -Prompt that allows the user to play multiple-choice quiz questions. - -

-Enquirer Quiz Prompt -

- -**Example Usage** - -```js -const { Quiz } = require('enquirer'); - - const prompt = new Quiz({ - name: 'countries', - message: 'How many countries are there in the world?', - choices: ['165', '175', '185', '195', '205'], - correctChoice: 3 -}); - - prompt - .run() - .then(answer => { - if (answer.correct) { - console.log('Correct!'); - } else { - console.log(`Wrong! Correct answer is ${answer.correctAnswer}`); - } - }) - .catch(console.error); -``` - -**Quiz Options** - -| Option | Type | Required | Description | -| ----------- | ---------- | ---------- | ------------------------------------------------------------------------------------------------------------ | -| `choices` | `array` | Yes | The list of possible answers to the quiz question. | -| `correctChoice`| `number` | Yes | Index of the correct choice from the `choices` array. | - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Survey Prompt - -Prompt that allows the user to provide feedback for a list of questions. - -

-Enquirer Survey Prompt -

- -**Example Usage** - -```js -const { Survey } = require('enquirer'); - -const prompt = new Survey({ - name: 'experience', - message: 'Please rate your experience', - scale: [ - { name: '1', message: 'Strongly Disagree' }, - { name: '2', message: 'Disagree' }, - { name: '3', message: 'Neutral' }, - { name: '4', message: 'Agree' }, - { name: '5', message: 'Strongly Agree' } - ], - margin: [0, 0, 2, 1], - choices: [ - { - name: 'interface', - message: 'The website has a friendly interface.' - }, - { - name: 'navigation', - message: 'The website is easy to navigate.' - }, - { - name: 'images', - message: 'The website usually has good images.' - }, - { - name: 'upload', - message: 'The website makes it easy to upload images.' - }, - { - name: 'colors', - message: 'The website has a pleasing color palette.' - } - ] -}); - -prompt.run() - .then(value => console.log('ANSWERS:', value)) - .catch(console.error); -``` - -**Related prompts** - -* [Scale](#scale-prompt) -* [Snippet](#snippet-prompt) -* [Select](#select-prompt) - -*** - -### Scale Prompt - -A more compact version of the [Survey prompt](#survey-prompt), the Scale prompt allows the user to quickly provide feedback using a [Likert Scale](https://en.wikipedia.org/wiki/Likert_scale). - -

-Enquirer Scale Prompt -

- -**Example Usage** - -```js -const { Scale } = require('enquirer'); -const prompt = new Scale({ - name: 'experience', - message: 'Please rate your experience', - scale: [ - { name: '1', message: 'Strongly Disagree' }, - { name: '2', message: 'Disagree' }, - { name: '3', message: 'Neutral' }, - { name: '4', message: 'Agree' }, - { name: '5', message: 'Strongly Agree' } - ], - margin: [0, 0, 2, 1], - choices: [ - { - name: 'interface', - message: 'The website has a friendly interface.', - initial: 2 - }, - { - name: 'navigation', - message: 'The website is easy to navigate.', - initial: 2 - }, - { - name: 'images', - message: 'The website usually has good images.', - initial: 2 - }, - { - name: 'upload', - message: 'The website makes it easy to upload images.', - initial: 2 - }, - { - name: 'colors', - message: 'The website has a pleasing color palette.', - initial: 2 - } - ] -}); - -prompt.run() - .then(value => console.log('ANSWERS:', value)) - .catch(console.error); -``` - -**Related prompts** - -* [AutoComplete](#autocomplete-prompt) -* [Select](#select-prompt) -* [Survey](#survey-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Select Prompt - -Prompt that allows the user to select from a list of options. - -

-Enquirer Select Prompt -

- -**Example Usage** - -```js -const { Select } = require('enquirer'); - -const prompt = new Select({ - name: 'color', - message: 'Pick a flavor', - choices: ['apple', 'grape', 'watermelon', 'cherry', 'orange'] -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -**Related prompts** - -* [AutoComplete](#autocomplete-prompt) -* [MultiSelect](#multiselect-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Sort Prompt - -Prompt that allows the user to sort items in a list. - -**Example** - -In this [example](https://github.com/enquirer/enquirer/raw/master/examples/sort/prompt.js), custom styling is applied to the returned values to make it easier to see what's happening. - -

-Enquirer Sort Prompt -

- -**Example Usage** - -```js -const colors = require('ansi-colors'); -const { Sort } = require('enquirer'); -const prompt = new Sort({ - name: 'colors', - message: 'Sort the colors in order of preference', - hint: 'Top is best, bottom is worst', - numbered: true, - choices: ['red', 'white', 'green', 'cyan', 'yellow'].map(n => ({ - name: n, - message: colors[n](n) - })) -}); - -prompt.run() - .then(function(answer = []) { - console.log(answer); - console.log('Your preferred order of colors is:'); - console.log(answer.map(key => colors[key](key)).join('\n')); - }) - .catch(console.error); -``` - -**Related prompts** - -* [List](#list-prompt) -* [Select](#select-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Snippet Prompt - -Prompt that allows the user to replace placeholders in a snippet of code or text. - -

-Prompts -

- -**Example Usage** - -```js -const semver = require('semver'); -const { Snippet } = require('enquirer'); -const prompt = new Snippet({ - name: 'username', - message: 'Fill out the fields in package.json', - required: true, - fields: [ - { - name: 'author_name', - message: 'Author Name' - }, - { - name: 'version', - validate(value, state, item, index) { - if (item && item.name === 'version' && !semver.valid(value)) { - return prompt.styles.danger('version should be a valid semver value'); - } - return true; - } - } - ], - template: `{ - "name": "\${name}", - "description": "\${description}", - "version": "\${version}", - "homepage": "https://github.com/\${username}/\${name}", - "author": "\${author_name} (https://github.com/\${username})", - "repository": "\${username}/\${name}", - "license": "\${license:ISC}" -} -` -}); - -prompt.run() - .then(answer => console.log('Answer:', answer.result)) - .catch(console.error); -``` - -**Related prompts** - -* [Survey](#survey-prompt) -* [AutoComplete](#autocomplete-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Toggle Prompt - -Prompt that allows the user to toggle between two values then returns `true` or `false`. - -

-Enquirer Toggle Prompt -

- -**Example Usage** - -```js -const { Toggle } = require('enquirer'); - -const prompt = new Toggle({ - message: 'Want to answer?', - enabled: 'Yep', - disabled: 'Nope' -}); - -prompt.run() - .then(answer => console.log('Answer:', answer)) - .catch(console.error); -``` - -**Related prompts** - -* [Confirm](#confirm-prompt) -* [Input](#input-prompt) -* [Sort](#sort-prompt) - -**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) - -*** - -### Prompt Types - -There are 5 (soon to be 6!) type classes: - -* [ArrayPrompt](#arrayprompt) - - [Options](#options) - - [Properties](#properties) - - [Methods](#methods) - - [Choices](#choices) - - [Defining choices](#defining-choices) - - [Choice properties](#choice-properties) - - [Related prompts](#related-prompts) -* [AuthPrompt](#authprompt) -* [BooleanPrompt](#booleanprompt) -* DatePrompt (Coming Soon!) -* [NumberPrompt](#numberprompt) -* [StringPrompt](#stringprompt) - -Each type is a low-level class that may be used as a starting point for creating higher level prompts. Continue reading to learn how. - -### ArrayPrompt - -The `ArrayPrompt` class is used for creating prompts that display a list of choices in the terminal. For example, Enquirer uses this class as the basis for the [Select](#select) and [Survey](#survey) prompts. - -#### Options - -In addition to the [options](#options) available to all prompts, Array prompts also support the following options. - -| **Option** | **Required?** | **Type** | **Description** | -| ----------- | ------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `autofocus` | `no` | `string\|number` | The index or name of the choice that should have focus when the prompt loads. Only one choice may have focus at a time. | | -| `stdin` | `no` | `stream` | The input stream to use for emitting keypress events. Defaults to `process.stdin`. | -| `stdout` | `no` | `stream` | The output stream to use for writing the prompt to the terminal. Defaults to `process.stdout`. | -| | - -#### Properties - -Array prompts have the following instance properties and getters. - -| **Property name** | **Type** | **Description** | -| ----------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `choices` | `array` | Array of choices that have been normalized from choices passed on the prompt options. | -| `cursor` | `number` | Position of the cursor relative to the _user input (string)_. | -| `enabled` | `array` | Returns an array of enabled choices. | -| `focused` | `array` | Returns the currently selected choice in the visible list of choices. This is similar to the concept of focus in HTML and CSS. Focused choices are always visible (on-screen). When a list of choices is longer than the list of visible choices, and an off-screen choice is _focused_, the list will scroll to the focused choice and re-render. | -| `focused` | Gets the currently selected choice. Equivalent to `prompt.choices[prompt.index]`. | -| `index` | `number` | Position of the pointer in the _visible list (array) of choices_. | -| `limit` | `number` | The number of choices to display on-screen. | -| `selected` | `array` | Either a list of enabled choices (when `options.multiple` is true) or the currently focused choice. | -| `visible` | `string` | | - -#### Methods - -| **Method** | **Description** | -| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `pointer()` | Returns the visual symbol to use to identify the choice that currently has focus. The `❯` symbol is often used for this. The pointer is not always visible, as with the `autocomplete` prompt. | -| `indicator()` | Returns the visual symbol that indicates whether or not a choice is checked/enabled. | -| `focus()` | Sets focus on a choice, if it can be focused. | - -#### Choices - -Array prompts support the `choices` option, which is the array of choices users will be able to select from when rendered in the terminal. - -**Type**: `string|object` - -**Example** - -```js -const { prompt } = require('enquirer'); - -const questions = [{ - type: 'select', - name: 'color', - message: 'Favorite color?', - initial: 1, - choices: [ - { name: 'red', message: 'Red', value: '#ff0000' }, //<= choice object - { name: 'green', message: 'Green', value: '#00ff00' }, //<= choice object - { name: 'blue', message: 'Blue', value: '#0000ff' } //<= choice object - ] -}]; - -let answers = await prompt(questions); -console.log('Answer:', answers.color); -``` - -#### Defining choices - -Whether defined as a string or object, choices are normalized to the following interface: - -```js -{ - name: string; - message: string | undefined; - value: string | undefined; - hint: string | undefined; - disabled: boolean | string | undefined; -} -``` - -**Example** - -```js -const question = { - name: 'fruit', - message: 'Favorite fruit?', - choices: ['Apple', 'Orange', 'Raspberry'] -}; -``` - -Normalizes to the following when the prompt is run: - -```js -const question = { - name: 'fruit', - message: 'Favorite fruit?', - choices: [ - { name: 'Apple', message: 'Apple', value: 'Apple' }, - { name: 'Orange', message: 'Orange', value: 'Orange' }, - { name: 'Raspberry', message: 'Raspberry', value: 'Raspberry' } - ] -}; -``` - -#### Choice properties - -The following properties are supported on `choice` objects. - -| **Option** | **Type** | **Description** | -| ----------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | `string` | The unique key to identify a choice | -| `message` | `string` | The message to display in the terminal. `name` is used when this is undefined. | -| `value` | `string` | Value to associate with the choice. Useful for creating key-value pairs from user choices. `name` is used when this is undefined. | -| `choices` | `array` | Array of "child" choices. | -| `hint` | `string` | Help message to display next to a choice. | -| `role` | `string` | Determines how the choice will be displayed. Currently the only role supported is `separator`. Additional roles may be added in the future (like `heading`, etc). Please create a [feature request] | -| `enabled` | `boolean` | Enabled a choice by default. This is only supported when `options.multiple` is true or on prompts that support multiple choices, like [MultiSelect](#-multiselect). | -| `disabled` | `boolean\|string` | Disable a choice so that it cannot be selected. This value may either be `true`, `false`, or a message to display. | -| `indicator` | `string\|function` | Custom indicator to render for a choice (like a check or radio button). | - -#### Related prompts - -* [AutoComplete](#autocomplete-prompt) -* [Form](#form-prompt) -* [MultiSelect](#multiselect-prompt) -* [Select](#select-prompt) -* [Survey](#survey-prompt) - -*** - -### AuthPrompt - -The `AuthPrompt` is used to create prompts to log in user using any authentication method. For example, Enquirer uses this class as the basis for the [BasicAuth Prompt](#basicauth-prompt). You can also find prompt examples in `examples/auth/` folder that utilizes `AuthPrompt` to create OAuth based authentication prompt or a prompt that authenticates using time-based OTP, among others. - -`AuthPrompt` has a factory function that creates an instance of `AuthPrompt` class and it expects an `authenticate` function, as an argument, which overrides the `authenticate` function of the `AuthPrompt` class. - -#### Methods - -| **Method** | **Description** | -| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `authenticate()` | Contain all the authentication logic. This function should be overridden to implement custom authentication logic. The default `authenticate` function throws an error if no other function is provided. | - -#### Choices - -Auth prompt supports the `choices` option, which is the similar to the choices used in [Form Prompt](#form-prompt). - -**Example** - -```js -const { AuthPrompt } = require('enquirer'); - -function authenticate(value, state) { - if (value.username === this.options.username && value.password === this.options.password) { - return true; - } - return false; -} - -const CustomAuthPrompt = AuthPrompt.create(authenticate); - -const prompt = new CustomAuthPrompt({ - name: 'password', - message: 'Please enter your password', - username: 'rajat-sr', - password: '1234567', - choices: [ - { name: 'username', message: 'username' }, - { name: 'password', message: 'password' } - ] -}); - -prompt - .run() - .then(answer => console.log('Authenticated?', answer)) - .catch(console.error); -``` - -#### Related prompts - -* [BasicAuth Prompt](#basicauth-prompt) - -*** - -### BooleanPrompt - -The `BooleanPrompt` class is used for creating prompts that display and return a boolean value. - -```js -const { BooleanPrompt } = require('enquirer'); - -const prompt = new BooleanPrompt({ - header: '========================', - message: 'Do you love enquirer?', - footer: '========================', -}); - -prompt.run() - .then(answer => console.log('Selected:', answer)) - .catch(console.error); -``` - -**Returns**: `boolean` - -*** - -### NumberPrompt - -The `NumberPrompt` class is used for creating prompts that display and return a numerical value. - -```js -const { NumberPrompt } = require('enquirer'); - -const prompt = new NumberPrompt({ - header: '************************', - message: 'Input the Numbers:', - footer: '************************', -}); - -prompt.run() - .then(answer => console.log('Numbers are:', answer)) - .catch(console.error); -``` - -**Returns**: `string|number` (number, or number formatted as a string) - -*** - -### StringPrompt - -The `StringPrompt` class is used for creating prompts that display and return a string value. - -```js -const { StringPrompt } = require('enquirer'); - -const prompt = new StringPrompt({ - header: '************************', - message: 'Input the String:', - footer: '************************' -}); - -prompt.run() - .then(answer => console.log('String is:', answer)) - .catch(console.error); -``` - -**Returns**: `string` - -
- -## ❯ Custom prompts - -With Enquirer 2.0, custom prompts are easier than ever to create and use. - -**How do I create a custom prompt?** - -Custom prompts are created by extending either: - -* Enquirer's `Prompt` class -* one of the built-in [prompts](#-prompts), or -* low-level [types](#-types). - - - -```js -const { Prompt } = require('enquirer'); - -class HaiKarate extends Prompt { - constructor(options = {}) { - super(options); - this.value = options.initial || 0; - this.cursorHide(); - } - up() { - this.value++; - this.render(); - } - down() { - this.value--; - this.render(); - } - render() { - this.clear(); // clear previously rendered prompt from the terminal - this.write(`${this.state.message}: ${this.value}`); - } -} - -// Use the prompt by creating an instance of your custom prompt class. -const prompt = new HaiKarate({ - message: 'How many sprays do you want?', - initial: 10 -}); - -prompt.run() - .then(answer => console.log('Sprays:', answer)) - .catch(console.error); -``` - -If you want to be able to specify your prompt by `type` so that it may be used alongside other prompts, you will need to first create an instance of `Enquirer`. - -```js -const Enquirer = require('enquirer'); -const enquirer = new Enquirer(); -``` - -Then use the `.register()` method to add your custom prompt. - -```js -enquirer.register('haikarate', HaiKarate); -``` - -Now you can do the following when defining "questions". - -```js -let spritzer = require('cologne-drone'); -let answers = await enquirer.prompt([ - { - type: 'haikarate', - name: 'cologne', - message: 'How many sprays do you need?', - initial: 10, - async onSubmit(name, value) { - await spritzer.activate(value); //<= activate drone - return value; - } - } -]); -``` - -
- -## ❯ Key Bindings - -### All prompts - -These key combinations may be used with all prompts. - -| **command** | **description** | -| -------------------------------- | -------------------------------------- | -| ctrl + c | Cancel the prompt. | -| ctrl + g | Reset the prompt to its initial state. | - -
- -### Move cursor - -These combinations may be used on prompts that support user input (eg. [input prompt](#input-prompt), [password prompt](#password-prompt), and [invisible prompt](#invisible-prompt)). - -| **command** | **description** | -| ------------------------------ | ---------------------------------------- | -| left | Move the cursor back one character. | -| right | Move the cursor forward one character. | -| ctrl + a | Move cursor to the start of the line | -| ctrl + e | Move cursor to the end of the line | -| ctrl + b | Move cursor back one character | -| ctrl + f | Move cursor forward one character | -| ctrl + x | Toggle between first and cursor position | - -
- -### Edit Input - -These key combinations may be used on prompts that support user input (eg. [input prompt](#input-prompt), [password prompt](#password-prompt), and [invisible prompt](#invisible-prompt)). - -| **command** | **description** | -| ------------------------------ | ---------------------------------------- | -| ctrl + a | Move cursor to the start of the line | -| ctrl + e | Move cursor to the end of the line | -| ctrl + b | Move cursor back one character | -| ctrl + f | Move cursor forward one character | -| ctrl + x | Toggle between first and cursor position | - -
- -| **command (Mac)** | **command (Windows)** | **description** | -| ----------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| delete | backspace | Delete one character to the left. | -| fn + delete | delete | Delete one character to the right. | -| option + up | alt + up | Scroll to the previous item in history ([Input prompt](#input-prompt) only, when [history is enabled](examples/input/option-history.js)). | -| option + down | alt + down | Scroll to the next item in history ([Input prompt](#input-prompt) only, when [history is enabled](examples/input/option-history.js)). | - -### Select choices - -These key combinations may be used on prompts that support _multiple_ choices, such as the [multiselect prompt](#multiselect-prompt), or the [select prompt](#select-prompt) when the `multiple` options is true. - -| **command** | **description** | -| ----------------- | -------------------------------------------------------------------------------------------------------------------- | -| space | Toggle the currently selected choice when `options.multiple` is true. | -| number | Move the pointer to the choice at the given index. Also toggles the selected choice when `options.multiple` is true. | -| a | Toggle all choices to be enabled or disabled. | -| i | Invert the current selection of choices. | -| g | Toggle the current choice group. | - -
- -### Hide/show choices - -| **command** | **description** | -| ------------------------------- | ---------------------------------------------- | -| fn + up | Decrease the number of visible choices by one. | -| fn + down | Increase the number of visible choices by one. | - -
- -### Move/lock Pointer - -| **command** | **description** | -| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| number | Move the pointer to the choice at the given index. Also toggles the selected choice when `options.multiple` is true. | -| up | Move the pointer up. | -| down | Move the pointer down. | -| ctrl + a | Move the pointer to the first _visible_ choice. | -| ctrl + e | Move the pointer to the last _visible_ choice. | -| shift + up | Scroll up one choice without changing pointer position (locks the pointer while scrolling). | -| shift + down | Scroll down one choice without changing pointer position (locks the pointer while scrolling). | - -
- -| **command (Mac)** | **command (Windows)** | **description** | -| -------------------------------- | --------------------- | ---------------------------------------------------------- | -| fn + left | home | Move the pointer to the first choice in the choices array. | -| fn + right | end | Move the pointer to the last choice in the choices array. | - -
- -## ❯ Release History - -Please see [CHANGELOG.md](CHANGELOG.md). - -## ❯ Performance - -### System specs - -MacBook Pro, Intel Core i7, 2.5 GHz, 16 GB. - -### Load time - -Time it takes for the module to load the first time (average of 3 runs): - -``` -enquirer: 4.013ms -inquirer: 286.717ms -``` - -
- -## ❯ About - -
-Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Todo - -We're currently working on documentation for the following items. Please star and watch the repository for updates! - -* [ ] Customizing symbols -* [ ] Customizing styles (palette) -* [ ] Customizing rendered input -* [ ] Customizing returned values -* [ ] Customizing key bindings -* [ ] Question validation -* [ ] Choice validation -* [ ] Skipping questions -* [ ] Async choices -* [ ] Async timers: loaders, spinners and other animations -* [ ] Links to examples -
- -
-Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` -```sh -$ yarn && yarn test -``` - -
- -
-Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
- -#### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 283 | [jonschlinkert](https://github.com/jonschlinkert) | -| 82 | [doowb](https://github.com/doowb) | -| 32 | [rajat-sr](https://github.com/rajat-sr) | -| 20 | [318097](https://github.com/318097) | -| 15 | [g-plane](https://github.com/g-plane) | -| 12 | [pixelass](https://github.com/pixelass) | -| 5 | [adityavyas611](https://github.com/adityavyas611) | -| 5 | [satotake](https://github.com/satotake) | -| 3 | [tunnckoCore](https://github.com/tunnckoCore) | -| 3 | [Ovyerus](https://github.com/Ovyerus) | -| 3 | [sw-yx](https://github.com/sw-yx) | -| 2 | [DanielRuf](https://github.com/DanielRuf) | -| 2 | [GabeL7r](https://github.com/GabeL7r) | -| 1 | [AlCalzone](https://github.com/AlCalzone) | -| 1 | [hipstersmoothie](https://github.com/hipstersmoothie) | -| 1 | [danieldelcore](https://github.com/danieldelcore) | -| 1 | [ImgBotApp](https://github.com/ImgBotApp) | -| 1 | [jsonkao](https://github.com/jsonkao) | -| 1 | [knpwrs](https://github.com/knpwrs) | -| 1 | [yeskunall](https://github.com/yeskunall) | -| 1 | [mischah](https://github.com/mischah) | -| 1 | [renarsvilnis](https://github.com/renarsvilnis) | -| 1 | [sbugert](https://github.com/sbugert) | -| 1 | [stephencweiss](https://github.com/stephencweiss) | -| 1 | [skellock](https://github.com/skellock) | -| 1 | [whxaxes](https://github.com/whxaxes) | - -#### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -#### Credit - -Thanks to [derhuerst](https://github.com/derhuerst), creator of prompt libraries such as [prompt-skeleton](https://github.com/derhuerst/prompt-skeleton), which influenced some of the concepts we used in our prompts. - -#### License - -Copyright © 2018-present, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/LICENSE b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/LICENSE new file mode 100644 index 00000000000000..6c41d45cd765c2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL ANUARY BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/WarnSettings.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/WarnSettings.js new file mode 100644 index 00000000000000..09d32413186ec6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/WarnSettings.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +const WarnSettings = function () { + /** @type {WeakMap>} */ + const warnedSettings = new WeakMap(); + return { + /** + * Warn only once for each context and setting + * + * @param {object} context + * @param {string} setting + */ + hasBeenWarned(context, setting) { + return warnedSettings.has(context) && warnedSettings.get(context).has(setting); + }, + + markSettingAsWarned(context, setting) { + // istanbul ignore else + if (!warnedSettings.has(context)) { + warnedSettings.set(context, new Set()); + } + + warnedSettings.get(context).add(setting); + } + + }; +}; + +var _default = WarnSettings; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=WarnSettings.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/alignTransform.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/alignTransform.js new file mode 100644 index 00000000000000..aa51820eade6f7 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/alignTransform.js @@ -0,0 +1,216 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _commentParser = require("comment-parser"); + +/** + * Transform based on https://github.com/syavorsky/comment-parser/blob/master/src/transforms/align.ts + * + * It contains some customizations to align based on the tags, and some custom options. + */ +const { + rewireSource +} = _commentParser.util; +const zeroWidth = { + name: 0, + start: 0, + tag: 0, + type: 0 +}; + +const shouldAlign = (tags, index, source) => { + const tag = source[index].tokens.tag.replace('@', ''); + const includesTag = tags.includes(tag); + + if (includesTag) { + return true; + } + + if (tag !== '') { + return false; + } + + for (let iterator = index; iterator >= 0; iterator--) { + const previousTag = source[iterator].tokens.tag.replace('@', ''); + + if (previousTag !== '') { + if (tags.includes(previousTag)) { + return true; + } + + return false; + } + } + + return true; +}; + +const getWidth = tags => { + return (width, { + tokens + }, index, source) => { + if (!shouldAlign(tags, index, source)) { + return width; + } + + return { + name: Math.max(width.name, tokens.name.length), + start: tokens.delimiter === _commentParser.Markers.start ? tokens.start.length : width.start, + tag: Math.max(width.tag, tokens.tag.length), + type: Math.max(width.type, tokens.type.length) + }; + }; +}; + +const space = len => { + return ''.padStart(len, ' '); +}; + +const alignTransform = ({ + customSpacings, + tags, + indent, + preserveMainDescriptionPostDelimiter +}) => { + let intoTags = false; + let width; + + const alignTokens = tokens => { + const nothingAfter = { + delim: false, + name: false, + tag: false, + type: false + }; + + if (tokens.description === '') { + nothingAfter.name = true; + tokens.postName = ''; + + if (tokens.name === '') { + nothingAfter.type = true; + tokens.postType = ''; + + if (tokens.type === '') { + nothingAfter.tag = true; + tokens.postTag = ''; + /* istanbul ignore next: Never happens because the !intoTags return. But it's here for consistency with the original align transform */ + + if (tokens.tag === '') { + nothingAfter.delim = true; + } + } + } + } // Todo: Avoid fixing alignment of blocks with multiline wrapping of type + + + if (tokens.tag === '' && tokens.type) { + return tokens; + } + + const spacings = { + postDelimiter: (customSpacings === null || customSpacings === void 0 ? void 0 : customSpacings.postDelimiter) || 1, + postName: (customSpacings === null || customSpacings === void 0 ? void 0 : customSpacings.postName) || 1, + postTag: (customSpacings === null || customSpacings === void 0 ? void 0 : customSpacings.postTag) || 1, + postType: (customSpacings === null || customSpacings === void 0 ? void 0 : customSpacings.postType) || 1 + }; + tokens.postDelimiter = nothingAfter.delim ? '' : space(spacings.postDelimiter); + + if (!nothingAfter.tag) { + tokens.postTag = space(width.tag - tokens.tag.length + spacings.postTag); + } + + if (!nothingAfter.type) { + tokens.postType = space(width.type - tokens.type.length + spacings.postType); + } + + if (!nothingAfter.name) { + // If post name is empty for all lines (name width 0), don't add post name spacing. + tokens.postName = width.name === 0 ? '' : space(width.name - tokens.name.length + spacings.postName); + } + + return tokens; + }; + + const update = (line, index, source) => { + const tokens = { ...line.tokens + }; + + if (tokens.tag !== '') { + intoTags = true; + } + + const isEmpty = tokens.tag === '' && tokens.name === '' && tokens.type === '' && tokens.description === ''; // dangling '*/' + + if (tokens.end === _commentParser.Markers.end && isEmpty) { + tokens.start = indent + ' '; + return { ...line, + tokens + }; + } + /* eslint-disable indent */ + + + switch (tokens.delimiter) { + case _commentParser.Markers.start: + tokens.start = indent; + break; + + case _commentParser.Markers.delim: + tokens.start = indent + ' '; + break; + + default: + tokens.delimiter = ''; // compensate delimiter + + tokens.start = indent + ' '; + } + /* eslint-enable */ + + + if (!intoTags) { + if (tokens.description === '') { + tokens.postDelimiter = ''; + } else if (!preserveMainDescriptionPostDelimiter) { + tokens.postDelimiter = ' '; + } + + return { ...line, + tokens + }; + } // Not align. + + + if (!shouldAlign(tags, index, source)) { + return { ...line, + tokens + }; + } + + return { ...line, + tokens: alignTokens(tokens) + }; + }; + + return ({ + source, + ...fields + }) => { + width = source.reduce(getWidth(tags), { ...zeroWidth + }); + return rewireSource({ ...fields, + source: source.map((line, index) => { + return update(line, index, source); + }) + }); + }; +}; + +var _default = alignTransform; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=alignTransform.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/bin/generateRule.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/bin/generateRule.js new file mode 100644 index 00000000000000..59adf2d2544da4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/bin/generateRule.js @@ -0,0 +1,212 @@ +"use strict"; + +var _fs = require("fs"); + +var _promises = _interopRequireDefault(require("fs/promises")); + +var _path = require("path"); + +var _camelcase = _interopRequireDefault(require("camelcase")); + +var _openEditor = _interopRequireDefault(require("open-editor")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +// Todo: Would ideally have prompts, e.g., to ask for whether type was problem/layout, etc. +const [,, ruleName, ...options] = process.argv; +const recommended = options.includes('--recommended'); + +(async () => { + if (!ruleName) { + console.error('Please supply a rule name'); + return; + } + + if (/[A-Z]/u.test(ruleName)) { + console.error('Please ensure the rule has no capital letters'); + return; + } + + const ruleNamesPath = './test/rules/ruleNames.json'; + const ruleNames = JSON.parse(await _promises.default.readFile(ruleNamesPath, 'utf8')); + + if (!ruleNames.includes(ruleName)) { + ruleNames.push(ruleName); + ruleNames.sort(); + } + + await _promises.default.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\n'); + console.log('ruleNames', ruleNames); + const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc'; + +export default iterateJsdoc(({ + context, + utils, +}) => { + // Rule here +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: '', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-${ruleName}', + }, + schema: [ + { + additionalProperies: false, + properties: { + // Option properties here (or remove the object) + }, + type: 'object', + }, + ], + type: 'suggestion', + }, +}); +`; + const camelCasedRuleName = (0, _camelcase.default)(ruleName); + const rulePath = `./src/rules/${camelCasedRuleName}.js`; + + if (!(0, _fs.existsSync)(rulePath)) { + await _promises.default.writeFile(rulePath, ruleTemplate); + } + + const ruleTestTemplate = `export default { + invalid: [ + { + code: \` + \`, + errors: [{ + line: '', + message: '', + }], + }, + ], + valid: [ + { + code: \` + \`, + }, + ], +}; +`; + const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`; + + if (!(0, _fs.existsSync)(ruleTestPath)) { + await _promises.default.writeFile(ruleTestPath, ruleTestTemplate); + } + + const ruleReadmeTemplate = `### \`${ruleName}\` + +||| +|---|---| +|Context|everywhere| +|Tags|\`\`| +|Recommended|${recommended ? 'true' : 'false'}| +|Settings|| +|Options|| + + +`; + const ruleReadmePath = `./.README/rules/${ruleName}.md`; + + if (!(0, _fs.existsSync)(ruleReadmePath)) { + await _promises.default.writeFile(ruleReadmePath, ruleReadmeTemplate); + } + + const replaceInOrder = async ({ + path, + oldRegex, + checkName, + newLine, + oldIsCamel + }) => { + const offsets = []; + let readme = await _promises.default.readFile(path, 'utf8'); + readme.replace(oldRegex, (matchedLine, n1, offset, str, { + oldRule + }) => { + offsets.push({ + matchedLine, + offset, + oldRule + }); + }); + offsets.sort(({ + oldRule + }, { + oldRule: oldRuleB + }) => { + // eslint-disable-next-line no-extra-parens + return oldRule < oldRuleB ? -1 : oldRule > oldRuleB ? 1 : 0; + }); + let alreadyIncluded = false; + const itemIndex = offsets.findIndex(({ + oldRule + }) => { + alreadyIncluded || (alreadyIncluded = oldIsCamel ? camelCasedRuleName === oldRule : ruleName === oldRule); + return oldIsCamel ? camelCasedRuleName < oldRule : ruleName < oldRule; + }); + let item = itemIndex !== undefined && offsets[itemIndex]; + + if (item && itemIndex === 0 && // This property would not always be sufficient but in this case it is. + oldIsCamel) { + item.offset = 0; + } + + if (!item) { + item = offsets.pop(); + item.offset += item.matchedLine.length; + } + + if (alreadyIncluded) { + console.log(`Rule name is already present in ${checkName}.`); + } else { + readme = readme.slice(0, item.offset) + (item.offset ? '\n' : '') + newLine + (item.offset ? '' : '\n') + readme.slice(item.offset); + await _promises.default.writeFile(path, readme); + } + }; + + await replaceInOrder({ + checkName: 'README', + newLine: `{"gitdown": "include", "file": "./rules/${ruleName}.md"}`, + oldRegex: /\n\{"gitdown": "include", "file": ".\/rules\/(?[^.]*).md"\}/gu, + path: './.README/README.md' + }); + await replaceInOrder({ + checkName: 'index import', + newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}';`, + oldIsCamel: true, + oldRegex: /\nimport (?[^ ]*) from '.\/rules\/\1';/gu, + path: './src/index.js' + }); + await replaceInOrder({ + checkName: 'index recommended', + newLine: `${' '.repeat(8)}'jsdoc/${ruleName}': '${recommended ? 'warn' : 'off'}',`, + oldRegex: /\n\s{8}'jsdoc\/(?[^']*)': '[^']*',/gu, + path: './src/index.js' + }); + await replaceInOrder({ + checkName: 'index rules', + newLine: `${' '.repeat(4)}'${ruleName}': ${camelCasedRuleName},`, + oldRegex: /\n\s{4}'(?[^']*)': [^,]*,/gu, + path: './src/index.js' + }); + await Promise.resolve().then(() => _interopRequireWildcard(require('./generateReadme.js'))); + /* + console.log('Paths to open for further editing\n'); + console.log(`open ${ruleReadmePath}`); + console.log(`open ${rulePath}`); + console.log(`open ${ruleTestPath}\n`); + */ + // Set chdir as somehow still in operation from other test + + process.chdir((0, _path.resolve)(__dirname, '../../')); + await (0, _openEditor.default)([// Could even add editor line column numbers like `${rulePath}:1:1` + ruleReadmePath, ruleTestPath, rulePath]); +})(); +//# sourceMappingURL=generateRule.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/exportParser.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/exportParser.js new file mode 100644 index 00000000000000..669cae9393ec2f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/exportParser.js @@ -0,0 +1,619 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _jsdoccomment = require("@es-joy/jsdoccomment"); + +var _debug = _interopRequireDefault(require("debug")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const debug = (0, _debug.default)('requireExportJsdoc'); + +const createNode = function () { + return { + props: {} + }; +}; + +const getSymbolValue = function (symbol) { + /* istanbul ignore next */ + if (!symbol) { + /* istanbul ignore next */ + return null; + } + /* istanbul ignore next */ + + + if (symbol.type === 'literal') { + return symbol.value.value; + } + /* istanbul ignore next */ + + + return null; +}; + +const getIdentifier = function (node, globals, scope, opts) { + if (opts.simpleIdentifier) { + // Type is Identier for noncomputed properties + const identifierLiteral = createNode(); + identifierLiteral.type = 'literal'; + identifierLiteral.value = { + value: node.name + }; + return identifierLiteral; + } + /* istanbul ignore next */ + + + const block = scope || globals; // As scopes are not currently supported, they are not traversed upwards recursively + + if (block.props[node.name]) { + return block.props[node.name]; + } // Seems this will only be entered once scopes added and entered + + /* istanbul ignore next */ + + + if (globals.props[node.name]) { + return globals.props[node.name]; + } + + return null; +}; + +let createSymbol = null; // eslint-disable-next-line complexity + +const getSymbol = function (node, globals, scope, opt) { + const opts = opt || {}; + /* istanbul ignore next */ + // eslint-disable-next-line default-case + + switch (node.type) { + case 'Identifier': + { + return getIdentifier(node, globals, scope, opts); + } + + case 'MemberExpression': + { + const obj = getSymbol(node.object, globals, scope, opts); + const propertySymbol = getSymbol(node.property, globals, scope, { + simpleIdentifier: !node.computed + }); + const propertyValue = getSymbolValue(propertySymbol); + /* istanbul ignore next */ + + if (obj && propertyValue && obj.props[propertyValue]) { + const block = obj.props[propertyValue]; + return block; + } + /* + if (opts.createMissingProps && propertyValue) { + obj.props[propertyValue] = createNode(); + return obj.props[propertyValue]; + } + */ + + /* istanbul ignore next */ + + + debug(`MemberExpression: Missing property ${node.property.name}`); + /* istanbul ignore next */ + + return null; + } + + case 'TSTypeAliasDeclaration': + case 'TSEnumDeclaration': + case 'TSInterfaceDeclaration': + case 'ClassDeclaration': + case 'ClassExpression': + case 'FunctionExpression': + case 'FunctionDeclaration': + case 'ArrowFunctionExpression': + { + const val = createNode(); + val.props.prototype = createNode(); + val.props.prototype.type = 'object'; + val.type = 'object'; + val.value = node; + return val; + } + + case 'AssignmentExpression': + { + return createSymbol(node.left, globals, node.right, scope, opts); + } + + case 'ClassBody': + { + const val = createNode(); + + for (const method of node.body) { + val.props[method.key.name] = createNode(); + val.props[method.key.name].type = 'object'; + val.props[method.key.name].value = method.value; + } + + val.type = 'object'; + val.value = node; + return val; + } + + case 'ObjectExpression': + { + const val = createNode(); + val.type = 'object'; + + for (const prop of node.properties) { + if ([// @typescript-eslint/parser, espree, acorn, etc. + 'SpreadElement', // @babel/eslint-parser + 'ExperimentalSpreadProperty'].includes(prop.type)) { + continue; + } + + const propVal = getSymbol(prop.value, globals, scope, opts); + /* istanbul ignore next */ + + if (propVal) { + val.props[prop.key.name] = propVal; + } + } + + return val; + } + + case 'Literal': + { + const val = createNode(); + val.type = 'literal'; + val.value = node; + return val; + } + } + /* istanbul ignore next */ + + + return null; +}; + +const createBlockSymbol = function (block, name, value, globals, isGlobal) { + block.props[name] = value; + + if (isGlobal && globals.props.window && globals.props.window.special) { + globals.props.window.props[name] = value; + } +}; + +createSymbol = function (node, globals, value, scope, isGlobal) { + const block = scope || globals; + let symbol; // eslint-disable-next-line default-case + + switch (node.type) { + case 'FunctionDeclaration': + /* istanbul ignore next */ + // Fall through + + case 'TSEnumDeclaration': + case 'TSInterfaceDeclaration': + /* istanbul ignore next */ + // Fall through + + case 'TSTypeAliasDeclaration': + case 'ClassDeclaration': + { + /* istanbul ignore next */ + if (node.id && node.id.type === 'Identifier') { + return createSymbol(node.id, globals, node, globals); + } + /* istanbul ignore next */ + + + break; + } + + case 'Identifier': + { + if (value) { + const valueSymbol = getSymbol(value, globals, block); + /* istanbul ignore next */ + + if (valueSymbol) { + createBlockSymbol(block, node.name, valueSymbol, globals, isGlobal); + return block.props[node.name]; + } + /* istanbul ignore next */ + + + debug('Identifier: Missing value symbol for %s', node.name); + } else { + createBlockSymbol(block, node.name, createNode(), globals, isGlobal); + return block.props[node.name]; + } + /* istanbul ignore next */ + + + break; + } + + case 'MemberExpression': + { + symbol = getSymbol(node.object, globals, block); + const propertySymbol = getSymbol(node.property, globals, block, { + simpleIdentifier: !node.computed + }); + const propertyValue = getSymbolValue(propertySymbol); + + if (symbol && propertyValue) { + createBlockSymbol(symbol, propertyValue, getSymbol(value, globals, block), globals, isGlobal); + return symbol.props[propertyValue]; + } + /* istanbul ignore next */ + + + debug('MemberExpression: Missing symbol: %s', node.property.name); + break; + } + } + + return null; +}; // Creates variables from variable definitions + + +const initVariables = function (node, globals, opts) { + // eslint-disable-next-line default-case + switch (node.type) { + case 'Program': + { + for (const childNode of node.body) { + initVariables(childNode, globals, opts); + } + + break; + } + + case 'ExpressionStatement': + { + initVariables(node.expression, globals, opts); + break; + } + + case 'VariableDeclaration': + { + for (const declaration of node.declarations) { + // let and const + const symbol = createSymbol(declaration.id, globals, null, globals); + + if (opts.initWindow && node.kind === 'var' && globals.props.window) { + // If var, also add to window + globals.props.window.props[declaration.id.name] = symbol; + } + } + + break; + } + + case 'ExportNamedDeclaration': + { + if (node.declaration) { + initVariables(node.declaration, globals, opts); + } + + break; + } + } +}; // Populates variable maps using AST +// eslint-disable-next-line complexity + + +const mapVariables = function (node, globals, opt, isExport) { + /* istanbul ignore next */ + const opts = opt || {}; + /* istanbul ignore next */ + + switch (node.type) { + case 'Program': + { + if (opts.ancestorsOnly) { + return false; + } + + for (const childNode of node.body) { + mapVariables(childNode, globals, opts); + } + + break; + } + + case 'ExpressionStatement': + { + mapVariables(node.expression, globals, opts); + break; + } + + case 'AssignmentExpression': + { + createSymbol(node.left, globals, node.right); + break; + } + + case 'VariableDeclaration': + { + for (const declaration of node.declarations) { + const isGlobal = opts.initWindow && node.kind === 'var' && globals.props.window; + const symbol = createSymbol(declaration.id, globals, declaration.init, globals, isGlobal); + + if (symbol && isExport) { + symbol.exported = true; + } + } + + break; + } + + case 'FunctionDeclaration': + { + /* istanbul ignore next */ + if (node.id.type === 'Identifier') { + createSymbol(node.id, globals, node, globals, true); + } + + break; + } + + case 'ExportDefaultDeclaration': + { + const symbol = createSymbol(node.declaration, globals, node.declaration); + + if (symbol) { + symbol.exported = true; + } else if (!node.id) { + globals.ANONYMOUS_DEFAULT = node.declaration; + } + + break; + } + + case 'ExportNamedDeclaration': + { + if (node.declaration) { + if (node.declaration.type === 'VariableDeclaration') { + mapVariables(node.declaration, globals, opts, true); + } else { + const symbol = createSymbol(node.declaration, globals, node.declaration); + /* istanbul ignore next */ + + if (symbol) { + symbol.exported = true; + } + } + } + + for (const specifier of node.specifiers) { + mapVariables(specifier, globals, opts); + } + + break; + } + + case 'ExportSpecifier': + { + const symbol = getSymbol(node.local, globals, globals); + /* istanbul ignore next */ + + if (symbol) { + symbol.exported = true; + } + + break; + } + + case 'ClassDeclaration': + { + createSymbol(node.id, globals, node.body, globals); + break; + } + + default: + { + /* istanbul ignore next */ + return false; + } + } + + return true; +}; + +const findNode = function (node, block, cache) { + let blockCache = cache || []; + /* istanbul ignore next */ + + if (!block || blockCache.includes(block)) { + return false; + } + + blockCache = blockCache.slice(); + blockCache.push(block); + + if ((block.type === 'object' || block.type === 'MethodDefinition') && block.value === node) { + return true; + } + + const { + props = block.body + } = block; + + for (const propval of Object.values(props || {})) { + if (Array.isArray(propval)) { + /* istanbul ignore if */ + if (propval.some(val => { + return findNode(node, val, blockCache); + })) { + return true; + } + } else if (findNode(node, propval, blockCache)) { + return true; + } + } + + return false; +}; + +const exportTypes = new Set(['ExportNamedDeclaration', 'ExportDefaultDeclaration']); + +const getExportAncestor = function (nde) { + let node = nde; + + while (node) { + if (exportTypes.has(node.type)) { + return node; + } + + node = node.parent; + } + + return false; +}; + +const canExportedByAncestorType = new Set(['TSPropertySignature', 'TSMethodSignature', 'ClassProperty', 'Method']); +const canExportChildrenType = new Set(['TSInterfaceBody', 'TSInterfaceDeclaration', 'ClassDefinition', 'ClassExpression', 'Program']); + +const isExportByAncestor = function (nde) { + if (!canExportedByAncestorType.has(nde.type)) { + return false; + } + + let node = nde.parent; + + while (node) { + if (exportTypes.has(node.type)) { + return node; + } + + if (!canExportChildrenType.has(node.type)) { + return false; + } + + node = node.parent; + } + + return false; +}; + +const findExportedNode = function (block, node, cache) { + /* istanbul ignore next */ + if (block === null) { + return false; + } + + const blockCache = cache || []; + const { + props + } = block; + + for (const propval of Object.values(props)) { + blockCache.push(propval); + + if (propval.exported && (node === propval.value || findNode(node, propval.value))) { + return true; + } // No need to check `propval` for exported nodes as ESM + // exports are only global + + } + + return false; +}; + +const isNodeExported = function (node, globals, opt) { + if (opt.initModuleExports && globals.props.module && globals.props.module.props.exports && findNode(node, globals.props.module.props.exports)) { + return true; + } + + if (opt.initWindow && globals.props.window && findNode(node, globals.props.window)) { + return true; + } + + if (opt.esm && findExportedNode(globals, node)) { + return true; + } + + return false; +}; + +const parseRecursive = function (node, globalVars, opts) { + // Iterate from top using recursion - stop at first processed node from top + if (node.parent && parseRecursive(node.parent, globalVars, opts)) { + return true; + } + + return mapVariables(node, globalVars, opts); +}; + +const parse = function (ast, node, opt) { + /* istanbul ignore next */ + const opts = opt || { + ancestorsOnly: false, + esm: true, + initModuleExports: true, + initWindow: true + }; + const globalVars = createNode(); + + if (opts.initModuleExports) { + globalVars.props.module = createNode(); + globalVars.props.module.props.exports = createNode(); + globalVars.props.exports = globalVars.props.module.props.exports; + } + + if (opts.initWindow) { + globalVars.props.window = createNode(); + globalVars.props.window.special = true; + } + + if (opts.ancestorsOnly) { + parseRecursive(node, globalVars, opts); + } else { + initVariables(ast, globalVars, opts); + mapVariables(ast, globalVars, opts); + } + + return { + globalVars + }; +}; + +const isUncommentedExport = function (node, sourceCode, opt, settings) { + // console.log({node}); + // Optimize with ancestor check for esm + if (opt.esm) { + const exportNode = getExportAncestor(node); // Is export node comment + + if (exportNode && !(0, _jsdoccomment.findJSDocComment)(exportNode, sourceCode, settings)) { + return true; + } + /** + * Some typescript types are not in variable map, but inherit exported (interface property and method) + */ + + + if (isExportByAncestor(node) && !(0, _jsdoccomment.findJSDocComment)(node, sourceCode, settings)) { + return true; + } + } + + const parseResult = parse(sourceCode.ast, node, opt); + return isNodeExported(node, parseResult.globalVars, opt); +}; + +var _default = { + isUncommentedExport, + parse +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=exportParser.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/generateRule.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/generateRule.js new file mode 100644 index 00000000000000..59adf2d2544da4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/generateRule.js @@ -0,0 +1,212 @@ +"use strict"; + +var _fs = require("fs"); + +var _promises = _interopRequireDefault(require("fs/promises")); + +var _path = require("path"); + +var _camelcase = _interopRequireDefault(require("camelcase")); + +var _openEditor = _interopRequireDefault(require("open-editor")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +// Todo: Would ideally have prompts, e.g., to ask for whether type was problem/layout, etc. +const [,, ruleName, ...options] = process.argv; +const recommended = options.includes('--recommended'); + +(async () => { + if (!ruleName) { + console.error('Please supply a rule name'); + return; + } + + if (/[A-Z]/u.test(ruleName)) { + console.error('Please ensure the rule has no capital letters'); + return; + } + + const ruleNamesPath = './test/rules/ruleNames.json'; + const ruleNames = JSON.parse(await _promises.default.readFile(ruleNamesPath, 'utf8')); + + if (!ruleNames.includes(ruleName)) { + ruleNames.push(ruleName); + ruleNames.sort(); + } + + await _promises.default.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\n'); + console.log('ruleNames', ruleNames); + const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc'; + +export default iterateJsdoc(({ + context, + utils, +}) => { + // Rule here +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: '', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-${ruleName}', + }, + schema: [ + { + additionalProperies: false, + properties: { + // Option properties here (or remove the object) + }, + type: 'object', + }, + ], + type: 'suggestion', + }, +}); +`; + const camelCasedRuleName = (0, _camelcase.default)(ruleName); + const rulePath = `./src/rules/${camelCasedRuleName}.js`; + + if (!(0, _fs.existsSync)(rulePath)) { + await _promises.default.writeFile(rulePath, ruleTemplate); + } + + const ruleTestTemplate = `export default { + invalid: [ + { + code: \` + \`, + errors: [{ + line: '', + message: '', + }], + }, + ], + valid: [ + { + code: \` + \`, + }, + ], +}; +`; + const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`; + + if (!(0, _fs.existsSync)(ruleTestPath)) { + await _promises.default.writeFile(ruleTestPath, ruleTestTemplate); + } + + const ruleReadmeTemplate = `### \`${ruleName}\` + +||| +|---|---| +|Context|everywhere| +|Tags|\`\`| +|Recommended|${recommended ? 'true' : 'false'}| +|Settings|| +|Options|| + + +`; + const ruleReadmePath = `./.README/rules/${ruleName}.md`; + + if (!(0, _fs.existsSync)(ruleReadmePath)) { + await _promises.default.writeFile(ruleReadmePath, ruleReadmeTemplate); + } + + const replaceInOrder = async ({ + path, + oldRegex, + checkName, + newLine, + oldIsCamel + }) => { + const offsets = []; + let readme = await _promises.default.readFile(path, 'utf8'); + readme.replace(oldRegex, (matchedLine, n1, offset, str, { + oldRule + }) => { + offsets.push({ + matchedLine, + offset, + oldRule + }); + }); + offsets.sort(({ + oldRule + }, { + oldRule: oldRuleB + }) => { + // eslint-disable-next-line no-extra-parens + return oldRule < oldRuleB ? -1 : oldRule > oldRuleB ? 1 : 0; + }); + let alreadyIncluded = false; + const itemIndex = offsets.findIndex(({ + oldRule + }) => { + alreadyIncluded || (alreadyIncluded = oldIsCamel ? camelCasedRuleName === oldRule : ruleName === oldRule); + return oldIsCamel ? camelCasedRuleName < oldRule : ruleName < oldRule; + }); + let item = itemIndex !== undefined && offsets[itemIndex]; + + if (item && itemIndex === 0 && // This property would not always be sufficient but in this case it is. + oldIsCamel) { + item.offset = 0; + } + + if (!item) { + item = offsets.pop(); + item.offset += item.matchedLine.length; + } + + if (alreadyIncluded) { + console.log(`Rule name is already present in ${checkName}.`); + } else { + readme = readme.slice(0, item.offset) + (item.offset ? '\n' : '') + newLine + (item.offset ? '' : '\n') + readme.slice(item.offset); + await _promises.default.writeFile(path, readme); + } + }; + + await replaceInOrder({ + checkName: 'README', + newLine: `{"gitdown": "include", "file": "./rules/${ruleName}.md"}`, + oldRegex: /\n\{"gitdown": "include", "file": ".\/rules\/(?[^.]*).md"\}/gu, + path: './.README/README.md' + }); + await replaceInOrder({ + checkName: 'index import', + newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}';`, + oldIsCamel: true, + oldRegex: /\nimport (?[^ ]*) from '.\/rules\/\1';/gu, + path: './src/index.js' + }); + await replaceInOrder({ + checkName: 'index recommended', + newLine: `${' '.repeat(8)}'jsdoc/${ruleName}': '${recommended ? 'warn' : 'off'}',`, + oldRegex: /\n\s{8}'jsdoc\/(?[^']*)': '[^']*',/gu, + path: './src/index.js' + }); + await replaceInOrder({ + checkName: 'index rules', + newLine: `${' '.repeat(4)}'${ruleName}': ${camelCasedRuleName},`, + oldRegex: /\n\s{4}'(?[^']*)': [^,]*,/gu, + path: './src/index.js' + }); + await Promise.resolve().then(() => _interopRequireWildcard(require('./generateReadme.js'))); + /* + console.log('Paths to open for further editing\n'); + console.log(`open ${ruleReadmePath}`); + console.log(`open ${rulePath}`); + console.log(`open ${ruleTestPath}\n`); + */ + // Set chdir as somehow still in operation from other test + + process.chdir((0, _path.resolve)(__dirname, '../../')); + await (0, _openEditor.default)([// Could even add editor line column numbers like `${rulePath}:1:1` + ruleReadmePath, ruleTestPath, rulePath]); +})(); +//# sourceMappingURL=generateRule.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/getDefaultTagStructureForMode.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/getDefaultTagStructureForMode.js new file mode 100644 index 00000000000000..f3e21c6e0032e6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/getDefaultTagStructureForMode.js @@ -0,0 +1,167 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +const getDefaultTagStructureForMode = mode => { + const isJsdoc = mode === 'jsdoc'; + const isClosure = mode === 'closure'; + const isTypescript = mode === 'typescript'; + const isPermissive = mode === 'permissive'; + const isJsdocOrTypescript = isJsdoc || isTypescript; + const isTypescriptOrClosure = isTypescript || isClosure; + const isClosureOrPermissive = isClosure || isPermissive; + const isJsdocTypescriptOrPermissive = isJsdocOrTypescript || isPermissive; // Properties: + // `nameContents` - 'namepath-referencing'|'namepath-defining'|'text'|false + // `typeAllowed` - boolean + // `nameRequired` - boolean + // `typeRequired` - boolean + // `typeOrNameRequired` - boolean + // All of `typeAllowed` have a signature with "type" except for + // `augments`/`extends` ("namepath") + // `param`/`arg`/`argument` (no signature) + // `property`/`prop` (no signature) + // `modifies` (undocumented) + // None of the `nameContents: 'namepath-defining'` show as having curly + // brackets for their name/namepath + // Among `namepath-defining` and `namepath-referencing`, these do not seem + // to allow curly brackets in their doc signature or examples (`modifies` + // references namepaths within its type brackets and `param` is + // name-defining but not namepath-defining, so not part of these groups) + // Todo: Should support special processing for "name" as distinct from + // "namepath" (e.g., param can't define a namepath) + // Once checking inline tags: + // Todo: Re: `typeOrNameRequired`, `@link` (or @linkcode/@linkplain) seems + // to require a namepath OR URL and might be checked as such. + // Todo: Should support a `tutorialID` type (for `@tutorial` block and + // inline) + + return new Map([['alias', new Map([// Signature seems to require a "namepath" (and no counter-examples) + ['nameContents', 'namepath-referencing'], // "namepath" + ['typeOrNameRequired', true]])], ['arg', new Map([['nameContents', 'namepath-defining'], // See `param` + ['nameRequired', true], // Has no formal signature in the docs but shows curly brackets + // in the examples + ['typeAllowed', true]])], ['argument', new Map([['nameContents', 'namepath-defining'], // See `param` + ['nameRequired', true], // Has no formal signature in the docs but shows curly brackets + // in the examples + ['typeAllowed', true]])], ['augments', new Map([// Signature seems to require a "namepath" (and no counter-examples) + ['nameContents', 'namepath-referencing'], // Does not show curly brackets in either the signature or examples + ['typeAllowed', true], // "namepath" + ['typeOrNameRequired', true]])], ['borrows', new Map([// `borrows` has a different format, however, so needs special parsing; + // seems to require both, and as "namepath"'s + ['nameContents', 'namepath-referencing'], // "namepath" + ['typeOrNameRequired', true]])], ['callback', new Map([// Seems to require a "namepath" in the signature (with no + // counter-examples) + ['nameContents', 'namepath-defining'], // "namepath" + ['nameRequired', true]])], ['class', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['const', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['constant', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['constructor', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['define', new Map([['typeRequired', isClosure]])], ['emits', new Map([// Signature seems to require a "name" (of an event) and no counter-examples + ['nameContents', 'namepath-referencing']])], ['enum', new Map([// Has example showing curly brackets but not in doc signature + ['typeAllowed', true]])], ['event', new Map([// The doc signature of `event` seems to require a "name" + ['nameRequired', true], // Appears to require a "name" in its signature, albeit somewhat + // different from other "name"'s (including as described + // at https://jsdoc.app/about-namepaths.html ) + ['nameContents', 'namepath-defining']])], ['exception', new Map([// Shows curly brackets in the signature and in the examples + ['typeAllowed', true]])], ['export', new Map([['typeAllowed', isClosureOrPermissive]])], ['extends', new Map([// Signature seems to require a "namepath" (and no counter-examples) + ['nameContents', 'namepath-referencing'], // Does not show curly brackets in either the signature or examples + ['typeAllowed', isTypescriptOrClosure || isPermissive], ['nameRequired', isJsdoc], // "namepath" + ['typeOrNameRequired', isTypescriptOrClosure || isPermissive]])], ['external', new Map([// Appears to require a "name" in its signature, albeit somewhat + // different from other "name"'s (including as described + // at https://jsdoc.app/about-namepaths.html ) + ['nameContents', 'namepath-defining'], // "name" (and a special syntax for the `external` name) + ['nameRequired', true]])], ['fires', new Map([// Signature seems to require a "name" (of an event) and no + // counter-examples + ['nameContents', 'namepath-referencing']])], ['function', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining']])], ['func', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining']])], ['host', new Map([// Appears to require a "name" in its signature, albeit somewhat + // different from other "name"'s (including as described + // at https://jsdoc.app/about-namepaths.html ) + ['nameContents', 'namepath-defining'], // See `external` + ['nameRequired', true], // "namepath" + ['typeOrNameRequired', true]])], ['interface', new Map([// Allows for "name" in signature, but indicates as optional + ['nameContents', isJsdocTypescriptOrPermissive ? 'namepath-defining' : false]])], ['implements', new Map([// Shows curly brackets in the doc signature and examples + // "typeExpression" + ['typeRequired', true]])], ['lends', new Map([// Signature seems to require a "namepath" (and no counter-examples) + ['nameContents', 'namepath-referencing'], // "namepath" + ['typeOrNameRequired', true]])], ['listens', new Map([// Signature seems to require a "name" (of an event) and no + // counter-examples + ['nameContents', 'namepath-referencing']])], ['member', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining'], // Has example showing curly brackets but not in doc signature + ['typeAllowed', true]])], ['memberof', new Map([// Signature seems to require a "namepath" (and no counter-examples), + // though it allows an incomplete namepath ending with connecting symbol + ['nameContents', 'namepath-referencing'], // "namepath" + ['typeOrNameRequired', true]])], ['memberof!', new Map([// Signature seems to require a "namepath" (and no counter-examples), + // though it allows an incomplete namepath ending with connecting symbol + ['nameContents', 'namepath-referencing'], // "namepath" + ['typeOrNameRequired', true]])], ['method', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining']])], ['mixes', new Map([// Signature seems to require a "OtherObjectPath" with no + // counter-examples + ['nameContents', 'namepath-referencing'], // "OtherObjectPath" + ['typeOrNameRequired', true]])], ['mixin', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining']])], ['modifies', new Map([// Has no documentation, but test example has curly brackets, and + // "name" would be suggested rather than "namepath" based on example; + // not sure if name is required + ['typeAllowed', true]])], ['module', new Map([// Optional "name" and no curly brackets + // this block impacts `no-undefined-types` and `valid-types` (search for + // "isNamepathDefiningTag|tagMightHaveNamepath|tagMightHaveEitherTypeOrNamePosition") + ['nameContents', isJsdoc ? 'namepath-defining' : 'text'], // Shows the signature with curly brackets but not in the example + ['typeAllowed', true]])], ['name', new Map([// Seems to require a "namepath" in the signature (with no + // counter-examples) + ['nameContents', 'namepath-defining'], // "namepath" + ['nameRequired', true], // "namepath" + ['typeOrNameRequired', true]])], ['namespace', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining'], // Shows the signature with curly brackets but not in the example + ['typeAllowed', true]])], ['package', new Map([// Shows the signature with curly brackets but not in the example + // "typeExpression" + ['typeAllowed', isClosureOrPermissive]])], ['param', new Map([['nameContents', 'namepath-defining'], // Though no signature provided requiring, per + // https://jsdoc.app/tags-param.html: + // "The @param tag requires you to specify the name of the parameter you + // are documenting." + ['nameRequired', true], // Has no formal signature in the docs but shows curly brackets + // in the examples + ['typeAllowed', true]])], ['private', new Map([// Shows the signature with curly brackets but not in the example + // "typeExpression" + ['typeAllowed', isClosureOrPermissive]])], ['prop', new Map([['nameContents', 'namepath-defining'], // See `property` + ['nameRequired', true], // Has no formal signature in the docs but shows curly brackets + // in the examples + ['typeAllowed', true]])], ['property', new Map([['nameContents', 'namepath-defining'], // No docs indicate required, but since parallel to `param`, we treat as + // such: + ['nameRequired', true], // Has no formal signature in the docs but shows curly brackets + // in the examples + ['typeAllowed', true]])], ['protected', new Map([// Shows the signature with curly brackets but not in the example + // "typeExpression" + ['typeAllowed', isClosureOrPermissive]])], ['public', new Map([// Does not show a signature nor show curly brackets in the example + ['typeAllowed', isClosureOrPermissive]])], ['returns', new Map([// Shows curly brackets in the signature and in the examples + ['typeAllowed', true]])], ['return', new Map([// Shows curly brackets in the signature and in the examples + ['typeAllowed', true]])], ['see', new Map([// Signature allows for "namepath" or text, so user must configure to + // 'namepath-referencing' to enforce checks + ['nameContents', 'text']])], ['static', new Map([// Does not show a signature nor show curly brackets in the example + ['typeAllowed', isClosureOrPermissive]])], ['template', new Map([['nameContents', isJsdoc ? 'text' : 'namepath-referencing'], // Though defines `nameContents: 'namepath-defining'` in a sense, it is + // not parseable in the same way for template (e.g., allowing commas), + // so not adding + ['typeAllowed', isTypescriptOrClosure || isPermissive]])], ['this', new Map([// Signature seems to require a "namepath" (and no counter-examples) + // Not used with namepath in Closure/TypeScript, however + ['nameContents', isJsdoc ? 'namepath-referencing' : false], ['typeRequired', isTypescriptOrClosure], // namepath + ['typeOrNameRequired', isJsdoc]])], ['throws', new Map([// Shows curly brackets in the signature and in the examples + ['typeAllowed', true]])], ['type', new Map([// Shows curly brackets in the doc signature and examples + // "typeName" + ['typeRequired', true]])], ['typedef', new Map([// Seems to require a "namepath" in the signature (with no + // counter-examples) + ['nameContents', 'namepath-defining'], // "namepath" + ['nameRequired', isJsdocTypescriptOrPermissive], // Has example showing curly brackets but not in doc signature + ['typeAllowed', true], // "namepath" + ['typeOrNameRequired', true]])], ['var', new Map([// Allows for "name"'s in signature, but indicated as optional + ['nameContents', 'namepath-defining'], // Has example showing curly brackets but not in doc signature + ['typeAllowed', true]])], ['yields', new Map([// Shows curly brackets in the signature and in the examples + ['typeAllowed', true]])], ['yield', new Map([// Shows curly brackets in the signature and in the examples + ['typeAllowed', true]])]]); +}; + +var _default = getDefaultTagStructureForMode; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=getDefaultTagStructureForMode.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/index.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/index.js new file mode 100644 index 00000000000000..918c473aeb28b3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/index.js @@ -0,0 +1,215 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _checkAccess = _interopRequireDefault(require("./rules/checkAccess")); + +var _checkAlignment = _interopRequireDefault(require("./rules/checkAlignment")); + +var _checkExamples = _interopRequireDefault(require("./rules/checkExamples")); + +var _checkIndentation = _interopRequireDefault(require("./rules/checkIndentation")); + +var _checkLineAlignment = _interopRequireDefault(require("./rules/checkLineAlignment")); + +var _checkParamNames = _interopRequireDefault(require("./rules/checkParamNames")); + +var _checkPropertyNames = _interopRequireDefault(require("./rules/checkPropertyNames")); + +var _checkSyntax = _interopRequireDefault(require("./rules/checkSyntax")); + +var _checkTagNames = _interopRequireDefault(require("./rules/checkTagNames")); + +var _checkTypes = _interopRequireDefault(require("./rules/checkTypes")); + +var _checkValues = _interopRequireDefault(require("./rules/checkValues")); + +var _emptyTags = _interopRequireDefault(require("./rules/emptyTags")); + +var _implementsOnClasses = _interopRequireDefault(require("./rules/implementsOnClasses")); + +var _matchDescription = _interopRequireDefault(require("./rules/matchDescription")); + +var _matchName = _interopRequireDefault(require("./rules/matchName")); + +var _multilineBlocks = _interopRequireDefault(require("./rules/multilineBlocks")); + +var _newlineAfterDescription = _interopRequireDefault(require("./rules/newlineAfterDescription")); + +var _noBadBlocks = _interopRequireDefault(require("./rules/noBadBlocks")); + +var _noDefaults = _interopRequireDefault(require("./rules/noDefaults")); + +var _noMissingSyntax = _interopRequireDefault(require("./rules/noMissingSyntax")); + +var _noMultiAsterisks = _interopRequireDefault(require("./rules/noMultiAsterisks")); + +var _noRestrictedSyntax = _interopRequireDefault(require("./rules/noRestrictedSyntax")); + +var _noTypes = _interopRequireDefault(require("./rules/noTypes")); + +var _noUndefinedTypes = _interopRequireDefault(require("./rules/noUndefinedTypes")); + +var _requireAsteriskPrefix = _interopRequireDefault(require("./rules/requireAsteriskPrefix")); + +var _requireDescription = _interopRequireDefault(require("./rules/requireDescription")); + +var _requireDescriptionCompleteSentence = _interopRequireDefault(require("./rules/requireDescriptionCompleteSentence")); + +var _requireExample = _interopRequireDefault(require("./rules/requireExample")); + +var _requireFileOverview = _interopRequireDefault(require("./rules/requireFileOverview")); + +var _requireHyphenBeforeParamDescription = _interopRequireDefault(require("./rules/requireHyphenBeforeParamDescription")); + +var _requireJsdoc = _interopRequireDefault(require("./rules/requireJsdoc")); + +var _requireParam = _interopRequireDefault(require("./rules/requireParam")); + +var _requireParamDescription = _interopRequireDefault(require("./rules/requireParamDescription")); + +var _requireParamName = _interopRequireDefault(require("./rules/requireParamName")); + +var _requireParamType = _interopRequireDefault(require("./rules/requireParamType")); + +var _requireProperty = _interopRequireDefault(require("./rules/requireProperty")); + +var _requirePropertyDescription = _interopRequireDefault(require("./rules/requirePropertyDescription")); + +var _requirePropertyName = _interopRequireDefault(require("./rules/requirePropertyName")); + +var _requirePropertyType = _interopRequireDefault(require("./rules/requirePropertyType")); + +var _requireReturns = _interopRequireDefault(require("./rules/requireReturns")); + +var _requireReturnsCheck = _interopRequireDefault(require("./rules/requireReturnsCheck")); + +var _requireReturnsDescription = _interopRequireDefault(require("./rules/requireReturnsDescription")); + +var _requireReturnsType = _interopRequireDefault(require("./rules/requireReturnsType")); + +var _requireThrows = _interopRequireDefault(require("./rules/requireThrows")); + +var _requireYields = _interopRequireDefault(require("./rules/requireYields")); + +var _requireYieldsCheck = _interopRequireDefault(require("./rules/requireYieldsCheck")); + +var _tagLines = _interopRequireDefault(require("./rules/tagLines")); + +var _validTypes = _interopRequireDefault(require("./rules/validTypes")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = { + configs: { + recommended: { + plugins: ['jsdoc'], + rules: { + 'jsdoc/check-access': 'warn', + 'jsdoc/check-alignment': 'warn', + 'jsdoc/check-examples': 'off', + 'jsdoc/check-indentation': 'off', + 'jsdoc/check-line-alignment': 'off', + 'jsdoc/check-param-names': 'warn', + 'jsdoc/check-property-names': 'warn', + 'jsdoc/check-syntax': 'off', + 'jsdoc/check-tag-names': 'warn', + 'jsdoc/check-types': 'warn', + 'jsdoc/check-values': 'warn', + 'jsdoc/empty-tags': 'warn', + 'jsdoc/implements-on-classes': 'warn', + 'jsdoc/match-description': 'off', + 'jsdoc/match-name': 'off', + 'jsdoc/multiline-blocks': 'warn', + 'jsdoc/newline-after-description': 'warn', + 'jsdoc/no-bad-blocks': 'off', + 'jsdoc/no-defaults': 'off', + 'jsdoc/no-missing-syntax': 'off', + 'jsdoc/no-multi-asterisks': 'warn', + 'jsdoc/no-restricted-syntax': 'off', + 'jsdoc/no-types': 'off', + 'jsdoc/no-undefined-types': 'warn', + 'jsdoc/require-asterisk-prefix': 'off', + 'jsdoc/require-description': 'off', + 'jsdoc/require-description-complete-sentence': 'off', + 'jsdoc/require-example': 'off', + 'jsdoc/require-file-overview': 'off', + 'jsdoc/require-hyphen-before-param-description': 'off', + 'jsdoc/require-jsdoc': 'warn', + 'jsdoc/require-param': 'warn', + 'jsdoc/require-param-description': 'warn', + 'jsdoc/require-param-name': 'warn', + 'jsdoc/require-param-type': 'warn', + 'jsdoc/require-property': 'warn', + 'jsdoc/require-property-description': 'warn', + 'jsdoc/require-property-name': 'warn', + 'jsdoc/require-property-type': 'warn', + 'jsdoc/require-returns': 'warn', + 'jsdoc/require-returns-check': 'warn', + 'jsdoc/require-returns-description': 'warn', + 'jsdoc/require-returns-type': 'warn', + 'jsdoc/require-throws': 'off', + 'jsdoc/require-yields': 'warn', + 'jsdoc/require-yields-check': 'warn', + 'jsdoc/tag-lines': 'warn', + 'jsdoc/valid-types': 'warn' + } + } + }, + rules: { + 'check-access': _checkAccess.default, + 'check-alignment': _checkAlignment.default, + 'check-examples': _checkExamples.default, + 'check-indentation': _checkIndentation.default, + 'check-line-alignment': _checkLineAlignment.default, + 'check-param-names': _checkParamNames.default, + 'check-property-names': _checkPropertyNames.default, + 'check-syntax': _checkSyntax.default, + 'check-tag-names': _checkTagNames.default, + 'check-types': _checkTypes.default, + 'check-values': _checkValues.default, + 'empty-tags': _emptyTags.default, + 'implements-on-classes': _implementsOnClasses.default, + 'match-description': _matchDescription.default, + 'match-name': _matchName.default, + 'multiline-blocks': _multilineBlocks.default, + 'newline-after-description': _newlineAfterDescription.default, + 'no-bad-blocks': _noBadBlocks.default, + 'no-defaults': _noDefaults.default, + 'no-missing-syntax': _noMissingSyntax.default, + 'no-multi-asterisks': _noMultiAsterisks.default, + 'no-restricted-syntax': _noRestrictedSyntax.default, + 'no-types': _noTypes.default, + 'no-undefined-types': _noUndefinedTypes.default, + 'require-asterisk-prefix': _requireAsteriskPrefix.default, + 'require-description': _requireDescription.default, + 'require-description-complete-sentence': _requireDescriptionCompleteSentence.default, + 'require-example': _requireExample.default, + 'require-file-overview': _requireFileOverview.default, + 'require-hyphen-before-param-description': _requireHyphenBeforeParamDescription.default, + 'require-jsdoc': _requireJsdoc.default, + 'require-param': _requireParam.default, + 'require-param-description': _requireParamDescription.default, + 'require-param-name': _requireParamName.default, + 'require-param-type': _requireParamType.default, + 'require-property': _requireProperty.default, + 'require-property-description': _requirePropertyDescription.default, + 'require-property-name': _requirePropertyName.default, + 'require-property-type': _requirePropertyType.default, + 'require-returns': _requireReturns.default, + 'require-returns-check': _requireReturnsCheck.default, + 'require-returns-description': _requireReturnsDescription.default, + 'require-returns-type': _requireReturnsType.default, + 'require-throws': _requireThrows.default, + 'require-yields': _requireYields.default, + 'require-yields-check': _requireYieldsCheck.default, + 'tag-lines': _tagLines.default, + 'valid-types': _validTypes.default + } +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js new file mode 100644 index 00000000000000..ed30025436c685 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js @@ -0,0 +1,1125 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = iterateJsdoc; +exports.getSettings = void 0; +Object.defineProperty(exports, "parseComment", { + enumerable: true, + get: function () { + return _jsdoccomment.parseComment; + } +}); + +var _jsdoccomment = require("@es-joy/jsdoccomment"); + +var _commentParser = require("comment-parser"); + +var _jsdocUtils = _interopRequireDefault(require("./jsdocUtils")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* eslint-disable jsdoc/valid-types */ +const { + rewireSpecs, + seedTokens +} = _commentParser.util; +/* +const { + align as commentAlign, + flow: commentFlow, + indent: commentIndent, +} = transforms; +*/ + +const globalState = new Map(); + +const getBasicUtils = (context, { + tagNamePreference, + mode +}) => { + const utils = {}; + + utils.reportSettings = message => { + context.report({ + loc: { + start: { + column: 1, + line: 1 + } + }, + message + }); + }; + + utils.parseClosureTemplateTag = tag => { + return _jsdocUtils.default.parseClosureTemplateTag(tag); + }; + + utils.pathDoesNotBeginWith = _jsdocUtils.default.pathDoesNotBeginWith; + + utils.getPreferredTagNameObject = ({ + tagName + }) => { + const ret = _jsdocUtils.default.getPreferredTagName(context, mode, tagName, tagNamePreference); + + const isObject = ret && typeof ret === 'object'; + + if (ret === false || isObject && !ret.replacement) { + return { + blocked: true, + tagName + }; + } + + return ret; + }; + + return utils; +}; + +const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAll, ruleConfig, indent) => { + const ancestors = context.getAncestors(); + const sourceCode = context.getSourceCode(); + const utils = getBasicUtils(context, settings); + const { + tagNamePreference, + overrideReplacesDocs, + ignoreReplacesDocs, + implementsReplacesDocs, + augmentsExtendsReplacesDocs, + maxLines, + minLines, + mode + } = settings; + + utils.isIteratingFunction = () => { + return !iteratingAll || ['MethodDefinition', 'ArrowFunctionExpression', 'FunctionDeclaration', 'FunctionExpression'].includes(node && node.type); + }; + + utils.isVirtualFunction = () => { + return iteratingAll && utils.hasATag(['callback', 'function', 'func', 'method']); + }; + + utils.stringify = (tagBlock, specRewire) => { + return (0, _commentParser.stringify)(specRewire ? rewireSpecs(tagBlock) : tagBlock); + }; + + utils.reportJSDoc = (msg, tag, handler, specRewire, data) => { + report(msg, handler ? fixer => { + handler(); + const replacement = utils.stringify(jsdoc, specRewire); + return fixer.replaceText(jsdocNode, replacement); + } : null, tag, data); + }; + + utils.getRegexFromString = (str, requiredFlags) => { + return _jsdocUtils.default.getRegexFromString(str, requiredFlags); + }; + + utils.getTagDescription = tg => { + const descriptions = []; + tg.source.some(({ + tokens: { + end, + lineEnd, + postDelimiter, + tag, + postTag, + name, + type, + description + } + }) => { + const desc = (tag && postTag || !tag && !name && !type && postDelimiter || '' // Remove space + ).slice(1) + (description || '') + (lineEnd || ''); + + if (end) { + if (desc) { + descriptions.push(desc); + } + + return true; + } + + descriptions.push(desc); + return false; + }); + return descriptions.join('\n'); + }; + + utils.getDescription = () => { + const descriptions = []; + let lastDescriptionLine = 0; + jsdoc.source.some(({ + tokens: { + description, + tag, + end + } + }, idx) => { + if (idx && (tag || end)) { + lastDescriptionLine = idx - 1; + return true; + } + + if (idx || description) { + descriptions.push(description); + } + + return false; + }); + return { + description: descriptions.join('\n'), + lastDescriptionLine + }; + }; + + utils.changeTag = (tag, ...tokens) => { + for (const [idx, src] of tag.source.entries()) { + src.tokens = { ...src.tokens, + ...tokens[idx] + }; + } + }; + + utils.setTag = (tag, tokens) => { + tag.source = [{ + // Or tag.source[0].number? + number: tag.line, + tokens: seedTokens({ + delimiter: '*', + postDelimiter: ' ', + start: indent + ' ', + tag: '@' + tag.tag, + ...tokens + }) + }]; + }; + + utils.removeTag = idx => { + return utils.removeTagItem(idx); + }; + + utils.removeTagItem = (tagIndex, tagSourceOffset = 0) => { + const { + source: tagSource + } = jsdoc.tags[tagIndex]; + let lastIndex; + const firstNumber = jsdoc.source[0].number; + tagSource.some(({ + number + }, tagIdx) => { + const sourceIndex = jsdoc.source.findIndex(({ + number: srcNumber, + tokens: { + end + } + }) => { + return number === srcNumber && !end; + }); // istanbul ignore else + + if (sourceIndex > -1) { + let spliceCount = 1; + tagSource.slice(tagIdx + 1).some(({ + tokens: { + tag, + end + } + }) => { + if (!tag && !end) { + spliceCount++; + return false; + } + + return true; + }); + jsdoc.source.splice(sourceIndex + tagSourceOffset, spliceCount - tagSourceOffset); + tagSource.splice(tagIdx + tagSourceOffset, spliceCount - tagSourceOffset); + lastIndex = sourceIndex; + return true; + } // istanbul ignore next + + + return false; + }); + + for (const [idx, src] of jsdoc.source.slice(lastIndex).entries()) { + src.number = firstNumber + lastIndex + idx; + } + }; + + utils.addTag = targetTagName => { + var _jsdoc$tags$source$0$, _jsdoc$tags, _jsdoc$tags$source$; + + const number = ((_jsdoc$tags$source$0$ = (_jsdoc$tags = jsdoc.tags[jsdoc.tags.length - 1]) === null || _jsdoc$tags === void 0 ? void 0 : (_jsdoc$tags$source$ = _jsdoc$tags.source[0]) === null || _jsdoc$tags$source$ === void 0 ? void 0 : _jsdoc$tags$source$.number) !== null && _jsdoc$tags$source$0$ !== void 0 ? _jsdoc$tags$source$0$ : 0) + 1; + jsdoc.source.splice(number, 0, { + number, + source: '', + tokens: seedTokens({ + delimiter: '*', + postDelimiter: ' ', + start: indent + ' ', + tag: `@${targetTagName}` + }) + }); + + for (const src of jsdoc.source.slice(number + 1)) { + src.number++; + } + }; + + utils.seedTokens = seedTokens; + + utils.emptyTokens = tokens => { + for (const prop of ['start', 'postDelimiter', 'tag', 'type', 'postType', 'postTag', 'name', 'postName', 'description', 'end', 'lineEnd']) { + tokens[prop] = ''; + } + }; + + utils.addLine = (sourceIndex, tokens) => { + var _jsdoc$source; + + const number = (((_jsdoc$source = jsdoc.source[sourceIndex - 1]) === null || _jsdoc$source === void 0 ? void 0 : _jsdoc$source.number) || 0) + 1; + jsdoc.source.splice(sourceIndex, 0, { + number, + source: '', + tokens: seedTokens(tokens) + }); // If necessary, we can rewire the tags (misnamed method) + // rewireSource(jsdoc); + }; + + utils.addLines = (tagIndex, tagSourceOffset, numLines) => { + const { + source: tagSource + } = jsdoc.tags[tagIndex]; + let lastIndex; + const firstNumber = jsdoc.source[0].number; + tagSource.some(({ + number + }) => { + const makeLine = () => { + return { + number, + source: '', + tokens: seedTokens({ + delimiter: '*', + start: indent + ' ' + }) + }; + }; + + const makeLines = () => { + return Array.from({ + length: numLines + }, makeLine); + }; + + const sourceIndex = jsdoc.source.findIndex(({ + number: srcNumber, + tokens: { + end + } + }) => { + return number === srcNumber && !end; + }); // istanbul ignore else + + if (sourceIndex > -1) { + const lines = makeLines(); + jsdoc.source.splice(sourceIndex + tagSourceOffset, 0, ...lines); // tagSource.splice(tagIdx + 1, 0, ...makeLines()); + + lastIndex = sourceIndex; + return true; + } // istanbul ignore next + + + return false; + }); + + for (const [idx, src] of jsdoc.source.slice(lastIndex).entries()) { + src.number = firstNumber + lastIndex + idx; + } + }; + + utils.makeMultiline = () => { + const { + source: [{ + tokens + }] + } = jsdoc; + const { + postDelimiter, + description, + lineEnd, + tag, + name, + type + } = tokens; + let { + tokens: { + postName, + postTag, + postType + } + } = jsdoc.source[0]; // Strip trailing leftovers from single line ending + + if (!description) { + if (postName) { + postName = ''; + } else if (postType) { + postType = ''; // eslint-disable-next-line no-inline-comments + } else + /* istanbul ignore else -- `comment-parser` prevents empty blocks currently per https://github.com/syavorsky/comment-parser/issues/128 */ + if (postTag) { + postTag = ''; + } + } + + utils.emptyTokens(tokens); + utils.addLine(1, { + delimiter: '*', + // If a description were present, it may have whitespace attached + // due to being at the end of the single line + description: description.trimEnd(), + name, + postDelimiter, + postName, + postTag, + postType, + start: indent + ' ', + tag, + type + }); + utils.addLine(2, { + end: '*/', + lineEnd, + start: indent + ' ' + }); + }; + + utils.flattenRoots = params => { + return _jsdocUtils.default.flattenRoots(params); + }; + + utils.getFunctionParameterNames = useDefaultObjectProperties => { + return _jsdocUtils.default.getFunctionParameterNames(node, useDefaultObjectProperties); + }; + + utils.hasParams = () => { + return _jsdocUtils.default.hasParams(node); + }; + + utils.isGenerator = () => { + return node && (node.generator || node.type === 'MethodDefinition' && node.value.generator || ['ExportNamedDeclaration', 'ExportDefaultDeclaration'].includes(node.type) && node.declaration.generator); + }; + + utils.isConstructor = () => { + return _jsdocUtils.default.isConstructor(node); + }; + + utils.getJsdocTagsDeep = tagName => { + const name = utils.getPreferredTagName({ + tagName + }); + + if (!name) { + return false; + } + + return _jsdocUtils.default.getJsdocTagsDeep(jsdoc, name); + }; + + utils.getPreferredTagName = ({ + tagName, + skipReportingBlockedTag = false, + allowObjectReturn = false, + defaultMessage = `Unexpected tag \`@${tagName}\`` + }) => { + const ret = _jsdocUtils.default.getPreferredTagName(context, mode, tagName, tagNamePreference); + + const isObject = ret && typeof ret === 'object'; + + if (utils.hasTag(tagName) && (ret === false || isObject && !ret.replacement)) { + if (skipReportingBlockedTag) { + return { + blocked: true, + tagName + }; + } + + const message = isObject && ret.message || defaultMessage; + report(message, null, utils.getTags(tagName)[0]); + return false; + } + + return isObject && !allowObjectReturn ? ret.replacement : ret; + }; + + utils.isValidTag = (name, definedTags) => { + return _jsdocUtils.default.isValidTag(context, mode, name, definedTags); + }; + + utils.hasATag = names => { + return _jsdocUtils.default.hasATag(jsdoc, names); + }; + + utils.hasTag = name => { + return _jsdocUtils.default.hasTag(jsdoc, name); + }; + + utils.comparePaths = name => { + return _jsdocUtils.default.comparePaths(name); + }; + + utils.dropPathSegmentQuotes = name => { + return _jsdocUtils.default.dropPathSegmentQuotes(name); + }; + + utils.avoidDocs = () => { + var _context$options$0$ex, _context$options$; + + if (ignoreReplacesDocs !== false && (utils.hasTag('ignore') || utils.classHasTag('ignore')) || overrideReplacesDocs !== false && (utils.hasTag('override') || utils.classHasTag('override')) || implementsReplacesDocs !== false && (utils.hasTag('implements') || utils.classHasTag('implements')) || augmentsExtendsReplacesDocs && (utils.hasATag(['augments', 'extends']) || utils.classHasTag('augments') || utils.classHasTag('extends'))) { + return true; + } + + if (_jsdocUtils.default.exemptSpeciaMethods(jsdoc, node, context, ruleConfig.meta.schema)) { + return true; + } + + const exemptedBy = (_context$options$0$ex = (_context$options$ = context.options[0]) === null || _context$options$ === void 0 ? void 0 : _context$options$.exemptedBy) !== null && _context$options$0$ex !== void 0 ? _context$options$0$ex : ['inheritDoc', ...(mode === 'closure' ? [] : ['inheritdoc'])]; + + if (exemptedBy.length && utils.getPresentTags(exemptedBy).length) { + return true; + } + + return false; + }; + + for (const method of ['tagMightHaveNamePosition', 'tagMightHaveTypePosition']) { + utils[method] = (tagName, otherModeMaps) => { + const result = _jsdocUtils.default[method](tagName); + + if (result) { + return true; + } + + if (!otherModeMaps) { + return false; + } + + const otherResult = otherModeMaps.some(otherModeMap => { + return _jsdocUtils.default[method](tagName, otherModeMap); + }); + return otherResult ? { + otherMode: true + } : false; + }; + } + + for (const method of ['tagMustHaveNamePosition', 'tagMustHaveTypePosition', 'tagMissingRequiredTypeOrNamepath']) { + utils[method] = (tagName, otherModeMaps) => { + const result = _jsdocUtils.default[method](tagName); + + if (!result) { + return false; + } // if (!otherModeMaps) { return true; } + + + const otherResult = otherModeMaps.every(otherModeMap => { + return _jsdocUtils.default[method](tagName, otherModeMap); + }); + return otherResult ? true : { + otherMode: false + }; + }; + } + + for (const method of ['isNamepathDefiningTag', 'tagMightHaveNamepath']) { + utils[method] = tagName => { + return _jsdocUtils.default[method](tagName); + }; + } + + utils.getTagStructureForMode = mde => { + return _jsdocUtils.default.getTagStructureForMode(mde, settings.structuredTags); + }; + + utils.hasDefinedTypeTag = tag => { + return _jsdocUtils.default.hasDefinedTypeTag(tag); + }; + + utils.hasValueOrExecutorHasNonEmptyResolveValue = anyPromiseAsReturn => { + return _jsdocUtils.default.hasValueOrExecutorHasNonEmptyResolveValue(node, anyPromiseAsReturn); + }; + + utils.hasYieldValue = () => { + if (['ExportNamedDeclaration', 'ExportDefaultDeclaration'].includes(node.type)) { + return _jsdocUtils.default.hasYieldValue(node.declaration); + } + + return _jsdocUtils.default.hasYieldValue(node); + }; + + utils.hasYieldReturnValue = () => { + return _jsdocUtils.default.hasYieldValue(node, true); + }; + + utils.hasThrowValue = () => { + return _jsdocUtils.default.hasThrowValue(node); + }; + + utils.isAsync = () => { + return node.async; + }; + + utils.getTags = tagName => { + return utils.filterTags(item => { + return item.tag === tagName; + }); + }; + + utils.getPresentTags = tagList => { + return utils.filterTags(tag => { + return tagList.includes(tag.tag); + }); + }; + + utils.filterTags = filter => { + return _jsdocUtils.default.filterTags(jsdoc.tags, filter); + }; + + utils.getTagsByType = tags => { + return _jsdocUtils.default.getTagsByType(context, mode, tags, tagNamePreference); + }; + + utils.hasOptionTag = tagName => { + var _context$options$2; + + const { + tags + } = (_context$options$2 = context.options[0]) !== null && _context$options$2 !== void 0 ? _context$options$2 : {}; + return Boolean(tags && tags.includes(tagName)); + }; + + utils.getClassNode = () => { + return [...ancestors, node].reverse().find(parent => { + return parent && ['ClassDeclaration', 'ClassExpression'].includes(parent.type); + }) || null; + }; + + utils.getClassJsdoc = () => { + const classNode = utils.getClassNode(); + + if (!classNode) { + return null; + } + + const classJsdocNode = (0, _jsdoccomment.getJSDocComment)(sourceCode, classNode, { + maxLines, + minLines + }); + + if (classJsdocNode) { + const indnt = ' '.repeat(classJsdocNode.loc.start.column); + return (0, _jsdoccomment.parseComment)(classJsdocNode, indnt); + } + + return null; + }; + + utils.classHasTag = tagName => { + const classJsdoc = utils.getClassJsdoc(); + return Boolean(classJsdoc) && _jsdocUtils.default.hasTag(classJsdoc, tagName); + }; + + utils.forEachPreferredTag = (tagName, arrayHandler, skipReportingBlockedTag = false) => { + const targetTagName = utils.getPreferredTagName({ + skipReportingBlockedTag, + tagName + }); + + if (!targetTagName || skipReportingBlockedTag && targetTagName && typeof targetTagName === 'object') { + return; + } + + const matchingJsdocTags = jsdoc.tags.filter(({ + tag + }) => { + return tag === targetTagName; + }); + + for (const matchingJsdocTag of matchingJsdocTags) { + arrayHandler(matchingJsdocTag, targetTagName); + } + }; + + return utils; +}; + +const getSettings = context => { + var _context$settings$jsd, _context$settings$jsd2, _context$settings$jsd3, _context$settings$jsd4, _context$settings$jsd5, _context$settings$jsd6, _context$settings$jsd7, _context$settings$jsd8, _context$settings$jsd9, _context$settings$jsd10, _context$settings$jsd11, _context$settings$jsd12, _context$settings$jsd13, _context$settings$jsd14, _context$settings$jsd15, _context$settings$jsd16, _context$settings$jsd17, _context$settings$jsd18; + + /* eslint-disable canonical/sort-keys */ + const settings = { + // All rules + ignorePrivate: Boolean((_context$settings$jsd = context.settings.jsdoc) === null || _context$settings$jsd === void 0 ? void 0 : _context$settings$jsd.ignorePrivate), + ignoreInternal: Boolean((_context$settings$jsd2 = context.settings.jsdoc) === null || _context$settings$jsd2 === void 0 ? void 0 : _context$settings$jsd2.ignoreInternal), + maxLines: Number((_context$settings$jsd3 = (_context$settings$jsd4 = context.settings.jsdoc) === null || _context$settings$jsd4 === void 0 ? void 0 : _context$settings$jsd4.maxLines) !== null && _context$settings$jsd3 !== void 0 ? _context$settings$jsd3 : 1), + minLines: Number((_context$settings$jsd5 = (_context$settings$jsd6 = context.settings.jsdoc) === null || _context$settings$jsd6 === void 0 ? void 0 : _context$settings$jsd6.minLines) !== null && _context$settings$jsd5 !== void 0 ? _context$settings$jsd5 : 0), + // `check-tag-names` and many returns/param rules + tagNamePreference: (_context$settings$jsd7 = (_context$settings$jsd8 = context.settings.jsdoc) === null || _context$settings$jsd8 === void 0 ? void 0 : _context$settings$jsd8.tagNamePreference) !== null && _context$settings$jsd7 !== void 0 ? _context$settings$jsd7 : {}, + // `check-types` and `no-undefined-types` + preferredTypes: (_context$settings$jsd9 = (_context$settings$jsd10 = context.settings.jsdoc) === null || _context$settings$jsd10 === void 0 ? void 0 : _context$settings$jsd10.preferredTypes) !== null && _context$settings$jsd9 !== void 0 ? _context$settings$jsd9 : {}, + // `check-types`, `no-undefined-types`, `valid-types` + structuredTags: (_context$settings$jsd11 = (_context$settings$jsd12 = context.settings.jsdoc) === null || _context$settings$jsd12 === void 0 ? void 0 : _context$settings$jsd12.structuredTags) !== null && _context$settings$jsd11 !== void 0 ? _context$settings$jsd11 : {}, + // `require-param`, `require-description`, `require-example`, + // `require-returns`, `require-throw`, `require-yields` + overrideReplacesDocs: (_context$settings$jsd13 = context.settings.jsdoc) === null || _context$settings$jsd13 === void 0 ? void 0 : _context$settings$jsd13.overrideReplacesDocs, + ignoreReplacesDocs: (_context$settings$jsd14 = context.settings.jsdoc) === null || _context$settings$jsd14 === void 0 ? void 0 : _context$settings$jsd14.ignoreReplacesDocs, + implementsReplacesDocs: (_context$settings$jsd15 = context.settings.jsdoc) === null || _context$settings$jsd15 === void 0 ? void 0 : _context$settings$jsd15.implementsReplacesDocs, + augmentsExtendsReplacesDocs: (_context$settings$jsd16 = context.settings.jsdoc) === null || _context$settings$jsd16 === void 0 ? void 0 : _context$settings$jsd16.augmentsExtendsReplacesDocs, + // Many rules, e.g., `check-tag-names` + mode: (_context$settings$jsd17 = (_context$settings$jsd18 = context.settings.jsdoc) === null || _context$settings$jsd18 === void 0 ? void 0 : _context$settings$jsd18.mode) !== null && _context$settings$jsd17 !== void 0 ? _context$settings$jsd17 : context.parserPath.includes('@typescript-eslint') ? 'typescript' : 'jsdoc' + }; + /* eslint-enable canonical/sort-keys */ + + _jsdocUtils.default.setTagStructure(settings.mode); + + try { + _jsdocUtils.default.overrideTagStructure(settings.structuredTags); + } catch (error) { + context.report({ + loc: { + start: { + column: 1, + line: 1 + } + }, + message: error.message + }); + return false; + } + + return settings; +}; +/** + * Create the report function + * + * @param {object} context + * @param {object} commentNode + */ + + +exports.getSettings = getSettings; + +const makeReport = (context, commentNode) => { + const report = (message, fix = null, jsdocLoc = null, data = null) => { + let loc; + + if (jsdocLoc) { + if (!('line' in jsdocLoc)) { + jsdocLoc.line = jsdocLoc.source[0].number; + } + + const lineNumber = commentNode.loc.start.line + jsdocLoc.line; + loc = { + end: { + line: lineNumber + }, + start: { + line: lineNumber + } + }; // Todo: Remove ignore once `check-examples` can be restored for ESLint 8+ + // istanbul ignore if + + if (jsdocLoc.column) { + const colNumber = commentNode.loc.start.column + jsdocLoc.column; + loc.end.column = colNumber; + loc.start.column = colNumber; + } + } + + context.report({ + data, + fix, + loc, + message, + node: commentNode + }); + }; + + return report; +}; +/** + * @typedef {ReturnType} Utils + * @typedef {ReturnType} Settings + * @typedef {( + * arg: { + * context: object, + * sourceCode: object, + * indent: string, + * jsdoc: object, + * jsdocNode: object, + * node: object | null, + * report: ReturnType, + * settings: Settings, + * utils: Utils, + * } + * ) => any } JsdocVisitor + */ + + +const iterate = (info, indent, jsdoc, ruleConfig, context, lines, jsdocNode, node, settings, sourceCode, iterator, state, iteratingAll) => { + const report = makeReport(context, jsdocNode); + const utils = getUtils(node, jsdoc, jsdocNode, settings, report, context, iteratingAll, ruleConfig, indent); + + if (!ruleConfig.checkInternal && settings.ignoreInternal && utils.hasTag('internal')) { + return; + } + + if (!ruleConfig.checkPrivate && settings.ignorePrivate && (utils.hasTag('private') || jsdoc.tags.filter(({ + tag + }) => { + return tag === 'access'; + }).some(({ + description + }) => { + return description === 'private'; + }))) { + return; + } + + iterator({ + context, + globalState, + indent, + info, + iteratingAll, + jsdoc, + jsdocNode, + node, + report, + settings, + sourceCode, + state, + utils + }); +}; + +const getIndentAndJSDoc = function (lines, jsdocNode) { + const sourceLine = lines[jsdocNode.loc.start.line - 1]; + const indnt = sourceLine.charAt(0).repeat(jsdocNode.loc.start.column); + const jsdc = (0, _jsdoccomment.parseComment)(jsdocNode, indnt); + return [indnt, jsdc]; +}; +/** + * Create an eslint rule that iterates over all JSDocs, regardless of whether + * they are attached to a function-like node. + * + * @param {JsdocVisitor} iterator + * @param {{meta: any}} ruleConfig + * @param contexts + * @param {boolean} additiveContexts + */ + + +const iterateAllJsdocs = (iterator, ruleConfig, contexts, additiveContexts) => { + const trackedJsdocs = []; + let handler; + let settings; + + const callIterator = (context, node, jsdocNodes, state, lastCall) => { + const sourceCode = context.getSourceCode(); + const { + lines + } = sourceCode; + const utils = getBasicUtils(context, settings); + + for (const jsdocNode of jsdocNodes) { + if (!/^\/\*\*\s/u.test(sourceCode.getText(jsdocNode))) { + continue; + } + + const [indent, jsdoc] = getIndentAndJSDoc(lines, jsdocNode); + + if (additiveContexts) { + for (const [idx, { + comment + }] of contexts.entries()) { + if (comment && handler(comment, jsdoc) === false) { + continue; + } + + iterate({ + comment, + lastIndex: idx, + selector: node === null || node === void 0 ? void 0 : node.type + }, indent, jsdoc, ruleConfig, context, lines, jsdocNode, node, settings, sourceCode, iterator, state, true); + } + + continue; + } + + let lastComment; + let lastIndex; // eslint-disable-next-line no-loop-func + + if (contexts && contexts.every(({ + comment + }, idx) => { + lastComment = comment; + lastIndex = idx; + return comment && handler(comment, jsdoc) === false; + })) { + continue; + } + + iterate(lastComment ? { + comment: lastComment, + lastIndex, + selector: node === null || node === void 0 ? void 0 : node.type + } : { + lastIndex, + selector: node === null || node === void 0 ? void 0 : node.type + }, indent, jsdoc, ruleConfig, context, lines, jsdocNode, node, settings, sourceCode, iterator, state, true); + } + + if (lastCall && ruleConfig.exit) { + ruleConfig.exit({ + context, + state, + utils + }); + } + }; + + return { + create(context) { + const sourceCode = context.getSourceCode(); + settings = getSettings(context); + + if (!settings) { + return {}; + } + + if (contexts) { + handler = (0, _jsdoccomment.commentHandler)(settings); + } + + const state = {}; + return { + '*:not(Program)'(node) { + const reducedNode = (0, _jsdoccomment.getReducedASTNode)(node, sourceCode); + + if (node !== reducedNode) { + return; + } + + const commentNode = (0, _jsdoccomment.getJSDocComment)(sourceCode, node, settings); + + if (trackedJsdocs.includes(commentNode)) { + return; + } + + if (!commentNode) { + if (ruleConfig.nonComment) { + ruleConfig.nonComment({ + node, + state + }); + } + + return; + } + + trackedJsdocs.push(commentNode); + callIterator(context, node, [commentNode], state); + }, + + 'Program:exit'() { + const allComments = sourceCode.getAllComments(); + const untrackedJSdoc = allComments.filter(node => { + return !trackedJsdocs.includes(node); + }); + callIterator(context, null, untrackedJSdoc, state, true); + } + + }; + }, + + meta: ruleConfig.meta + }; +}; +/** + * Create an eslint rule that iterates over all JSDocs, regardless of whether + * they are attached to a function-like node. + * + * @param {JsdocVisitor} iterator + * @param {{meta: any}} ruleConfig + */ + + +const checkFile = (iterator, ruleConfig) => { + return { + create(context) { + const sourceCode = context.getSourceCode(); + const settings = getSettings(context); + + if (!settings) { + return {}; + } + + return { + 'Program:exit'() { + const allComments = sourceCode.getAllComments(); + const { + lines + } = sourceCode; + const utils = getBasicUtils(context, settings); + iterator({ + allComments, + context, + lines, + makeReport, + settings, + sourceCode, + utils + }); + } + + }; + }, + + meta: ruleConfig.meta + }; +}; + +/** + * @param {JsdocVisitor} iterator + * @param {{ + * meta: any, + * contextDefaults?: true | string[], + * contextSelected?: true, + * iterateAllJsdocs?: true, + * }} ruleConfig + */ +function iterateJsdoc(iterator, ruleConfig) { + var _ruleConfig$meta; + + const metaType = ruleConfig === null || ruleConfig === void 0 ? void 0 : (_ruleConfig$meta = ruleConfig.meta) === null || _ruleConfig$meta === void 0 ? void 0 : _ruleConfig$meta.type; + + if (!metaType || !['problem', 'suggestion', 'layout'].includes(metaType)) { + throw new TypeError('Rule must include `meta.type` option (with value "problem", "suggestion", or "layout")'); + } + + if (typeof iterator !== 'function') { + throw new TypeError('The iterator argument must be a function.'); + } + + if (ruleConfig.checkFile) { + return checkFile(iterator, ruleConfig); + } + + if (ruleConfig.iterateAllJsdocs) { + return iterateAllJsdocs(iterator, ruleConfig); + } + + return { + /** + * The entrypoint for the JSDoc rule. + * + * @param {*} context + * a reference to the context which hold all important information + * like settings and the sourcecode to check. + * @returns {object} + * a list with parser callback function. + */ + create(context) { + const settings = getSettings(context); + + if (!settings) { + return {}; + } + + let contexts; + + if (ruleConfig.contextDefaults || ruleConfig.contextSelected || ruleConfig.matchContext) { + var _context$options$3, _contexts, _contexts2; + + contexts = ruleConfig.matchContext && (_context$options$3 = context.options[0]) !== null && _context$options$3 !== void 0 && _context$options$3.match ? context.options[0].match : _jsdocUtils.default.enforcedContexts(context, ruleConfig.contextDefaults); + + if (contexts) { + contexts = contexts.map(obj => { + if (typeof obj === 'object' && !obj.context) { + return { ...obj, + context: 'any' + }; + } + + return obj; + }); + } + + const hasPlainAny = (_contexts = contexts) === null || _contexts === void 0 ? void 0 : _contexts.includes('any'); + const hasObjectAny = !hasPlainAny && ((_contexts2 = contexts) === null || _contexts2 === void 0 ? void 0 : _contexts2.find(ctxt => { + return (ctxt === null || ctxt === void 0 ? void 0 : ctxt.context) === 'any'; + })); + + if (hasPlainAny || hasObjectAny) { + return iterateAllJsdocs(iterator, ruleConfig, hasObjectAny ? contexts : null, ruleConfig.matchContext).create(context); + } + } + + const sourceCode = context.getSourceCode(); + const { + lines + } = sourceCode; + const state = {}; + + const checkJsdoc = (info, handler, node) => { + const jsdocNode = (0, _jsdoccomment.getJSDocComment)(sourceCode, node, settings); + + if (!jsdocNode) { + return; + } + + const [indent, jsdoc] = getIndentAndJSDoc(lines, jsdocNode); + + if ( // Note, `handler` should already be bound in its first argument + // with these only to be called after the value of + // `comment` + handler && handler(jsdoc) === false) { + return; + } + + iterate(info, indent, jsdoc, ruleConfig, context, lines, jsdocNode, node, settings, sourceCode, iterator, state); + }; + + let contextObject = {}; + + if (contexts && (ruleConfig.contextDefaults || ruleConfig.contextSelected || ruleConfig.matchContext)) { + contextObject = _jsdocUtils.default.getContextObject(contexts, checkJsdoc, (0, _jsdoccomment.commentHandler)(settings)); + } else { + for (const prop of ['ArrowFunctionExpression', 'FunctionDeclaration', 'FunctionExpression']) { + contextObject[prop] = checkJsdoc.bind(null, { + selector: prop + }, null); + } + } + + if (ruleConfig.exit) { + contextObject['Program:exit'] = () => { + ruleConfig.exit({ + context, + state + }); + }; + } + + return contextObject; + }, + + meta: ruleConfig.meta + }; +} +//# sourceMappingURL=iterateJsdoc.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/jsdocUtils.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/jsdocUtils.js new file mode 100644 index 00000000000000..6e2713d409cc06 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/jsdocUtils.js @@ -0,0 +1,1350 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _WarnSettings = _interopRequireDefault(require("./WarnSettings")); + +var _getDefaultTagStructureForMode = _interopRequireDefault(require("./getDefaultTagStructureForMode")); + +var _tagNames = require("./tagNames"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* eslint-disable jsdoc/no-undefined-types */ +let tagStructure; + +const setTagStructure = mode => { + tagStructure = (0, _getDefaultTagStructureForMode.default)(mode); +}; // Given a nested array of property names, reduce them to a single array, +// appending the name of the root element along the way if present. + + +const flattenRoots = (params, root = '') => { + let hasRestElement = false; + let hasPropertyRest = false; + const rests = []; + const names = params.reduce((acc, cur) => { + if (Array.isArray(cur)) { + let nms; + + if (Array.isArray(cur[1])) { + nms = cur[1]; + } else { + if (cur[1].hasRestElement) { + hasRestElement = true; + } + + if (cur[1].hasPropertyRest) { + hasPropertyRest = true; + } + + nms = cur[1].names; + } + + const flattened = flattenRoots(nms, root ? `${root}.${cur[0]}` : cur[0]); + + if (flattened.hasRestElement) { + hasRestElement = true; + } + + if (flattened.hasPropertyRest) { + hasPropertyRest = true; + } + + const inner = [root ? `${root}.${cur[0]}` : cur[0], ...flattened.names].filter(Boolean); + rests.push(false, ...flattened.rests); + return acc.concat(inner); + } + + if (typeof cur === 'object') { + if (cur.isRestProperty) { + hasPropertyRest = true; + rests.push(true); + } else { + rests.push(false); + } + + if (cur.restElement) { + hasRestElement = true; + } + + acc.push(root ? `${root}.${cur.name}` : cur.name); + } else if (typeof cur !== 'undefined') { + rests.push(false); + acc.push(root ? `${root}.${cur}` : cur); + } + + return acc; + }, []); + return { + hasPropertyRest, + hasRestElement, + names, + rests + }; +}; + +const getPropertiesFromPropertySignature = propSignature => { + if (propSignature.type === 'TSIndexSignature' || propSignature.type === 'TSConstructSignatureDeclaration' || propSignature.type === 'TSCallSignatureDeclaration') { + return undefined; + } + + if (propSignature.typeAnnotation && propSignature.typeAnnotation.typeAnnotation.type === 'TSTypeLiteral') { + return [propSignature.key.name, propSignature.typeAnnotation.typeAnnotation.members.map(member => { + return getPropertiesFromPropertySignature(member); + })]; + } + + return propSignature.key.name; +}; + +const getFunctionParameterNames = (functionNode, checkDefaultObjects) => { + // eslint-disable-next-line complexity + const getParamName = (param, isProperty) => { + var _param$left, _param$left3; + + const hasLeftTypeAnnotation = 'left' in param && 'typeAnnotation' in param.left; + + if ('typeAnnotation' in param || hasLeftTypeAnnotation) { + const typeAnnotation = hasLeftTypeAnnotation ? param.left.typeAnnotation : param.typeAnnotation; + + if (typeAnnotation.typeAnnotation.type === 'TSTypeLiteral') { + const propertyNames = typeAnnotation.typeAnnotation.members.map(member => { + return getPropertiesFromPropertySignature(member); + }); + const flattened = { ...flattenRoots(propertyNames), + annotationParamName: param.name + }; + const hasLeftName = 'left' in param && 'name' in param.left; + + if ('name' in param || hasLeftName) { + return [hasLeftName ? param.left.name : param.name, flattened]; + } + + return [undefined, flattened]; + } + } + + if ('name' in param) { + return param.name; + } + + if ('left' in param && 'name' in param.left) { + return param.left.name; + } + + if (param.type === 'ObjectPattern' || ((_param$left = param.left) === null || _param$left === void 0 ? void 0 : _param$left.type) === 'ObjectPattern') { + var _param$left2; + + const properties = param.properties || ((_param$left2 = param.left) === null || _param$left2 === void 0 ? void 0 : _param$left2.properties); + const roots = properties.map(prop => { + return getParamName(prop, true); + }); + return [undefined, flattenRoots(roots)]; + } + + if (param.type === 'Property') { + // eslint-disable-next-line default-case + switch (param.value.type) { + case 'ArrayPattern': + return [param.key.name, param.value.elements.map((prop, idx) => { + return { + name: idx, + restElement: prop.type === 'RestElement' + }; + })]; + + case 'ObjectPattern': + return [param.key.name, param.value.properties.map(prop => { + return getParamName(prop, isProperty); + })]; + + case 'AssignmentPattern': + { + // eslint-disable-next-line default-case + switch (param.value.left.type) { + case 'Identifier': + // Default parameter + if (checkDefaultObjects && param.value.right.type === 'ObjectExpression') { + return [param.key.name, param.value.right.properties.map(prop => { + return getParamName(prop, isProperty); + })]; + } + + break; + + case 'ObjectPattern': + return [param.key.name, param.value.left.properties.map(prop => { + return getParamName(prop, isProperty); + })]; + + case 'ArrayPattern': + return [param.key.name, param.value.left.elements.map((prop, idx) => { + return { + name: idx, + restElement: prop.type === 'RestElement' + }; + })]; + } + } + } + + switch (param.key.type) { + case 'Identifier': + return param.key.name; + // The key of an object could also be a string or number + + case 'Literal': + return param.key.raw || // istanbul ignore next -- `raw` may not be present in all parsers + param.key.value; + // case 'MemberExpression': + + default: + // Todo: We should really create a structure (and a corresponding + // option analogous to `checkRestProperty`) which allows for + // (and optionally requires) dynamic properties to have a single + // line of documentation + return undefined; + } + } + + if (param.type === 'ArrayPattern' || ((_param$left3 = param.left) === null || _param$left3 === void 0 ? void 0 : _param$left3.type) === 'ArrayPattern') { + var _param$left4; + + const elements = param.elements || ((_param$left4 = param.left) === null || _param$left4 === void 0 ? void 0 : _param$left4.elements); + const roots = elements.map((prop, idx) => { + return { + name: `"${idx}"`, + restElement: (prop === null || prop === void 0 ? void 0 : prop.type) === 'RestElement' + }; + }); + return [undefined, flattenRoots(roots)]; + } + + if (['RestElement', 'ExperimentalRestProperty'].includes(param.type)) { + return { + isRestProperty: isProperty, + name: param.argument.name, + restElement: true + }; + } + + if (param.type === 'TSParameterProperty') { + return getParamName(param.parameter, true); + } + + throw new Error(`Unsupported function signature format: \`${param.type}\`.`); + }; + + return (functionNode.params || functionNode.value.params).map(param => { + return getParamName(param); + }); +}; + +const hasParams = functionNode => { + // Should also check `functionNode.value.params` if supporting `MethodDefinition` + return functionNode.params.length; +}; +/** + * Gets all names of the target type, including those that refer to a path, e.g. + * "@param foo; @param foo.bar". + */ + + +const getJsdocTagsDeep = (jsdoc, targetTagName) => { + const ret = []; + + for (const [idx, { + name, + tag, + type + }] of jsdoc.tags.entries()) { + if (tag !== targetTagName) { + continue; + } + + ret.push({ + idx, + name, + type + }); + } + + return ret; +}; + +const modeWarnSettings = (0, _WarnSettings.default)(); + +const getTagNamesForMode = (mode, context) => { + switch (mode) { + case 'jsdoc': + return _tagNames.jsdocTags; + + case 'typescript': + return _tagNames.typeScriptTags; + + case 'closure': + case 'permissive': + return _tagNames.closureTags; + + default: + if (!modeWarnSettings.hasBeenWarned(context, 'mode')) { + context.report({ + loc: { + start: { + column: 1, + line: 1 + } + }, + message: `Unrecognized value \`${mode}\` for \`settings.jsdoc.mode\`.` + }); + modeWarnSettings.markSettingAsWarned(context, 'mode'); + } // We'll avoid breaking too many other rules + + + return _tagNames.jsdocTags; + } +}; + +const getPreferredTagName = (context, mode, name, tagPreference = {}) => { + var _Object$entries$find; + + const prefValues = Object.values(tagPreference); + + if (prefValues.includes(name) || prefValues.some(prefVal => { + return prefVal && typeof prefVal === 'object' && prefVal.replacement === name; + })) { + return name; + } // Allow keys to have a 'tag ' prefix to avoid upstream bug in ESLint + // that disallows keys that conflict with Object.prototype, + // e.g. 'tag constructor' for 'constructor': + // https://github.com/eslint/eslint/issues/13289 + // https://github.com/gajus/eslint-plugin-jsdoc/issues/537 + + + const tagPreferenceFixed = Object.fromEntries(Object.entries(tagPreference).map(([key, value]) => { + return [key.replace(/^tag /u, ''), value]; + })); + + if (name in tagPreferenceFixed) { + return tagPreferenceFixed[name]; + } + + const tagNames = getTagNamesForMode(mode, context); + const preferredTagName = (_Object$entries$find = Object.entries(tagNames).find(([, aliases]) => { + return aliases.includes(name); + })) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0]; + + if (preferredTagName) { + return preferredTagName; + } + + return name; +}; + +const isValidTag = (context, mode, name, definedTags) => { + const tagNames = getTagNamesForMode(mode, context); + const validTagNames = Object.keys(tagNames).concat(Object.values(tagNames).flat()); + const additionalTags = definedTags; + const allTags = validTagNames.concat(additionalTags); + return allTags.includes(name); +}; + +const hasTag = (jsdoc, targetTagName) => { + const targetTagLower = targetTagName.toLowerCase(); + return jsdoc.tags.some(doc => { + return doc.tag.toLowerCase() === targetTagLower; + }); +}; + +const hasATag = (jsdoc, targetTagNames) => { + return targetTagNames.some(targetTagName => { + return hasTag(jsdoc, targetTagName); + }); +}; +/** + * Checks if the JSDoc comment declares a defined type. + * + * @param {JsDocTag} tag + * the tag which should be checked. + * @returns {boolean} + * true in case a defined type is declared; otherwise false. + */ + + +const hasDefinedTypeTag = tag => { + // The function should not continue in the event the type is not defined... + if (typeof tag === 'undefined' || tag === null) { + return false; + } // .. same applies if it declares an `{undefined}` or `{void}` type + + + const tagType = tag.type.trim(); + + if (tagType === 'undefined' || tagType === 'void') { + return false; + } // In any other case, a type is present + + + return true; +}; + +const ensureMap = (map, tag) => { + if (!map.has(tag)) { + map.set(tag, new Map()); + } + + return map.get(tag); +}; + +const overrideTagStructure = (structuredTags, tagMap = tagStructure) => { + for (const [tag, { + name, + type, + required = [] + }] of Object.entries(structuredTags)) { + const tagStruct = ensureMap(tagMap, tag); + tagStruct.set('nameContents', name); + tagStruct.set('typeAllowed', type); + const requiredName = required.includes('name'); + + if (requiredName && name === false) { + throw new Error('Cannot add "name" to `require` with the tag\'s `name` set to `false`'); + } + + tagStruct.set('nameRequired', requiredName); + const requiredType = required.includes('type'); + + if (requiredType && type === false) { + throw new Error('Cannot add "type" to `require` with the tag\'s `type` set to `false`'); + } + + tagStruct.set('typeRequired', requiredType); + const typeOrNameRequired = required.includes('typeOrNameRequired'); + + if (typeOrNameRequired && name === false) { + throw new Error('Cannot add "typeOrNameRequired" to `require` with the tag\'s `name` set to `false`'); + } + + if (typeOrNameRequired && type === false) { + throw new Error('Cannot add "typeOrNameRequired" to `require` with the tag\'s `type` set to `false`'); + } + + tagStruct.set('typeOrNameRequired', typeOrNameRequired); + } +}; + +const getTagStructureForMode = (mode, structuredTags) => { + const tagStruct = (0, _getDefaultTagStructureForMode.default)(mode); + + try { + overrideTagStructure(structuredTags, tagStruct); + } catch {// + } + + return tagStruct; +}; + +const isNamepathDefiningTag = (tag, tagMap = tagStructure) => { + const tagStruct = ensureMap(tagMap, tag); + return tagStruct.get('nameContents') === 'namepath-defining'; +}; + +const tagMustHaveTypePosition = (tag, tagMap = tagStructure) => { + const tagStruct = ensureMap(tagMap, tag); + return tagStruct.get('typeRequired'); +}; + +const tagMightHaveTypePosition = (tag, tagMap = tagStructure) => { + if (tagMustHaveTypePosition(tag, tagMap)) { + return true; + } + + const tagStruct = ensureMap(tagMap, tag); + const ret = tagStruct.get('typeAllowed'); + return ret === undefined ? true : ret; +}; + +const namepathTypes = new Set(['namepath-defining', 'namepath-referencing']); + +const tagMightHaveNamePosition = (tag, tagMap = tagStructure) => { + const tagStruct = ensureMap(tagMap, tag); + const ret = tagStruct.get('nameContents'); + return ret === undefined ? true : Boolean(ret); +}; + +const tagMightHaveNamepath = (tag, tagMap = tagStructure) => { + const tagStruct = ensureMap(tagMap, tag); + return namepathTypes.has(tagStruct.get('nameContents')); +}; + +const tagMustHaveNamePosition = (tag, tagMap = tagStructure) => { + const tagStruct = ensureMap(tagMap, tag); + return tagStruct.get('nameRequired'); +}; + +const tagMightHaveEitherTypeOrNamePosition = (tag, tagMap) => { + return tagMightHaveTypePosition(tag, tagMap) || tagMightHaveNamepath(tag, tagMap); +}; + +const tagMustHaveEitherTypeOrNamePosition = (tag, tagMap) => { + const tagStruct = ensureMap(tagMap, tag); + return tagStruct.get('typeOrNameRequired'); +}; + +const tagMissingRequiredTypeOrNamepath = (tag, tagMap = tagStructure) => { + const mustHaveTypePosition = tagMustHaveTypePosition(tag.tag, tagMap); + const mightHaveTypePosition = tagMightHaveTypePosition(tag.tag, tagMap); + const hasTypePosition = mightHaveTypePosition && Boolean(tag.type); + const hasNameOrNamepathPosition = (tagMustHaveNamePosition(tag.tag, tagMap) || tagMightHaveNamepath(tag.tag, tagMap)) && Boolean(tag.name); + const mustHaveEither = tagMustHaveEitherTypeOrNamePosition(tag.tag, tagMap); + const hasEither = tagMightHaveEitherTypeOrNamePosition(tag.tag, tagMap) && (hasTypePosition || hasNameOrNamepathPosition); + return mustHaveEither && !hasEither && !mustHaveTypePosition; +}; +/** + * Checks if a node is a promise but has no resolve value or an empty value. + * An `undefined` resolve does not count. + * + * @param {object} node + * @returns {boolean} + */ + + +const isNewPromiseExpression = node => { + return node.type === 'NewExpression' && node.callee.type === 'Identifier' && node.callee.name === 'Promise'; +}; +/** + * @callback PromiseFilter + * @param {object} node + * @returns {boolean} + */ + +/** + * Checks if a node has a return statement. Void return does not count. + * + * @param {object} node + * @param {PromiseFilter} promFilter + * @returns {boolean|Node} + */ +// eslint-disable-next-line complexity + + +const hasReturnValue = (node, promFilter) => { + var _node$returnType, _node$returnType$type; + + if (!node) { + return false; + } + + switch (node.type) { + case 'TSFunctionType': + case 'TSMethodSignature': + return !['TSVoidKeyword', 'TSUndefinedKeyword'].includes(node === null || node === void 0 ? void 0 : (_node$returnType = node.returnType) === null || _node$returnType === void 0 ? void 0 : (_node$returnType$type = _node$returnType.typeAnnotation) === null || _node$returnType$type === void 0 ? void 0 : _node$returnType$type.type); + + case 'MethodDefinition': + return hasReturnValue(node.value, promFilter); + + case 'FunctionExpression': + case 'FunctionDeclaration': + case 'ArrowFunctionExpression': + { + return node.expression || hasReturnValue(node.body, promFilter); + } + + case 'BlockStatement': + { + return node.body.some(bodyNode => { + return bodyNode.type !== 'FunctionDeclaration' && hasReturnValue(bodyNode, promFilter); + }); + } + + case 'LabeledStatement': + case 'WhileStatement': + case 'DoWhileStatement': + case 'ForStatement': + case 'ForInStatement': + case 'ForOfStatement': + case 'WithStatement': + { + return hasReturnValue(node.body, promFilter); + } + + case 'IfStatement': + { + return hasReturnValue(node.consequent, promFilter) || hasReturnValue(node.alternate, promFilter); + } + + case 'TryStatement': + { + return hasReturnValue(node.block, promFilter) || hasReturnValue(node.handler && node.handler.body, promFilter) || hasReturnValue(node.finalizer, promFilter); + } + + case 'SwitchStatement': + { + return node.cases.some(someCase => { + return someCase.consequent.some(nde => { + return hasReturnValue(nde, promFilter); + }); + }); + } + + case 'ReturnStatement': + { + // void return does not count. + if (node.argument === null) { + return false; + } + + if (promFilter && isNewPromiseExpression(node.argument)) { + // Let caller decide how to filter, but this is, at the least, + // a return of sorts and truthy + return promFilter(node.argument); + } + + return true; + } + + default: + { + return false; + } + } +}; +/** + * Avoids further checking child nodes if a nested function shadows the + * resolver, but otherwise, if name is used (by call or passed in as an + * argument to another function), will be considered as non-empty. + * + * This could check for redeclaration of the resolver, but as such is + * unlikely, we avoid the performance cost of checking everywhere for + * (re)declarations or assignments. + * + * @param {AST} node + * @param {string} resolverName + * @returns {boolean} + */ +// eslint-disable-next-line complexity + + +const hasNonEmptyResolverCall = (node, resolverName) => { + if (!node) { + return false; + } // Arrow function without block + + + switch (node.type) { + // istanbul ignore next -- In Babel? + case 'OptionalCallExpression': + case 'CallExpression': + return node.callee.name === resolverName && ( // Implicit or explicit undefined + node.arguments.length > 1 || node.arguments[0] !== undefined) || node.arguments.some(nde => { + // Being passed in to another function (which might invoke it) + return nde.type === 'Identifier' && nde.name === resolverName || // Handle nested items + hasNonEmptyResolverCall(nde, resolverName); + }); + + case 'ChainExpression': + case 'Decorator': + case 'ExpressionStatement': + return hasNonEmptyResolverCall(node.expression, resolverName); + + case 'ClassBody': + case 'BlockStatement': + return node.body.some(bodyNode => { + return hasNonEmptyResolverCall(bodyNode, resolverName); + }); + + case 'FunctionExpression': + case 'FunctionDeclaration': + case 'ArrowFunctionExpression': + { + var _node$params$; + + // Shadowing + if (((_node$params$ = node.params[0]) === null || _node$params$ === void 0 ? void 0 : _node$params$.name) === resolverName) { + return false; + } + + return hasNonEmptyResolverCall(node.body, resolverName); + } + + case 'LabeledStatement': + case 'WhileStatement': + case 'DoWhileStatement': + case 'ForStatement': + case 'ForInStatement': + case 'ForOfStatement': + case 'WithStatement': + { + return hasNonEmptyResolverCall(node.body, resolverName); + } + + case 'ConditionalExpression': + case 'IfStatement': + { + return hasNonEmptyResolverCall(node.test, resolverName) || hasNonEmptyResolverCall(node.consequent, resolverName) || hasNonEmptyResolverCall(node.alternate, resolverName); + } + + case 'TryStatement': + { + return hasNonEmptyResolverCall(node.block, resolverName) || hasNonEmptyResolverCall(node.handler && node.handler.body, resolverName) || hasNonEmptyResolverCall(node.finalizer, resolverName); + } + + case 'SwitchStatement': + { + return node.cases.some(someCase => { + return someCase.consequent.some(nde => { + return hasNonEmptyResolverCall(nde, resolverName); + }); + }); + } + + case 'ArrayPattern': + case 'ArrayExpression': + return node.elements.some(element => { + return hasNonEmptyResolverCall(element, resolverName); + }); + + case 'AssignmentPattern': + return hasNonEmptyResolverCall(node.right, resolverName); + + case 'AssignmentExpression': + case 'BinaryExpression': + case 'LogicalExpression': + { + return hasNonEmptyResolverCall(node.left, resolverName) || hasNonEmptyResolverCall(node.right, resolverName); + } + // Comma + + case 'SequenceExpression': + case 'TemplateLiteral': + return node.expressions.some(subExpression => { + return hasNonEmptyResolverCall(subExpression, resolverName); + }); + + case 'ObjectPattern': + case 'ObjectExpression': + return node.properties.some(property => { + return hasNonEmptyResolverCall(property, resolverName); + }); + // istanbul ignore next -- In Babel? + + case 'ClassMethod': + case 'MethodDefinition': + return node.decorators && node.decorators.some(decorator => { + return hasNonEmptyResolverCall(decorator, resolverName); + }) || node.computed && hasNonEmptyResolverCall(node.key, resolverName) || hasNonEmptyResolverCall(node.value, resolverName); + // istanbul ignore next -- In Babel? + + case 'ObjectProperty': + /* eslint-disable no-fallthrough */ + // istanbul ignore next -- In Babel? + + case 'PropertyDefinition': // istanbul ignore next -- In Babel? + + case 'ClassProperty': + /* eslint-enable no-fallthrough */ + + case 'Property': + return node.computed && hasNonEmptyResolverCall(node.key, resolverName) || hasNonEmptyResolverCall(node.value, resolverName); + // istanbul ignore next -- In Babel? + + case 'ObjectMethod': + // istanbul ignore next -- In Babel? + return node.computed && hasNonEmptyResolverCall(node.key, resolverName) || node.arguments.some(nde => { + return hasNonEmptyResolverCall(nde, resolverName); + }); + + case 'ClassExpression': + case 'ClassDeclaration': + return hasNonEmptyResolverCall(node.body, resolverName); + + case 'AwaitExpression': + case 'SpreadElement': + case 'UnaryExpression': + case 'YieldExpression': + return hasNonEmptyResolverCall(node.argument, resolverName); + + case 'VariableDeclaration': + { + return node.declarations.some(nde => { + return hasNonEmptyResolverCall(nde, resolverName); + }); + } + + case 'VariableDeclarator': + { + return hasNonEmptyResolverCall(node.id, resolverName) || hasNonEmptyResolverCall(node.init, resolverName); + } + + case 'TaggedTemplateExpression': + return hasNonEmptyResolverCall(node.quasi, resolverName); + // ?. + // istanbul ignore next -- In Babel? + + case 'OptionalMemberExpression': + case 'MemberExpression': + return hasNonEmptyResolverCall(node.object, resolverName) || hasNonEmptyResolverCall(node.property, resolverName); + // istanbul ignore next -- In Babel? + + case 'Import': + case 'ImportExpression': + return hasNonEmptyResolverCall(node.source, resolverName); + + case 'ReturnStatement': + { + if (node.argument === null) { + return false; + } + + return hasNonEmptyResolverCall(node.argument, resolverName); + } + + /* + // Shouldn't need to parse literals/literal components, etc. + case 'Identifier': + case 'TemplateElement': + case 'Super': + // Exports not relevant in this context + */ + + default: + return false; + } +}; +/** + * Checks if a Promise executor has no resolve value or an empty value. + * An `undefined` resolve does not count. + * + * @param {object} node + * @param {boolean} anyPromiseAsReturn + * @returns {boolean} + */ + + +const hasValueOrExecutorHasNonEmptyResolveValue = (node, anyPromiseAsReturn) => { + return hasReturnValue(node, prom => { + if (anyPromiseAsReturn) { + return true; + } + + const [{ + params, + body + } = {}] = prom.arguments; + + if (!(params !== null && params !== void 0 && params.length)) { + return false; + } + + const [{ + name: resolverName + }] = params; + return hasNonEmptyResolverCall(body, resolverName); + }); +}; // eslint-disable-next-line complexity + + +const hasNonFunctionYield = (node, checkYieldReturnValue) => { + if (!node) { + return false; + } + + switch (node.type) { + case 'BlockStatement': + { + return node.body.some(bodyNode => { + return !['ArrowFunctionExpression', 'FunctionDeclaration', 'FunctionExpression'].includes(bodyNode.type) && hasNonFunctionYield(bodyNode, checkYieldReturnValue); + }); + } + // istanbul ignore next -- In Babel? + + case 'OptionalCallExpression': + case 'CallExpression': + return node.arguments.some(element => { + return hasNonFunctionYield(element, checkYieldReturnValue); + }); + + case 'ChainExpression': + case 'ExpressionStatement': + { + return hasNonFunctionYield(node.expression, checkYieldReturnValue); + } + + case 'LabeledStatement': + case 'WhileStatement': + case 'DoWhileStatement': + case 'ForStatement': + case 'ForInStatement': + case 'ForOfStatement': + case 'WithStatement': + { + return hasNonFunctionYield(node.body, checkYieldReturnValue); + } + + case 'ConditionalExpression': + case 'IfStatement': + { + return hasNonFunctionYield(node.test, checkYieldReturnValue) || hasNonFunctionYield(node.consequent, checkYieldReturnValue) || hasNonFunctionYield(node.alternate, checkYieldReturnValue); + } + + case 'TryStatement': + { + return hasNonFunctionYield(node.block, checkYieldReturnValue) || hasNonFunctionYield(node.handler && node.handler.body, checkYieldReturnValue) || hasNonFunctionYield(node.finalizer, checkYieldReturnValue); + } + + case 'SwitchStatement': + { + return node.cases.some(someCase => { + return someCase.consequent.some(nde => { + return hasNonFunctionYield(nde, checkYieldReturnValue); + }); + }); + } + + case 'ArrayPattern': + case 'ArrayExpression': + return node.elements.some(element => { + return hasNonFunctionYield(element, checkYieldReturnValue); + }); + + case 'AssignmentPattern': + return hasNonFunctionYield(node.right, checkYieldReturnValue); + + case 'VariableDeclaration': + { + return node.declarations.some(nde => { + return hasNonFunctionYield(nde, checkYieldReturnValue); + }); + } + + case 'VariableDeclarator': + { + return hasNonFunctionYield(node.id, checkYieldReturnValue) || hasNonFunctionYield(node.init, checkYieldReturnValue); + } + + case 'AssignmentExpression': + case 'BinaryExpression': + case 'LogicalExpression': + { + return hasNonFunctionYield(node.left, checkYieldReturnValue) || hasNonFunctionYield(node.right, checkYieldReturnValue); + } + // Comma + + case 'SequenceExpression': + case 'TemplateLiteral': + return node.expressions.some(subExpression => { + return hasNonFunctionYield(subExpression, checkYieldReturnValue); + }); + + case 'ObjectPattern': + case 'ObjectExpression': + return node.properties.some(property => { + return hasNonFunctionYield(property, checkYieldReturnValue); + }); + // istanbul ignore next -- In Babel? + + case 'PropertyDefinition': + /* eslint-disable no-fallthrough */ + // istanbul ignore next -- In Babel? + + case 'ObjectProperty': // istanbul ignore next -- In Babel? + + case 'ClassProperty': + /* eslint-enable no-fallthrough */ + + case 'Property': + return node.computed && hasNonFunctionYield(node.key, checkYieldReturnValue) || hasNonFunctionYield(node.value, checkYieldReturnValue); + // istanbul ignore next -- In Babel? + + case 'ObjectMethod': + // istanbul ignore next -- In Babel? + return node.computed && hasNonFunctionYield(node.key, checkYieldReturnValue) || node.arguments.some(nde => { + return hasNonFunctionYield(nde, checkYieldReturnValue); + }); + + case 'SpreadElement': + case 'UnaryExpression': + return hasNonFunctionYield(node.argument, checkYieldReturnValue); + + case 'TaggedTemplateExpression': + return hasNonFunctionYield(node.quasi, checkYieldReturnValue); + // ?. + // istanbul ignore next -- In Babel? + + case 'OptionalMemberExpression': + case 'MemberExpression': + return hasNonFunctionYield(node.object, checkYieldReturnValue) || hasNonFunctionYield(node.property, checkYieldReturnValue); + // istanbul ignore next -- In Babel? + + case 'Import': + case 'ImportExpression': + return hasNonFunctionYield(node.source, checkYieldReturnValue); + + case 'ReturnStatement': + { + if (node.argument === null) { + return false; + } + + return hasNonFunctionYield(node.argument, checkYieldReturnValue); + } + + case 'YieldExpression': + { + if (checkYieldReturnValue) { + if (node.parent.type === 'VariableDeclarator') { + return true; + } + + return false; + } // void return does not count. + + + if (node.argument === null) { + return false; + } + + return true; + } + + default: + { + return false; + } + } +}; +/** + * Checks if a node has a return statement. Void return does not count. + * + * @param {object} node + * @returns {boolean} + */ + + +const hasYieldValue = (node, checkYieldReturnValue) => { + return node.generator && (node.expression || hasNonFunctionYield(node.body, checkYieldReturnValue)); +}; +/** + * Checks if a node has a throws statement. + * + * @param {object} node + * @param {boolean} innerFunction + * @returns {boolean} + */ +// eslint-disable-next-line complexity + + +const hasThrowValue = (node, innerFunction) => { + if (!node) { + return false; + } // There are cases where a function may execute its inner function which + // throws, but we're treating functions atomically rather than trying to + // follow them + + + switch (node.type) { + case 'FunctionExpression': + case 'FunctionDeclaration': + case 'ArrowFunctionExpression': + { + return !innerFunction && !node.async && hasThrowValue(node.body, true); + } + + case 'BlockStatement': + { + return node.body.some(bodyNode => { + return bodyNode.type !== 'FunctionDeclaration' && hasThrowValue(bodyNode); + }); + } + + case 'LabeledStatement': + case 'WhileStatement': + case 'DoWhileStatement': + case 'ForStatement': + case 'ForInStatement': + case 'ForOfStatement': + case 'WithStatement': + { + return hasThrowValue(node.body); + } + + case 'IfStatement': + { + return hasThrowValue(node.consequent) || hasThrowValue(node.alternate); + } + // We only consider it to throw an error if the catch or finally blocks throw an error. + + case 'TryStatement': + { + return hasThrowValue(node.handler && node.handler.body) || hasThrowValue(node.finalizer); + } + + case 'SwitchStatement': + { + return node.cases.some(someCase => { + return someCase.consequent.some(nde => { + return hasThrowValue(nde); + }); + }); + } + + case 'ThrowStatement': + { + return true; + } + + default: + { + return false; + } + } +}; +/** + * @param {string} tag + */ + +/* +const isInlineTag = (tag) => { + return /^(@link|@linkcode|@linkplain|@tutorial) /u.test(tag); +}; +*/ + +/** + * Parses GCC Generic/Template types + * + * @see {https://github.com/google/closure-compiler/wiki/Generic-Types} + * @see {https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#template} + * @param {JsDocTag} tag + * @returns {Array} + */ + + +const parseClosureTemplateTag = tag => { + return tag.name.split(',').map(type => { + return type.trim(); + }); +}; +/** + * Checks user option for `contexts` array, defaulting to + * contexts designated by the rule. Returns an array of + * ESTree AST types, indicating allowable contexts. + * + * @param {*} context + * @param {true|string[]} defaultContexts + * @returns {string[]} + */ + + +const enforcedContexts = (context, defaultContexts) => { + const { + contexts = defaultContexts === true ? ['ArrowFunctionExpression', 'FunctionDeclaration', 'FunctionExpression'] : defaultContexts + } = context.options[0] || {}; + return contexts; +}; +/** + * @param {string[]} contexts + * @param {Function} checkJsdoc + * @param {Function} handler + */ + + +const getContextObject = (contexts, checkJsdoc, handler) => { + const properties = {}; + + for (const [idx, prop] of contexts.entries()) { + if (typeof prop === 'object') { + const selInfo = { + lastIndex: idx, + selector: prop.context + }; + + if (prop.comment) { + properties[prop.context] = checkJsdoc.bind(null, { ...selInfo, + comment: prop.comment + }, handler.bind(null, prop.comment)); + } else { + properties[prop.context] = checkJsdoc.bind(null, selInfo, null); + } + } else { + const selInfo = { + lastIndex: idx, + selector: prop + }; + properties[prop] = checkJsdoc.bind(null, selInfo, null); + } + } + + return properties; +}; + +const filterTags = (tags, filter) => { + return tags.filter(tag => { + return filter(tag); + }); +}; + +const tagsWithNamesAndDescriptions = new Set(['param', 'arg', 'argument', 'property', 'prop', 'template', // These two are parsed by our custom parser as though having a `name` +'returns', 'return']); + +const getTagsByType = (context, mode, tags, tagPreference) => { + const descName = getPreferredTagName(context, mode, 'description', tagPreference); + const tagsWithoutNames = []; + const tagsWithNames = filterTags(tags, tag => { + const { + tag: tagName + } = tag; + const tagWithName = tagsWithNamesAndDescriptions.has(tagName); + + if (!tagWithName && tagName !== descName) { + tagsWithoutNames.push(tag); + } + + return tagWithName; + }); + return { + tagsWithNames, + tagsWithoutNames + }; +}; + +const getIndent = sourceCode => { + var _sourceCode$text$matc, _sourceCode$text$matc2; + + return ((_sourceCode$text$matc = (_sourceCode$text$matc2 = sourceCode.text.match(/^\n*([ \t]+)/u)) === null || _sourceCode$text$matc2 === void 0 ? void 0 : _sourceCode$text$matc2[1]) !== null && _sourceCode$text$matc !== void 0 ? _sourceCode$text$matc : '') + ' '; +}; + +const isConstructor = node => { + var _node$parent; + + return (node === null || node === void 0 ? void 0 : node.type) === 'MethodDefinition' && node.kind === 'constructor' || (node === null || node === void 0 ? void 0 : (_node$parent = node.parent) === null || _node$parent === void 0 ? void 0 : _node$parent.kind) === 'constructor'; +}; + +const isGetter = node => { + return node && node.parent.kind === 'get'; +}; + +const isSetter = node => { + return node && node.parent.kind === 'set'; +}; + +const hasAccessorPair = node => { + const { + type, + kind: sourceKind, + key: { + name: sourceName + } + } = node; + const oppositeKind = sourceKind === 'get' ? 'set' : 'get'; + const children = type === 'MethodDefinition' ? 'body' : 'properties'; + return node.parent[children].some(({ + kind, + key: { + name + } + }) => { + return kind === oppositeKind && name === sourceName; + }); +}; + +const exemptSpeciaMethods = (jsdoc, node, context, schema) => { + const hasSchemaOption = prop => { + var _context$options$0$pr, _context$options$; + + const schemaProperties = schema[0].properties; + return (_context$options$0$pr = (_context$options$ = context.options[0]) === null || _context$options$ === void 0 ? void 0 : _context$options$[prop]) !== null && _context$options$0$pr !== void 0 ? _context$options$0$pr : schemaProperties[prop] && schemaProperties[prop].default; + }; + + const checkGetters = hasSchemaOption('checkGetters'); + const checkSetters = hasSchemaOption('checkSetters'); + return !hasSchemaOption('checkConstructors') && (isConstructor(node) || hasATag(jsdoc, ['class', 'constructor'])) || isGetter(node) && (!checkGetters || checkGetters === 'no-setter' && hasAccessorPair(node.parent)) || isSetter(node) && (!checkSetters || checkSetters === 'no-getter' && hasAccessorPair(node.parent)); +}; +/** + * Since path segments may be unquoted (if matching a reserved word, + * identifier or numeric literal) or single or double quoted, in either + * the `@param` or in source, we need to strip the quotes to give a fair + * comparison. + * + * @param {string} str + * @returns {string} + */ + + +const dropPathSegmentQuotes = str => { + return str.replace(/\.(['"])(.*)\1/gu, '.$2'); +}; + +const comparePaths = name => { + return otherPathName => { + return otherPathName === name || dropPathSegmentQuotes(otherPathName) === dropPathSegmentQuotes(name); + }; +}; + +const pathDoesNotBeginWith = (name, otherPathName) => { + return !name.startsWith(otherPathName) && !dropPathSegmentQuotes(name).startsWith(dropPathSegmentQuotes(otherPathName)); +}; + +const getRegexFromString = (regexString, requiredFlags) => { + const match = regexString.match(/^\/(.*)\/([gimyus]*)$/us); + let flags = 'u'; + let regex = regexString; + + if (match) { + [, regex, flags] = match; + + if (!flags) { + flags = 'u'; + } + } + + const uniqueFlags = [...new Set(flags + (requiredFlags || ''))]; + flags = uniqueFlags.join(''); + return new RegExp(regex, flags); +}; + +var _default = { + comparePaths, + dropPathSegmentQuotes, + enforcedContexts, + exemptSpeciaMethods, + filterTags, + flattenRoots, + getContextObject, + getFunctionParameterNames, + getIndent, + getJsdocTagsDeep, + getPreferredTagName, + getRegexFromString, + getTagsByType, + getTagStructureForMode, + hasATag, + hasDefinedTypeTag, + hasParams, + hasReturnValue, + hasTag, + hasThrowValue, + hasValueOrExecutorHasNonEmptyResolveValue, + hasYieldValue, + isConstructor, + isGetter, + isNamepathDefiningTag, + isSetter, + isValidTag, + overrideTagStructure, + parseClosureTemplateTag, + pathDoesNotBeginWith, + setTagStructure, + tagMightHaveNamepath, + tagMightHaveNamePosition, + tagMightHaveTypePosition, + tagMissingRequiredTypeOrNamepath, + tagMustHaveNamePosition, + tagMustHaveTypePosition +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=jsdocUtils.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkAccess.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkAccess.js new file mode 100644 index 00000000000000..95e8fa524be7f4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkAccess.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const accessLevels = ['package', 'private', 'protected', 'public']; + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('access', (jsdocParameter, targetTagName) => { + const desc = jsdocParameter.name + ' ' + jsdocParameter.description; + + if (!accessLevels.includes(desc.trim())) { + report(`Missing valid JSDoc @${targetTagName} level.`, null, jsdocParameter); + } + }); + const accessLength = utils.getTags('access').length; + const individualTagLength = utils.getPresentTags(accessLevels).length; + + if (accessLength && individualTagLength) { + report('The @access tag may not be used with specific access-control tags (@package, @private, @protected, or @public).'); + } + + if (accessLength > 1 || individualTagLength > 1) { + report('At most one access-control tag may be present on a jsdoc block.'); + } +}, { + checkPrivate: true, + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Checks that `@access` tags have a valid value.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-access' + }, + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkAccess.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkAlignment.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkAlignment.js new file mode 100644 index 00000000000000..fd798e23ae66a8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkAlignment.js @@ -0,0 +1,63 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const trimStart = string => { + return string.replace(/^\s+/u, ''); +}; + +var _default = (0, _iterateJsdoc.default)(({ + sourceCode, + jsdocNode, + report, + indent +}) => { + // `indent` is whitespace from line 1 (`/**`), so slice and account for "/". + const indentLevel = indent.length + 1; + const sourceLines = sourceCode.getText(jsdocNode).split('\n').slice(1).map(line => { + return line.split('*')[0]; + }).filter(line => { + return !trimStart(line).length; + }); + + const fix = fixer => { + const replacement = sourceCode.getText(jsdocNode).split('\n').map((line, index) => { + // Ignore the first line and all lines not starting with `*` + const ignored = !index || trimStart(line.split('*')[0]).length; + return ignored ? line : `${indent} ${trimStart(line)}`; + }).join('\n'); + return fixer.replaceText(jsdocNode, replacement); + }; + + sourceLines.some((line, lineNum) => { + if (line.length !== indentLevel) { + report('Expected JSDoc block to be aligned.', fix, { + line: lineNum + 1 + }); + return true; + } + + return false; + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Reports invalid alignment of JSDoc block asterisks.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-alignment' + }, + fixable: 'code', + type: 'layout' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkAlignment.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js new file mode 100644 index 00000000000000..4ea17f9f474d38 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js @@ -0,0 +1,481 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _eslint = require("eslint"); + +var _semver = _interopRequireDefault(require("semver")); + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Todo: When replace `CLIEngine` with `ESLint` when feature set complete per https://github.com/eslint/eslint/issues/14745 +// https://github.com/eslint/eslint/blob/master/docs/user-guide/migrating-to-7.0.0.md#-the-cliengine-class-has-been-deprecated +const zeroBasedLineIndexAdjust = -1; +const likelyNestedJSDocIndentSpace = 1; +const preTagSpaceLength = 1; // If a space is present, we should ignore it + +const firstLinePrefixLength = preTagSpaceLength; +const hasCaptionRegex = /^\s*([\s\S]*?)<\/caption>/u; + +const escapeStringRegexp = str => { + return str.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&'); +}; + +const countChars = (str, ch) => { + return (str.match(new RegExp(escapeStringRegexp(ch), 'gu')) || []).length; +}; + +const defaultMdRules = { + // "always" newline rule at end unlikely in sample code + 'eol-last': 0, + // Wouldn't generally expect example paths to resolve relative to JS file + 'import/no-unresolved': 0, + // Snippets likely too short to always include import/export info + 'import/unambiguous': 0, + 'jsdoc/require-file-overview': 0, + // The end of a multiline comment would end the comment the example is in. + 'jsdoc/require-jsdoc': 0, + // Unlikely to have inadvertent debugging within examples + 'no-console': 0, + // Often wish to start `@example` code after newline; also may use + // empty lines for spacing + 'no-multiple-empty-lines': 0, + // Many variables in examples will be `undefined` + 'no-undef': 0, + // Common to define variables for clarity without always using them + 'no-unused-vars': 0, + // See import/no-unresolved + 'node/no-missing-import': 0, + 'node/no-missing-require': 0, + // Can generally look nicer to pad a little even if code imposes more stringency + 'padded-blocks': 0 +}; +const defaultExpressionRules = { ...defaultMdRules, + 'chai-friendly/no-unused-expressions': 'off', + 'no-empty-function': 'off', + 'no-new': 'off', + 'no-unused-expressions': 'off', + quotes: ['error', 'double'], + semi: ['error', 'never'], + strict: 'off' +}; + +const getLinesCols = text => { + const matchLines = countChars(text, '\n'); + const colDelta = matchLines ? text.slice(text.lastIndexOf('\n') + 1).length : text.length; + return [matchLines, colDelta]; +}; + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils, + context, + globalState +}) => { + if (_semver.default.gte(_eslint.ESLint.version, '8.0.0')) { + report('This rule cannot yet be supported for ESLint 8; you ' + 'should either downgrade to ESLint 7 or disable this rule. The ' + 'possibility for ESLint 8 support is being tracked at https://github.com/eslint/eslint/issues/14745', { + column: 1, + line: 1 + }); + return; + } + + if (!globalState.has('checkExamples-matchingFileName')) { + globalState.set('checkExamples-matchingFileName', new Map()); + } + + const matchingFileNameMap = globalState.get('checkExamples-matchingFileName'); + const options = context.options[0] || {}; + let { + exampleCodeRegex = null, + rejectExampleCodeRegex = null + } = options; + const { + checkDefaults = false, + checkParams = false, + checkProperties = false, + noDefaultExampleRules = false, + checkEslintrc = true, + matchingFileName = null, + matchingFileNameDefaults = null, + matchingFileNameParams = null, + matchingFileNameProperties = null, + paddedIndent = 0, + baseConfig = {}, + configFile, + allowInlineConfig = true, + reportUnusedDisableDirectives = true, + captionRequired = false + } = options; // Make this configurable? + + const rulePaths = []; + const mdRules = noDefaultExampleRules ? undefined : defaultMdRules; + const expressionRules = noDefaultExampleRules ? undefined : defaultExpressionRules; + + if (exampleCodeRegex) { + exampleCodeRegex = utils.getRegexFromString(exampleCodeRegex); + } + + if (rejectExampleCodeRegex) { + rejectExampleCodeRegex = utils.getRegexFromString(rejectExampleCodeRegex); + } + + const checkSource = ({ + filename, + defaultFileName, + rules = expressionRules, + lines = 0, + cols = 0, + skipInit, + source, + targetTagName, + sources = [], + tag = { + line: 0 + } + }) => { + if (!skipInit) { + sources.push({ + nonJSPrefacingCols: cols, + nonJSPrefacingLines: lines, + string: source + }); + } // Todo: Make fixable + + + const checkRules = function ({ + nonJSPrefacingCols, + nonJSPrefacingLines, + string + }) { + const cliConfig = { + allowInlineConfig, + baseConfig, + configFile, + reportUnusedDisableDirectives, + rulePaths, + rules, + useEslintrc: checkEslintrc + }; + const cliConfigStr = JSON.stringify(cliConfig); + const src = paddedIndent ? string.replace(new RegExp(`(^|\n) {${paddedIndent}}(?!$)`, 'gu'), '\n') : string; // Programmatic ESLint API: https://eslint.org/docs/developer-guide/nodejs-api + + const fileNameMapKey = filename ? 'a' + cliConfigStr + filename : 'b' + cliConfigStr + defaultFileName; + const file = filename || defaultFileName; + let cliFile; + + if (matchingFileNameMap.has(fileNameMapKey)) { + cliFile = matchingFileNameMap.get(fileNameMapKey); + } else { + const cli = new _eslint.CLIEngine(cliConfig); + let config; + + if (filename || checkEslintrc) { + config = cli.getConfigForFile(file); + } // We need a new instance to ensure that the rules that may only + // be available to `file` (if it has its own `.eslintrc`), + // will be defined. + + + cliFile = new _eslint.CLIEngine({ + allowInlineConfig, + baseConfig: { ...baseConfig, + ...config + }, + configFile, + reportUnusedDisableDirectives, + rulePaths, + rules, + useEslintrc: false + }); + matchingFileNameMap.set(fileNameMapKey, cliFile); + } + + const { + results: [{ + messages + }] + } = cliFile.executeOnText(src); + + if (!('line' in tag)) { + tag.line = tag.source[0].number; + } // NOTE: `tag.line` can be 0 if of form `/** @tag ... */` + + + const codeStartLine = tag.line + nonJSPrefacingLines; + const codeStartCol = likelyNestedJSDocIndentSpace; + + for (const { + message, + line, + column, + severity, + ruleId + } of messages) { + const startLine = codeStartLine + line + zeroBasedLineIndexAdjust; + const startCol = codeStartCol + ( // This might not work for line 0, but line 0 is unlikely for examples + line <= 1 ? nonJSPrefacingCols + firstLinePrefixLength : preTagSpaceLength) + column; + report('@' + targetTagName + ' ' + (severity === 2 ? 'error' : 'warning') + (ruleId ? ' (' + ruleId + ')' : '') + ': ' + message, null, { + column: startCol, + line: startLine + }); + } + }; + + for (const targetSource of sources) { + checkRules(targetSource); + } + }; + /** + * + * @param {string} filename + * @param {string} [ext] Since `eslint-plugin-markdown` v2, and + * ESLint 7, this is the default which other JS-fenced rules will used. + * Formerly "md" was the default. + * @returns {{defaultFileName: string, fileName: string}} + */ + + + const getFilenameInfo = (filename, ext = 'md/*.js') => { + let defaultFileName; + + if (!filename) { + const jsFileName = context.getFilename(); + + if (typeof jsFileName === 'string' && jsFileName.includes('.')) { + defaultFileName = jsFileName.replace(/\..*?$/u, `.${ext}`); + } else { + defaultFileName = `dummy.${ext}`; + } + } + + return { + defaultFileName, + filename + }; + }; + + if (checkDefaults) { + const filenameInfo = getFilenameInfo(matchingFileNameDefaults, 'jsdoc-defaults'); + utils.forEachPreferredTag('default', (tag, targetTagName) => { + if (!tag.description.trim()) { + return; + } + + checkSource({ + source: `(${utils.getTagDescription(tag)})`, + targetTagName, + ...filenameInfo + }); + }); + } + + if (checkParams) { + const filenameInfo = getFilenameInfo(matchingFileNameParams, 'jsdoc-params'); + utils.forEachPreferredTag('param', (tag, targetTagName) => { + if (!tag.default || !tag.default.trim()) { + return; + } + + checkSource({ + source: `(${tag.default})`, + targetTagName, + ...filenameInfo + }); + }); + } + + if (checkProperties) { + const filenameInfo = getFilenameInfo(matchingFileNameProperties, 'jsdoc-properties'); + utils.forEachPreferredTag('property', (tag, targetTagName) => { + if (!tag.default || !tag.default.trim()) { + return; + } + + checkSource({ + source: `(${tag.default})`, + targetTagName, + ...filenameInfo + }); + }); + } + + const tagName = utils.getPreferredTagName({ + tagName: 'example' + }); + + if (!utils.hasTag(tagName)) { + return; + } + + const matchingFilenameInfo = getFilenameInfo(matchingFileName); + utils.forEachPreferredTag('example', (tag, targetTagName) => { + let source = utils.getTagDescription(tag); + const match = source.match(hasCaptionRegex); + + if (captionRequired && (!match || !match[1].trim())) { + report('Caption is expected for examples.', null, tag); + } + + source = source.replace(hasCaptionRegex, ''); + const [lines, cols] = match ? getLinesCols(match[0]) : [0, 0]; + + if (exampleCodeRegex && !exampleCodeRegex.test(source) || rejectExampleCodeRegex && rejectExampleCodeRegex.test(source)) { + return; + } + + const sources = []; + let skipInit = false; + + if (exampleCodeRegex) { + let nonJSPrefacingCols = 0; + let nonJSPrefacingLines = 0; + let startingIndex = 0; + let lastStringCount = 0; + let exampleCode; + exampleCodeRegex.lastIndex = 0; + + while ((exampleCode = exampleCodeRegex.exec(source)) !== null) { + const { + index, + 0: n0, + 1: n1 + } = exampleCode; // Count anything preceding user regex match (can affect line numbering) + + const preMatch = source.slice(startingIndex, index); + const [preMatchLines, colDelta] = getLinesCols(preMatch); + let nonJSPreface; + let nonJSPrefaceLineCount; + + if (n1) { + const idx = n0.indexOf(n1); + nonJSPreface = n0.slice(0, idx); + nonJSPrefaceLineCount = countChars(nonJSPreface, '\n'); + } else { + nonJSPreface = ''; + nonJSPrefaceLineCount = 0; + } + + nonJSPrefacingLines += lastStringCount + preMatchLines + nonJSPrefaceLineCount; // Ignore `preMatch` delta if newlines here + + if (nonJSPrefaceLineCount) { + const charsInLastLine = nonJSPreface.slice(nonJSPreface.lastIndexOf('\n') + 1).length; + nonJSPrefacingCols += charsInLastLine; + } else { + nonJSPrefacingCols += colDelta + nonJSPreface.length; + } + + const string = n1 || n0; + sources.push({ + nonJSPrefacingCols, + nonJSPrefacingLines, + string + }); + startingIndex = exampleCodeRegex.lastIndex; + lastStringCount = countChars(string, '\n'); + + if (!exampleCodeRegex.global) { + break; + } + } + + skipInit = true; + } + + checkSource({ + cols, + lines, + rules: mdRules, + skipInit, + source, + sources, + tag, + targetTagName, + ...matchingFilenameInfo + }); + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-examples' + }, + schema: [{ + additionalProperties: false, + properties: { + allowInlineConfig: { + default: true, + type: 'boolean' + }, + baseConfig: { + type: 'object' + }, + captionRequired: { + default: false, + type: 'boolean' + }, + checkDefaults: { + default: false, + type: 'boolean' + }, + checkEslintrc: { + default: true, + type: 'boolean' + }, + checkParams: { + default: false, + type: 'boolean' + }, + checkProperties: { + default: false, + type: 'boolean' + }, + configFile: { + type: 'string' + }, + exampleCodeRegex: { + type: 'string' + }, + matchingFileName: { + type: 'string' + }, + matchingFileNameDefaults: { + type: 'string' + }, + matchingFileNameParams: { + type: 'string' + }, + matchingFileNameProperties: { + type: 'string' + }, + noDefaultExampleRules: { + default: false, + type: 'boolean' + }, + paddedIndent: { + default: 0, + type: 'integer' + }, + rejectExampleCodeRegex: { + type: 'string' + }, + reportUnusedDisableDirectives: { + default: true, + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkExamples.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkIndentation.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkIndentation.js new file mode 100644 index 00000000000000..f283b46a766910 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkIndentation.js @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const maskExcludedContent = (str, excludeTags) => { + const regContent = new RegExp(`([ \\t]+\\*)[ \\t]@(?:${excludeTags.join('|')})(?=[ \\n])([\\w|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*@\\w+\\s|\\/))`, 'gu'); + return str.replace(regContent, (_match, margin, code) => { + return (margin + '\n').repeat(code.match(/\n/gu).length); + }); +}; + +const maskCodeBlocks = str => { + const regContent = /([ \t]+\*)[ \t]```[^\n]*?([\w|\W]*?\n)(?=[ \t]*\*(?:[ \t]*(?:```|@\w+\s)|\/))/gu; + return str.replace(regContent, (_match, margin, code) => { + return (margin + '\n').repeat(code.match(/\n/gu).length); + }); +}; + +var _default = (0, _iterateJsdoc.default)(({ + sourceCode, + jsdocNode, + report, + context +}) => { + const options = context.options[0] || {}; + const { + excludeTags = ['example'] + } = options; + const reg = /^(?:\/?\**|[ \t]*)\*[ \t]{2}/gmu; + const textWithoutCodeBlocks = maskCodeBlocks(sourceCode.getText(jsdocNode)); + const text = excludeTags.length ? maskExcludedContent(textWithoutCodeBlocks, excludeTags) : textWithoutCodeBlocks; + + if (reg.test(text)) { + const lineBreaks = text.slice(0, reg.lastIndex).match(/\n/gu) || []; + report('There must be no indentation.', null, { + line: lineBreaks.length + }); + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Reports invalid padding inside JSDoc blocks.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-indentation' + }, + schema: [{ + additionalProperties: false, + properties: { + excludeTags: { + items: { + pattern: '^\\S+$', + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'layout' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkIndentation.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkLineAlignment.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkLineAlignment.js new file mode 100644 index 00000000000000..8441f1b1af36eb --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkLineAlignment.js @@ -0,0 +1,225 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _commentParser = require("comment-parser"); + +var _alignTransform = _interopRequireDefault(require("../alignTransform")); + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const { + flow: commentFlow +} = _commentParser.transforms; + +const checkNotAlignedPerTag = (utils, tag, customSpacings) => { + /* + start + + delimiter + + postDelimiter + + tag + + postTag + + type + + postType + + name + + postName + + description + + end + + lineEnd + */ + let spacerProps; + let contentProps; + const mightHaveNamepath = utils.tagMightHaveNamepath(tag.tag); + + if (mightHaveNamepath) { + spacerProps = ['postDelimiter', 'postTag', 'postType', 'postName']; + contentProps = ['tag', 'type', 'name', 'description']; + } else { + spacerProps = ['postDelimiter', 'postTag', 'postType']; + contentProps = ['tag', 'type', 'description']; + } + + const { + tokens + } = tag.source[0]; + + const followedBySpace = (idx, callbck) => { + const nextIndex = idx + 1; + return spacerProps.slice(nextIndex).some((spacerProp, innerIdx) => { + const contentProp = contentProps[nextIndex + innerIdx]; + const spacePropVal = tokens[spacerProp]; + const ret = spacePropVal; + + if (callbck) { + callbck(!ret, contentProp); + } + + return ret && (callbck || !contentProp); + }); + }; // If checking alignment on multiple lines, need to check other `source` + // items + // Go through `post*` spacing properties and exit to indicate problem if + // extra spacing detected + + + const ok = !spacerProps.some((spacerProp, idx) => { + const contentProp = contentProps[idx]; + const contentPropVal = tokens[contentProp]; + const spacerPropVal = tokens[spacerProp]; + const spacing = (customSpacings === null || customSpacings === void 0 ? void 0 : customSpacings[spacerProp]) || 1; // There will be extra alignment if... + // 1. The spaces don't match the space it should have (1 or custom spacing) OR + + return spacerPropVal.length !== spacing && spacerPropVal.length !== 0 || // 2. There is a (single) space, no immediate content, and yet another + // space is found subsequently (not separated by intervening content) + spacerPropVal && !contentPropVal && followedBySpace(idx); + }); + + if (ok) { + return; + } + + const fix = () => { + for (const [idx, spacerProp] of spacerProps.entries()) { + const contentProp = contentProps[idx]; + const contentPropVal = tokens[contentProp]; + + if (contentPropVal) { + const spacing = (customSpacings === null || customSpacings === void 0 ? void 0 : customSpacings[spacerProp]) || 1; + tokens[spacerProp] = ''.padStart(spacing, ' '); + followedBySpace(idx, (hasSpace, contentPrp) => { + if (hasSpace) { + tokens[contentPrp] = ''; + } + }); + } else { + tokens[spacerProp] = ''; + } + } + + utils.setTag(tag, tokens); + }; + + utils.reportJSDoc('Expected JSDoc block lines to not be aligned.', tag, fix, true); +}; + +const checkAlignment = ({ + customSpacings, + indent, + jsdoc, + jsdocNode, + preserveMainDescriptionPostDelimiter, + report, + tags, + utils +}) => { + const transform = commentFlow((0, _alignTransform.default)({ + customSpacings, + indent, + preserveMainDescriptionPostDelimiter, + tags + })); + const transformedJsdoc = transform(jsdoc); + const comment = '/*' + jsdocNode.value + '*/'; + const formatted = utils.stringify(transformedJsdoc).trimStart(); + + if (comment !== formatted) { + report('Expected JSDoc block lines to be aligned.', fixer => { + return fixer.replaceText(jsdocNode, formatted); + }); + } +}; + +var _default = (0, _iterateJsdoc.default)(({ + indent, + jsdoc, + jsdocNode, + report, + context, + utils +}) => { + const { + tags: applicableTags = ['param', 'arg', 'argument', 'property', 'prop', 'returns', 'return'], + preserveMainDescriptionPostDelimiter, + customSpacings + } = context.options[1] || {}; + + if (context.options[0] === 'always') { + // Skip if it contains only a single line. + if (!jsdocNode.value.includes('\n')) { + return; + } + + checkAlignment({ + customSpacings, + indent, + jsdoc, + jsdocNode, + preserveMainDescriptionPostDelimiter, + report, + tags: applicableTags, + utils + }); + return; + } + + const foundTags = utils.getPresentTags(applicableTags); + + for (const tag of foundTags) { + checkNotAlignedPerTag(utils, tag, customSpacings); + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Reports invalid alignment of JSDoc block lines.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-line-alignment' + }, + fixable: 'whitespace', + schema: [{ + enum: ['always', 'never'], + type: 'string' + }, { + additionalProperties: false, + properties: { + customSpacings: { + additionalProperties: false, + properties: { + postDelimiter: { + type: 'integer' + }, + postName: { + type: 'integer' + }, + postTag: { + type: 'integer' + }, + postType: { + type: 'integer' + } + } + }, + preserveMainDescriptionPostDelimiter: { + default: false, + type: 'boolean' + }, + tags: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'layout' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkLineAlignment.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkParamNames.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkParamNames.js new file mode 100644 index 00000000000000..f40be3398b91b0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkParamNames.js @@ -0,0 +1,296 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const validateParameterNames = (targetTagName, allowExtraTrailingParamDocs, checkDestructured, checkRestProperty, checkTypesRegex, disableExtraPropertyReporting, enableFixer, functionParameterNames, jsdoc, _jsdocNode, utils, report) => { + const paramTags = Object.entries(jsdoc.tags).filter(([, tag]) => { + return tag.tag === targetTagName; + }); + const paramTagsNonNested = paramTags.filter(([, tag]) => { + return !tag.name.includes('.'); + }); + let dotted = 0; // eslint-disable-next-line complexity + + return paramTags.some(([, tag], index) => { + let tagsIndex; + const dupeTagInfo = paramTags.find(([tgsIndex, tg], idx) => { + tagsIndex = tgsIndex; + return tg.name === tag.name && idx !== index; + }); + + if (dupeTagInfo) { + utils.reportJSDoc(`Duplicate @${targetTagName} "${tag.name}"`, dupeTagInfo[1], enableFixer ? () => { + utils.removeTag(tagsIndex); + } : null); + return true; + } + + if (tag.name.includes('.')) { + dotted++; + return false; + } + + const functionParameterName = functionParameterNames[index - dotted]; + + if (!functionParameterName) { + if (allowExtraTrailingParamDocs) { + return false; + } + + report(`@${targetTagName} "${tag.name}" does not match an existing function parameter.`, null, tag); + return true; + } + + if (Array.isArray(functionParameterName)) { + if (!checkDestructured) { + return false; + } + + if (tag.type && tag.type.search(checkTypesRegex) === -1) { + return false; + } + + const [parameterName, { + names: properties, + hasPropertyRest, + rests, + annotationParamName + }] = functionParameterName; + + if (annotationParamName !== undefined) { + const name = tag.name.trim(); + + if (name !== annotationParamName) { + report(`@${targetTagName} "${name}" does not match parameter name "${annotationParamName}"`, null, tag); + } + } + + const tagName = parameterName === undefined ? tag.name.trim() : parameterName; + const expectedNames = properties.map(name => { + return `${tagName}.${name}`; + }); + const actualNames = paramTags.map(([, paramTag]) => { + return paramTag.name.trim(); + }); + const actualTypes = paramTags.map(([, paramTag]) => { + return paramTag.type; + }); + const missingProperties = []; + const notCheckingNames = []; + + for (const [idx, name] of expectedNames.entries()) { + if (notCheckingNames.some(notCheckingName => { + return name.startsWith(notCheckingName); + })) { + continue; + } + + const actualNameIdx = actualNames.findIndex(actualName => { + return utils.comparePaths(name)(actualName); + }); + + if (actualNameIdx === -1) { + if (!checkRestProperty && rests[idx]) { + continue; + } + + const missingIndex = actualNames.findIndex(actualName => { + return utils.pathDoesNotBeginWith(name, actualName); + }); + const line = tag.source[0].number - 1 + (missingIndex > -1 ? missingIndex : actualNames.length); + missingProperties.push({ + name, + tagPlacement: { + line: line === 0 ? 1 : line + } + }); + } else if (actualTypes[actualNameIdx].search(checkTypesRegex) === -1 && actualTypes[actualNameIdx] !== '') { + notCheckingNames.push(name); + } + } + + const hasMissing = missingProperties.length; + + if (hasMissing) { + for (const { + tagPlacement, + name: missingProperty + } of missingProperties) { + report(`Missing @${targetTagName} "${missingProperty}"`, null, tagPlacement); + } + } + + if (!hasPropertyRest || checkRestProperty) { + const extraProperties = []; + + for (const [idx, name] of actualNames.entries()) { + const match = name.startsWith(tag.name.trim() + '.'); + + if (match && !expectedNames.some(utils.comparePaths(name)) && !utils.comparePaths(name)(tag.name) && (!disableExtraPropertyReporting || properties.some(prop => { + return prop.split('.').length >= name.split('.').length - 1; + }))) { + extraProperties.push([name, paramTags[idx][1]]); + } + } + + if (extraProperties.length) { + for (const [extraProperty, tg] of extraProperties) { + report(`@${targetTagName} "${extraProperty}" does not exist on ${tag.name}`, null, tg); + } + + return true; + } + } + + return hasMissing; + } + + let funcParamName; + + if (typeof functionParameterName === 'object') { + const { + name + } = functionParameterName; + funcParamName = name; + } else { + funcParamName = functionParameterName; + } + + if (funcParamName !== tag.name.trim()) { + // Todo: Improve for array or object child items + const actualNames = paramTagsNonNested.map(([, { + name + }]) => { + return name.trim(); + }); + const expectedNames = functionParameterNames.map((item, idx) => { + var _item$; + + if (item !== null && item !== void 0 && (_item$ = item[1]) !== null && _item$ !== void 0 && _item$.names) { + return actualNames[idx]; + } + + return item; + }).join(', '); + report(`Expected @${targetTagName} names to be "${expectedNames}". Got "${actualNames.join(', ')}".`, null, tag); + return true; + } + + return false; + }); +}; + +const validateParameterNamesDeep = (targetTagName, _allowExtraTrailingParamDocs, jsdocParameterNames, jsdoc, report) => { + let lastRealParameter; + return jsdocParameterNames.some(({ + name: jsdocParameterName, + idx + }) => { + const isPropertyPath = jsdocParameterName.includes('.'); + + if (isPropertyPath) { + if (!lastRealParameter) { + report(`@${targetTagName} path declaration ("${jsdocParameterName}") appears before any real parameter.`, null, jsdoc.tags[idx]); + return true; + } + + let pathRootNodeName = jsdocParameterName.slice(0, jsdocParameterName.indexOf('.')); + + if (pathRootNodeName.endsWith('[]')) { + pathRootNodeName = pathRootNodeName.slice(0, -2); + } + + if (pathRootNodeName !== lastRealParameter) { + report(`@${targetTagName} path declaration ("${jsdocParameterName}") root node name ("${pathRootNodeName}") ` + `does not match previous real parameter name ("${lastRealParameter}").`, null, jsdoc.tags[idx]); + return true; + } + } else { + lastRealParameter = jsdocParameterName; + } + + return false; + }); +}; + +var _default = (0, _iterateJsdoc.default)(({ + context, + jsdoc, + jsdocNode, + report, + utils +}) => { + const { + allowExtraTrailingParamDocs, + checkDestructured = true, + checkRestProperty = false, + checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/', + enableFixer = false, + useDefaultObjectProperties = false, + disableExtraPropertyReporting = false + } = context.options[0] || {}; + const checkTypesRegex = utils.getRegexFromString(checkTypesPattern); + const jsdocParameterNamesDeep = utils.getJsdocTagsDeep('param'); + + if (!jsdocParameterNamesDeep.length) { + return; + } + + const functionParameterNames = utils.getFunctionParameterNames(useDefaultObjectProperties); + const targetTagName = utils.getPreferredTagName({ + tagName: 'param' + }); + const isError = validateParameterNames(targetTagName, allowExtraTrailingParamDocs, checkDestructured, checkRestProperty, checkTypesRegex, disableExtraPropertyReporting, enableFixer, functionParameterNames, jsdoc, jsdocNode, utils, report); + + if (isError || !checkDestructured) { + return; + } + + validateParameterNamesDeep(targetTagName, allowExtraTrailingParamDocs, jsdocParameterNamesDeep, jsdoc, report); +}, { + meta: { + docs: { + description: 'Ensures that parameter names in JSDoc match those in the function declaration.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-param-names' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + allowExtraTrailingParamDocs: { + type: 'boolean' + }, + checkDestructured: { + type: 'boolean' + }, + checkRestProperty: { + type: 'boolean' + }, + checkTypesPattern: { + type: 'string' + }, + disableExtraPropertyReporting: { + type: 'boolean' + }, + enableFixer: { + type: 'boolean' + }, + useDefaultObjectProperties: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkParamNames.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkPropertyNames.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkPropertyNames.js new file mode 100644 index 00000000000000..a58dd49429710e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkPropertyNames.js @@ -0,0 +1,115 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const validatePropertyNames = (targetTagName, enableFixer, jsdoc, jsdocNode, utils) => { + const propertyTags = Object.entries(jsdoc.tags).filter(([, tag]) => { + return tag.tag === targetTagName; + }); + return propertyTags.some(([, tag], index) => { + let tagsIndex; + const dupeTagInfo = propertyTags.find(([tgsIndex, tg], idx) => { + tagsIndex = tgsIndex; + return tg.name === tag.name && idx !== index; + }); + + if (dupeTagInfo) { + utils.reportJSDoc(`Duplicate @${targetTagName} "${tag.name}"`, dupeTagInfo[1], enableFixer ? () => { + utils.removeTag(tagsIndex); + } : null); + return true; + } + + return false; + }); +}; + +const validatePropertyNamesDeep = (targetTagName, jsdocPropertyNames, jsdoc, report) => { + let lastRealProperty; + return jsdocPropertyNames.some(({ + name: jsdocPropertyName, + idx + }) => { + const isPropertyPath = jsdocPropertyName.includes('.'); + + if (isPropertyPath) { + if (!lastRealProperty) { + report(`@${targetTagName} path declaration ("${jsdocPropertyName}") appears before any real property.`, null, jsdoc.tags[idx]); + return true; + } + + let pathRootNodeName = jsdocPropertyName.slice(0, jsdocPropertyName.indexOf('.')); + + if (pathRootNodeName.endsWith('[]')) { + pathRootNodeName = pathRootNodeName.slice(0, -2); + } + + if (pathRootNodeName !== lastRealProperty) { + report(`@${targetTagName} path declaration ("${jsdocPropertyName}") root node name ("${pathRootNodeName}") ` + `does not match previous real property name ("${lastRealProperty}").`, null, jsdoc.tags[idx]); + return true; + } + } else { + lastRealProperty = jsdocPropertyName; + } + + return false; + }); +}; + +var _default = (0, _iterateJsdoc.default)(({ + context, + jsdoc, + jsdocNode, + report, + utils +}) => { + const { + enableFixer = false + } = context.options[0] || {}; + const jsdocPropertyNamesDeep = utils.getJsdocTagsDeep('property'); + + if (!jsdocPropertyNamesDeep.length) { + return; + } + + const targetTagName = utils.getPreferredTagName({ + tagName: 'property' + }); + const isError = validatePropertyNames(targetTagName, enableFixer, jsdoc, jsdocNode, utils); + + if (isError) { + return; + } + + validatePropertyNamesDeep(targetTagName, jsdocPropertyNamesDeep, jsdoc, report); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Ensures that property names in JSDoc are not duplicated on the same block and that nested properties have defined roots.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-property-names' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + enableFixer: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkPropertyNames.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkSyntax.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkSyntax.js new file mode 100644 index 00000000000000..4f17414789c963 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkSyntax.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + jsdoc, + report, + settings +}) => { + const { + mode + } = settings; // Don't check for "permissive" and "closure" + + if (mode === 'jsdoc' || mode === 'typescript') { + for (const tag of jsdoc.tags) { + if (tag.type.slice(-1) === '=') { + report('Syntax should not be Google Closure Compiler style.', null, tag); + break; + } + } + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Reports against syntax not valid for the mode (e.g., Google Closure Compiler in non-Closure mode).', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-syntax' + }, + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkSyntax.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkTagNames.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkTagNames.js new file mode 100644 index 00000000000000..bd30ac20172f7a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkTagNames.js @@ -0,0 +1,129 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _escapeStringRegexp = _interopRequireDefault(require("escape-string-regexp")); + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// https://babeljs.io/docs/en/babel-plugin-transform-react-jsx/ +const jsxTagNames = new Set(['jsx', 'jsxFrag', 'jsxImportSource', 'jsxRuntime']); + +var _default = (0, _iterateJsdoc.default)(({ + sourceCode, + jsdoc, + report, + utils, + context, + settings, + jsdocNode +}) => { + const { + definedTags = [], + jsxTags + } = context.options[0] || {}; + let definedPreferredTags = []; + const { + tagNamePreference, + structuredTags + } = settings; + const definedStructuredTags = Object.keys(structuredTags); + const definedNonPreferredTags = Object.keys(tagNamePreference); + + if (definedNonPreferredTags.length) { + definedPreferredTags = Object.values(tagNamePreference).map(preferredTag => { + if (typeof preferredTag === 'string') { + // May become an empty string but will be filtered out below + return preferredTag; + } + + if (!preferredTag) { + return undefined; + } + + if (typeof preferredTag !== 'object') { + utils.reportSettings('Invalid `settings.jsdoc.tagNamePreference`. Values must be falsy, a string, or an object.'); + } + + return preferredTag.replacement; + }).filter(preferredType => { + return preferredType; + }); + } + + for (const jsdocTag of jsdoc.tags) { + const tagName = jsdocTag.tag; + + if (jsxTags && jsxTagNames.has(tagName)) { + continue; + } + + if (utils.isValidTag(tagName, [...definedTags, ...definedPreferredTags, ...definedNonPreferredTags, ...definedStructuredTags])) { + let preferredTagName = utils.getPreferredTagName({ + allowObjectReturn: true, + defaultMessage: `Blacklisted tag found (\`@${tagName}\`)`, + tagName + }); + + if (!preferredTagName) { + continue; + } + + let message; + + if (typeof preferredTagName === 'object') { + ({ + message, + replacement: preferredTagName + } = preferredTagName); + } + + if (!message) { + message = `Invalid JSDoc tag (preference). Replace "${tagName}" JSDoc tag with "${preferredTagName}".`; + } + + if (preferredTagName !== tagName) { + report(message, fixer => { + const replacement = sourceCode.getText(jsdocNode).replace(new RegExp(`@${(0, _escapeStringRegexp.default)(tagName)}\\b`, 'u'), `@${preferredTagName}`); + return fixer.replaceText(jsdocNode, replacement); + }, jsdocTag); + } + } else { + report(`Invalid JSDoc tag name "${tagName}".`, null, jsdocTag); + } + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Reports invalid block tag names.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-tag-names' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + definedTags: { + items: { + type: 'string' + }, + type: 'array' + }, + jsxTags: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkTagNames.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkTypes.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkTypes.js new file mode 100644 index 00000000000000..6789c95d1c7540 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkTypes.js @@ -0,0 +1,269 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _jsdocTypePrattParser = require("jsdoc-type-pratt-parser"); + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const strictNativeTypes = ['undefined', 'null', 'boolean', 'number', 'bigint', 'string', 'symbol', 'object', 'Array', 'Function', 'Date', 'RegExp']; + +const adjustNames = (type, preferred, isGenericMatch, nodeName, node, parentNode) => { + let ret = preferred; + + if (isGenericMatch) { + if (preferred === '[]') { + parentNode.meta.brackets = 'square'; + parentNode.meta.dot = false; + ret = 'Array'; + } else { + const dotBracketEnd = preferred.match(/\.(?:<>)?$/u); + + if (dotBracketEnd) { + parentNode.meta.brackets = 'angle'; + parentNode.meta.dot = true; + ret = preferred.slice(0, -dotBracketEnd[0].length); + } else { + const bracketEnd = preferred.endsWith('<>'); + + if (bracketEnd) { + parentNode.meta.brackets = 'angle'; + parentNode.meta.dot = false; + ret = preferred.slice(0, -2); + } else if (parentNode.meta.brackets === 'square' && (nodeName === '[]' || nodeName === 'Array')) { + parentNode.meta.brackets = 'angle'; + parentNode.meta.dot = false; + } + } + } + } else if (type === 'JsdocTypeAny') { + node.type = 'JsdocTypeName'; + } + + node.value = ret.replace(/(?:\.|<>|\.<>|\[\])$/u, ''); // For bare pseudo-types like `<>` + + if (!ret) { + node.value = nodeName; + } +}; + +var _default = (0, _iterateJsdoc.default)(({ + jsdocNode, + sourceCode, + report, + utils, + settings, + context +}) => { + const jsdocTagsWithPossibleType = utils.filterTags(tag => { + return utils.tagMightHaveTypePosition(tag.tag); + }); + const { + preferredTypes, + structuredTags, + mode + } = settings; + const { + noDefaults, + unifyParentAndChildTypeChecks, + exemptTagContexts = [] + } = context.options[0] || {}; + + const getPreferredTypeInfo = (_type, nodeName, parentNode, property) => { + let hasMatchingPreferredType; + let isGenericMatch; + let typeName = nodeName; + + if (Object.keys(preferredTypes).length) { + const isNameOfGeneric = parentNode !== undefined && parentNode.type === 'JsdocTypeGeneric' && property === 'left'; + + if (unifyParentAndChildTypeChecks || isNameOfGeneric) { + var _parentNode$meta, _parentNode$meta2; + + const brackets = parentNode === null || parentNode === void 0 ? void 0 : (_parentNode$meta = parentNode.meta) === null || _parentNode$meta === void 0 ? void 0 : _parentNode$meta.brackets; + const dot = parentNode === null || parentNode === void 0 ? void 0 : (_parentNode$meta2 = parentNode.meta) === null || _parentNode$meta2 === void 0 ? void 0 : _parentNode$meta2.dot; + + if (brackets === 'angle') { + const checkPostFixes = dot ? ['.', '.<>'] : ['<>']; + isGenericMatch = checkPostFixes.some(checkPostFix => { + if ((preferredTypes === null || preferredTypes === void 0 ? void 0 : preferredTypes[nodeName + checkPostFix]) !== undefined) { + typeName += checkPostFix; + return true; + } + + return false; + }); + } + + if (!isGenericMatch && property) { + const checkPostFixes = dot ? ['.', '.<>'] : [brackets === 'angle' ? '<>' : '[]']; + isGenericMatch = checkPostFixes.some(checkPostFix => { + if ((preferredTypes === null || preferredTypes === void 0 ? void 0 : preferredTypes[checkPostFix]) !== undefined) { + typeName = checkPostFix; + return true; + } + + return false; + }); + } + } + + const directNameMatch = (preferredTypes === null || preferredTypes === void 0 ? void 0 : preferredTypes[nodeName]) !== undefined && !Object.values(preferredTypes).includes(nodeName); + const unifiedSyntaxParentMatch = property && directNameMatch && unifyParentAndChildTypeChecks; + isGenericMatch = isGenericMatch || unifiedSyntaxParentMatch; + hasMatchingPreferredType = isGenericMatch || directNameMatch && !property; + } + + return [hasMatchingPreferredType, typeName, isGenericMatch]; + }; + + for (const jsdocTag of jsdocTagsWithPossibleType) { + const invalidTypes = []; + let typeAst; + + try { + typeAst = mode === 'permissive' ? (0, _jsdocTypePrattParser.tryParse)(jsdocTag.type) : (0, _jsdocTypePrattParser.parse)(jsdocTag.type, mode); + } catch { + continue; + } + + const tagName = jsdocTag.tag; + (0, _jsdocTypePrattParser.traverse)(typeAst, (node, parentNode, property) => { + const { + type, + value + } = node; + + if (!['JsdocTypeName', 'JsdocTypeAny'].includes(type)) { + return; + } + + let nodeName = type === 'JsdocTypeAny' ? '*' : value; + const [hasMatchingPreferredType, typeName, isGenericMatch] = getPreferredTypeInfo(type, nodeName, parentNode, property); + let preferred; + let types; + + if (hasMatchingPreferredType) { + const preferredSetting = preferredTypes[typeName]; + nodeName = typeName === '[]' ? typeName : nodeName; + + if (!preferredSetting) { + invalidTypes.push([nodeName]); + } else if (typeof preferredSetting === 'string') { + preferred = preferredSetting; + invalidTypes.push([nodeName, preferred]); + } else if (typeof preferredSetting === 'object') { + preferred = preferredSetting === null || preferredSetting === void 0 ? void 0 : preferredSetting.replacement; + invalidTypes.push([nodeName, preferred, preferredSetting === null || preferredSetting === void 0 ? void 0 : preferredSetting.message]); + } else { + utils.reportSettings('Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.'); + return; + } + } else if (Object.entries(structuredTags).some(([tag, { + type: typs + }]) => { + types = typs; + return tag === tagName && Array.isArray(types) && !types.includes(nodeName); + })) { + invalidTypes.push([nodeName, types]); + } else if (!noDefaults && type === 'JsdocTypeName') { + for (const strictNativeType of strictNativeTypes) { + if (strictNativeType === 'object' && mode === 'typescript') { + continue; + } + + if (strictNativeType.toLowerCase() === nodeName.toLowerCase() && strictNativeType !== nodeName && ( // Don't report if user has own map for a strict native type + !preferredTypes || (preferredTypes === null || preferredTypes === void 0 ? void 0 : preferredTypes[strictNativeType]) === undefined)) { + preferred = strictNativeType; + invalidTypes.push([nodeName, preferred]); + break; + } + } + } // For fixer + + + if (preferred) { + adjustNames(type, preferred, isGenericMatch, nodeName, node, parentNode); + } + }); + + if (invalidTypes.length) { + const fixedType = (0, _jsdocTypePrattParser.stringify)(typeAst); + + const fix = fixer => { + return fixer.replaceText(jsdocNode, sourceCode.getText(jsdocNode).replace(`{${jsdocTag.type}}`, `{${fixedType}}`)); + }; + + for (const [badType, preferredType = '', message] of invalidTypes) { + const tagValue = jsdocTag.name ? ` "${jsdocTag.name}"` : ''; + + if (exemptTagContexts.some(({ + tag, + types + }) => { + return tag === tagName && (types === true || types.includes(jsdocTag.type)); + })) { + continue; + } + + report(message || `Invalid JSDoc @${tagName}${tagValue} type "${badType}"` + (preferredType ? '; ' : '.') + (preferredType ? `prefer: ${JSON.stringify(preferredType)}.` : ''), preferredType ? fix : null, jsdocTag, message ? { + tagName, + tagValue + } : null); + } + } + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Reports invalid types.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-types' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + exemptTagContexts: { + items: { + additionalProperties: false, + properties: { + tag: { + type: 'string' + }, + types: { + oneOf: [{ + type: 'boolean' + }, { + items: { + type: 'string' + }, + type: 'array' + }] + } + }, + type: 'object' + }, + type: 'array' + }, + noDefaults: { + type: 'boolean' + }, + unifyParentAndChildTypeChecks: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkTypes.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkValues.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkValues.js new file mode 100644 index 00000000000000..4b1f5a0da90ef7 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkValues.js @@ -0,0 +1,128 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _semver = _interopRequireDefault(require("semver")); + +var _spdxExpressionParse = _interopRequireDefault(require("spdx-expression-parse")); + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + utils, + report, + context +}) => { + const options = context.options[0] || {}; + const { + allowedLicenses = null, + allowedAuthors = null, + numericOnlyVariation = false, + licensePattern = '/([^\n\r]*)/gu' + } = options; + utils.forEachPreferredTag('version', (jsdocParameter, targetTagName) => { + const version = utils.getTagDescription(jsdocParameter).trim(); + + if (!version) { + report(`Missing JSDoc @${targetTagName} value.`, null, jsdocParameter); + } else if (!_semver.default.valid(version)) { + report(`Invalid JSDoc @${targetTagName}: "${utils.getTagDescription(jsdocParameter)}".`, null, jsdocParameter); + } + }); + + if (numericOnlyVariation) { + utils.forEachPreferredTag('variation', (jsdocParameter, targetTagName) => { + const variation = utils.getTagDescription(jsdocParameter).trim(); + + if (!variation) { + report(`Missing JSDoc @${targetTagName} value.`, null, jsdocParameter); + } else if (!Number.isInteger(Number(variation)) || Number(variation) <= 0) { + report(`Invalid JSDoc @${targetTagName}: "${utils.getTagDescription(jsdocParameter)}".`, null, jsdocParameter); + } + }); + } + + utils.forEachPreferredTag('since', (jsdocParameter, targetTagName) => { + const version = utils.getTagDescription(jsdocParameter).trim(); + + if (!version) { + report(`Missing JSDoc @${targetTagName} value.`, null, jsdocParameter); + } else if (!_semver.default.valid(version)) { + report(`Invalid JSDoc @${targetTagName}: "${utils.getTagDescription(jsdocParameter)}".`, null, jsdocParameter); + } + }); + utils.forEachPreferredTag('license', (jsdocParameter, targetTagName) => { + const licenseRegex = utils.getRegexFromString(licensePattern, 'g'); + const match = utils.getTagDescription(jsdocParameter).match(licenseRegex); + const license = match && match[1] || match[0]; + + if (!license.trim()) { + report(`Missing JSDoc @${targetTagName} value.`, null, jsdocParameter); + } else if (allowedLicenses) { + if (allowedLicenses !== true && !allowedLicenses.includes(license)) { + report(`Invalid JSDoc @${targetTagName}: "${license}"; expected one of ${allowedLicenses.join(', ')}.`, null, jsdocParameter); + } + } else { + try { + (0, _spdxExpressionParse.default)(license); + } catch { + report(`Invalid JSDoc @${targetTagName}: "${license}"; expected SPDX expression: https://spdx.org/licenses/.`, null, jsdocParameter); + } + } + }); + utils.forEachPreferredTag('author', (jsdocParameter, targetTagName) => { + const author = utils.getTagDescription(jsdocParameter).trim(); + + if (!author) { + report(`Missing JSDoc @${targetTagName} value.`, null, jsdocParameter); + } else if (allowedAuthors && !allowedAuthors.includes(author)) { + report(`Invalid JSDoc @${targetTagName}: "${utils.getTagDescription(jsdocParameter)}"; expected one of ${allowedAuthors.join(', ')}.`, null, jsdocParameter); + } + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'This rule checks the values for a handful of tags: `@version`, `@since`, `@license` and `@author`.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-values' + }, + schema: [{ + additionalProperties: false, + properties: { + allowedAuthors: { + items: { + type: 'string' + }, + type: 'array' + }, + allowedLicenses: { + anyOf: [{ + items: { + type: 'string' + }, + type: 'array' + }, { + type: 'boolean' + }] + }, + licensePattern: { + type: 'string' + }, + numericOnlyVariation: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=checkValues.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/emptyTags.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/emptyTags.js new file mode 100644 index 00000000000000..de493676a69900 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/emptyTags.js @@ -0,0 +1,73 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const defaultEmptyTags = new Set(['abstract', 'async', 'generator', 'global', 'hideconstructor', 'ignore', 'inner', 'instance', 'override', 'readonly', // jsdoc doesn't use this form in its docs, but allow for compatibility with +// TypeScript which allows and Closure which requires +'inheritDoc', // jsdoc doesn't use but allow for TypeScript +'internal']); +const emptyIfNotClosure = new Set(['package', 'private', 'protected', 'public', 'static', // Closure doesn't allow with this casing +'inheritdoc']); + +var _default = (0, _iterateJsdoc.default)(({ + settings, + jsdoc, + utils +}) => { + const emptyTags = utils.filterTags(({ + tag: tagName + }) => { + return defaultEmptyTags.has(tagName) || utils.hasOptionTag(tagName) && jsdoc.tags.some(({ + tag + }) => { + return tag === tagName; + }) || settings.mode !== 'closure' && emptyIfNotClosure.has(tagName); + }); + + for (const tag of emptyTags) { + const content = tag.name || tag.description || tag.type; + + if (content.trim()) { + const fix = () => { + utils.setTag(tag); + }; + + utils.reportJSDoc(`@${tag.tag} should be empty.`, tag, fix, true); + } + } +}, { + checkInternal: true, + checkPrivate: true, + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Expects specific tags to be empty of any content.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-empty-tags' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + tags: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=emptyTags.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/implementsOnClasses.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/implementsOnClasses.js new file mode 100644 index 00000000000000..600d403b588107 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/implementsOnClasses.js @@ -0,0 +1,67 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + const iteratingFunction = utils.isIteratingFunction(); + + if (iteratingFunction) { + if (utils.hasATag(['class', 'constructor']) || utils.isConstructor()) { + return; + } + } else if (!utils.isVirtualFunction()) { + return; + } + + utils.forEachPreferredTag('implements', tag => { + report('@implements used on a non-constructor function', null, tag); + }); +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Reports an issue with any non-constructor function using `@implements`.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-implements-on-classes' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=implementsOnClasses.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/matchDescription.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/matchDescription.js new file mode 100644 index 00000000000000..d0bb233b09b8d4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/matchDescription.js @@ -0,0 +1,208 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// If supporting Node >= 10, we could loosen the default to this for the +// initial letter: \\p{Upper} +const matchDescriptionDefault = '^[A-Z`\\d_][\\s\\S]*[.?!`]$'; + +const stringOrDefault = (value, userDefault) => { + return typeof value === 'string' ? value : userDefault || matchDescriptionDefault; +}; + +var _default = (0, _iterateJsdoc.default)(({ + jsdoc, + report, + context, + utils +}) => { + const { + mainDescription, + matchDescription, + message, + tags + } = context.options[0] || {}; + + const validateDescription = (description, tag) => { + let mainDescriptionMatch = mainDescription; + let errorMessage = message; + + if (typeof mainDescription === 'object') { + mainDescriptionMatch = mainDescription.match; + errorMessage = mainDescription.message; + } + + if (!tag && mainDescriptionMatch === false) { + return; + } + + let tagValue = mainDescriptionMatch; + + if (tag) { + const tagName = tag.tag; + + if (typeof tags[tagName] === 'object') { + tagValue = tags[tagName].match; + errorMessage = tags[tagName].message; + } else { + tagValue = tags[tagName]; + } + } + + const regex = utils.getRegexFromString(stringOrDefault(tagValue, matchDescription)); + + if (!regex.test(description)) { + report(errorMessage || 'JSDoc description does not satisfy the regex pattern.', null, tag || { + // Add one as description would typically be into block + line: jsdoc.source[0].number + 1 + }); + } + }; + + if (jsdoc.description) { + const { + description + } = utils.getDescription(); + validateDescription(description.replace(/\s+$/u, '')); + } + + if (!tags || !Object.keys(tags).length) { + return; + } + + const hasOptionTag = tagName => { + return Boolean(tags[tagName]); + }; + + utils.forEachPreferredTag('description', (matchingJsdocTag, targetTagName) => { + const description = (matchingJsdocTag.name + ' ' + utils.getTagDescription(matchingJsdocTag)).trim(); + + if (hasOptionTag(targetTagName)) { + validateDescription(description, matchingJsdocTag); + } + }, true); + const whitelistedTags = utils.filterTags(({ + tag: tagName + }) => { + return hasOptionTag(tagName); + }); + const { + tagsWithNames, + tagsWithoutNames + } = utils.getTagsByType(whitelistedTags); + tagsWithNames.some(tag => { + const description = utils.getTagDescription(tag).replace(/^[- ]*/u, '').trim(); + return validateDescription(description, tag); + }); + tagsWithoutNames.some(tag => { + const description = (tag.name + ' ' + utils.getTagDescription(tag)).trim(); + return validateDescription(description, tag); + }); +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Enforces a regular expression pattern on descriptions.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-match-description' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + mainDescription: { + oneOf: [{ + format: 'regex', + type: 'string' + }, { + type: 'boolean' + }, { + additionalProperties: false, + properties: { + match: { + oneOf: [{ + format: 'regex', + type: 'string' + }, { + type: 'boolean' + }] + }, + message: { + type: 'string' + } + }, + type: 'object' + }] + }, + matchDescription: { + format: 'regex', + type: 'string' + }, + message: { + type: 'string' + }, + tags: { + patternProperties: { + '.*': { + oneOf: [{ + format: 'regex', + type: 'string' + }, { + enum: [true], + type: 'boolean' + }, { + additionalProperties: false, + properties: { + match: { + oneOf: [{ + format: 'regex', + type: 'string' + }, { + enum: [true], + type: 'boolean' + }] + }, + message: { + type: 'string' + } + }, + type: 'object' + }] + } + }, + type: 'object' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=matchDescription.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/matchName.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/matchName.js new file mode 100644 index 00000000000000..f0259737901cf2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/matchName.js @@ -0,0 +1,139 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eslint-disable-next-line complexity +var _default = (0, _iterateJsdoc.default)(({ + context, + jsdoc, + report, + info: { + lastIndex + }, + utils +}) => { + const { + match + } = context.options[0] || {}; + + if (!match) { + report('Rule `no-restricted-syntax` is missing a `match` option.'); + return; + } + + const { + allowName, + disallowName, + replacement, + tags = ['*'] + } = match[lastIndex]; + const allowNameRegex = allowName && utils.getRegexFromString(allowName); + const disallowNameRegex = disallowName && utils.getRegexFromString(disallowName); + let applicableTags = jsdoc.tags; + + if (!tags.includes('*')) { + applicableTags = utils.getPresentTags(tags); + } + + let reported = false; + + for (const tag of applicableTags) { + const allowed = !allowNameRegex || allowNameRegex.test(tag.name); + const disallowed = disallowNameRegex && disallowNameRegex.test(tag.name); + const hasRegex = allowNameRegex || disallowNameRegex; + + if (hasRegex && allowed && !disallowed) { + continue; + } + + if (!hasRegex && reported) { + continue; + } + + const fixer = () => { + tag.source[0].tokens.name = tag.source[0].tokens.name.replace(disallowNameRegex, replacement); + }; + + let { + message + } = match[lastIndex]; + + if (!message) { + if (hasRegex) { + message = disallowed ? `Only allowing names not matching \`${disallowNameRegex}\` but found "${tag.name}".` : `Only allowing names matching \`${allowNameRegex}\` but found "${tag.name}".`; + } else { + message = `Prohibited context for "${tag.name}".`; + } + } + + utils.reportJSDoc(message, hasRegex ? tag : null, // We could match up + disallowNameRegex && replacement !== undefined ? fixer : null, false, { + // Could also supply `context`, `comment`, `tags` + allowName, + disallowName, + name: tag.name + }); + + if (!hasRegex) { + reported = true; + } + } +}, { + matchContext: true, + meta: { + docs: { + description: 'Reports the name portion of a JSDoc tag if matching or not matching a given regular expression.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-match-name' + }, + fixable: 'code', + schema: [{ + additionalProperies: false, + properties: { + match: { + additionalProperies: false, + items: { + properties: { + allowName: { + type: 'string' + }, + comment: { + type: 'string' + }, + context: { + type: 'string' + }, + disallowName: { + type: 'string' + }, + message: { + type: 'string' + }, + tags: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }, + type: 'array' + } + }, + required: ['match'], + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=matchName.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/multilineBlocks.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/multilineBlocks.js new file mode 100644 index 00000000000000..f12aeff8ab0a61 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/multilineBlocks.js @@ -0,0 +1,251 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + context, + jsdoc, + utils +}) => { + const { + allowMultipleTags = true, + noFinalLineText = true, + noZeroLineText = true, + noSingleLineBlocks = false, + singleLineTags = ['lends', 'type'], + noMultilineBlocks = false, + minimumLengthForMultiline = Number.POSITIVE_INFINITY, + multilineTags = ['*'] + } = context.options[0] || {}; + const { + source: [{ + tokens + }] + } = jsdoc; + const { + description, + tag + } = tokens; + const sourceLength = jsdoc.source.length; + + const isInvalidSingleLine = tagName => { + return noSingleLineBlocks && (!tagName || !singleLineTags.includes(tagName) && !singleLineTags.includes('*')); + }; + + if (sourceLength === 1) { + if (!isInvalidSingleLine(tag.slice(1))) { + return; + } + + const fixer = () => { + utils.makeMultiline(); + }; + + utils.reportJSDoc('Single line blocks are not permitted by your configuration.', null, fixer, true); + return; + } + + const lineChecks = () => { + if (noZeroLineText && (tag || description)) { + const fixer = () => { + const line = { ...tokens + }; + utils.emptyTokens(tokens); + const { + tokens: { + delimiter, + start + } + } = jsdoc.source[1]; + utils.addLine(1, { ...line, + delimiter, + start + }); + }; + + utils.reportJSDoc('Should have no text on the "0th" line (after the `/**`).', null, fixer); + return; + } + + const finalLine = jsdoc.source[jsdoc.source.length - 1]; + const finalLineTokens = finalLine.tokens; + + if (noFinalLineText && finalLineTokens.description.trim()) { + const fixer = () => { + const line = { ...finalLineTokens + }; + line.description = line.description.trimEnd(); + const { + delimiter + } = line; + + for (const prop of ['delimiter', 'postDelimiter', 'tag', 'type', 'lineEnd', 'postType', 'postTag', 'name', 'postName', 'description']) { + finalLineTokens[prop] = ''; + } + + utils.addLine(jsdoc.source.length - 1, { ...line, + delimiter, + end: '' + }); + }; + + utils.reportJSDoc('Should have no text on the final line (before the `*/`).', null, fixer); + } + }; + + if (noMultilineBlocks) { + if (jsdoc.tags.length && (multilineTags.includes('*') || utils.hasATag(multilineTags))) { + lineChecks(); + return; + } + + if (jsdoc.description.length >= minimumLengthForMultiline) { + lineChecks(); + return; + } + + if (noSingleLineBlocks && (!jsdoc.tags.length || !utils.filterTags(({ + tag: tg + }) => { + return !isInvalidSingleLine(tg); + }).length)) { + utils.reportJSDoc('Multiline jsdoc blocks are prohibited by ' + 'your configuration but fixing would result in a single ' + 'line block which you have prohibited with `noSingleLineBlocks`.'); + return; + } + + if (jsdoc.tags.length > 1) { + if (!allowMultipleTags) { + utils.reportJSDoc('Multiline jsdoc blocks are prohibited by ' + 'your configuration but the block has multiple tags.'); + return; + } + } else if (jsdoc.tags.length === 1 && jsdoc.description.trim()) { + if (!allowMultipleTags) { + utils.reportJSDoc('Multiline jsdoc blocks are prohibited by ' + 'your configuration but the block has a description with a tag.'); + return; + } + } else { + const fixer = () => { + jsdoc.source = [{ + number: 1, + source: '', + tokens: jsdoc.source.reduce((obj, { + tokens: { + description: desc, + tag: tg, + type: typ, + name: nme, + lineEnd, + postType, + postName, + postTag + } + }) => { + if (typ) { + obj.type = typ; + } + + if (tg && typ && nme) { + obj.postType = postType; + } + + if (nme) { + obj.name += nme; + } + + if (nme && desc) { + obj.postName = postName; + } + + obj.description += desc; + const nameOrDescription = obj.description || obj.name; + + if (nameOrDescription && nameOrDescription.slice(-1) !== ' ') { + obj.description += ' '; + } + + obj.lineEnd = lineEnd; // Already filtered for multiple tags + + obj.tag += tg; + + if (tg) { + obj.postTag = postTag || ' '; + } + + return obj; + }, utils.seedTokens({ + delimiter: '/**', + end: '*/', + postDelimiter: ' ' + })) + }]; + }; + + utils.reportJSDoc('Multiline jsdoc blocks are prohibited by ' + 'your configuration.', null, fixer); + return; + } + } + + lineChecks(); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Controls how and whether jsdoc blocks can be expressed as single or multiple line blocks.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-multiline-blocks' + }, + fixable: 'code', + schema: [{ + additionalProperies: false, + properties: { + allowMultipleTags: { + type: 'boolean' + }, + minimumLengthForMultiline: { + type: 'integer' + }, + multilineTags: { + anyOf: [{ + enum: ['*'], + type: 'string' + }, { + items: { + type: 'string' + }, + type: 'array' + }] + }, + noFinalLineText: { + type: 'boolean' + }, + noMultilineBlocks: { + type: 'boolean' + }, + noSingleLineBlocks: { + type: 'boolean' + }, + noZeroLineText: { + type: 'boolean' + }, + singleLineTags: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=multilineBlocks.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/newlineAfterDescription.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/newlineAfterDescription.js new file mode 100644 index 00000000000000..b5029a7f9e3a9b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/newlineAfterDescription.js @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + jsdoc, + report, + context, + jsdocNode, + sourceCode, + indent, + utils +}) => { + let always; + + if (!jsdoc.description.trim() || !jsdoc.tags.length) { + return; + } + + if (0 in context.options) { + always = context.options[0] === 'always'; + } else { + always = true; + } + + const { + description, + lastDescriptionLine + } = utils.getDescription(); + const descriptionEndsWithANewline = /\n\r?$/u.test(description); + + if (always) { + if (!descriptionEndsWithANewline) { + const sourceLines = sourceCode.getText(jsdocNode).split('\n'); + report('There must be a newline after the description of the JSDoc block.', fixer => { + // Add the new line + const injectedLine = `${indent} *` + (sourceLines[lastDescriptionLine].endsWith('\r') ? '\r' : ''); + sourceLines.splice(lastDescriptionLine + 1, 0, injectedLine); + return fixer.replaceText(jsdocNode, sourceLines.join('\n')); + }, { + line: lastDescriptionLine + }); + } + } else if (descriptionEndsWithANewline) { + const sourceLines = sourceCode.getText(jsdocNode).split('\n'); + report('There must be no newline after the description of the JSDoc block.', fixer => { + // Remove the extra line + sourceLines.splice(lastDescriptionLine, 1); + return fixer.replaceText(jsdocNode, sourceLines.join('\n')); + }, { + line: lastDescriptionLine + }); + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Enforces a consistent padding of the block description.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-newline-after-description' + }, + fixable: 'whitespace', + schema: [{ + enum: ['always', 'never'], + type: 'string' + }], + type: 'layout' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=newlineAfterDescription.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noBadBlocks.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noBadBlocks.js new file mode 100644 index 00000000000000..38751594141453 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noBadBlocks.js @@ -0,0 +1,104 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _commentParser = require("comment-parser"); + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Neither a single nor 3+ asterisks are valid jsdoc per +// https://jsdoc.app/about-getting-started.html#adding-documentation-comments-to-your-code +const commentRegexp = /^\/\*(?!\*)/u; +const extraAsteriskCommentRegexp = /^\/\*{3,}/u; + +var _default = (0, _iterateJsdoc.default)(({ + context, + sourceCode, + allComments, + makeReport +}) => { + const [{ + ignore = ['ts-check', 'ts-expect-error', 'ts-ignore', 'ts-nocheck'], + preventAllMultiAsteriskBlocks = false + } = {}] = context.options; + let extraAsterisks = false; + const nonJsdocNodes = allComments.filter(comment => { + const commentText = sourceCode.getText(comment); + let sliceIndex = 2; + + if (!commentRegexp.test(commentText)) { + var _extraAsteriskComment; + + const multiline = (_extraAsteriskComment = extraAsteriskCommentRegexp.exec(commentText)) === null || _extraAsteriskComment === void 0 ? void 0 : _extraAsteriskComment[0]; + + if (!multiline) { + return false; + } + + sliceIndex = multiline.length; + extraAsterisks = true; + + if (preventAllMultiAsteriskBlocks) { + return true; + } + } + + const [{ + tags = {} + } = {}] = (0, _commentParser.parse)(`${commentText.slice(0, 2)}*${commentText.slice(sliceIndex)}`); + return tags.length && !tags.some(({ + tag + }) => { + return ignore.includes(tag); + }); + }); + + if (!nonJsdocNodes.length) { + return; + } + + for (const node of nonJsdocNodes) { + const report = makeReport(context, node); // eslint-disable-next-line no-loop-func + + const fix = fixer => { + const text = sourceCode.getText(node); + return fixer.replaceText(node, extraAsterisks ? text.replace(extraAsteriskCommentRegexp, '/**') : text.replace('/*', '/**')); + }; + + report('Expected JSDoc-like comment to begin with two asterisks.', fix); + } +}, { + checkFile: true, + meta: { + docs: { + description: 'This rule checks for multi-line-style comments which fail to meet the criteria of a jsdoc block.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-bad-blocks' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + ignore: { + items: { + type: 'string' + }, + type: 'array' + }, + preventAllMultiAsteriskBlocks: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'layout' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=noBadBlocks.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noDefaults.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noDefaults.js new file mode 100644 index 00000000000000..e8f52ce3b06427 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noDefaults.js @@ -0,0 +1,91 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + context, + utils +}) => { + const { + noOptionalParamNames + } = context.options[0] || {}; + const paramTags = utils.getPresentTags(['param', 'arg', 'argument']); + + for (const tag of paramTags) { + if (noOptionalParamNames && tag.optional) { + utils.reportJSDoc(`Optional param names are not permitted on @${tag.tag}.`, tag, () => { + utils.changeTag(tag, { + name: tag.name.replace(/([^=]*)(=.+)?/u, '$1') + }); + }); + } else if (tag.default) { + utils.reportJSDoc(`Defaults are not permitted on @${tag.tag}.`, tag, () => { + utils.changeTag(tag, { + name: tag.name.replace(/([^=]*)(=.+)?/u, '[$1]') + }); + }); + } + } + + const defaultTags = utils.getPresentTags(['default', 'defaultvalue']); + + for (const tag of defaultTags) { + if (tag.description.trim()) { + utils.reportJSDoc(`Default values are not permitted on @${tag.tag}.`, tag, () => { + utils.changeTag(tag, { + description: '', + postTag: '' + }); + }); + } + } +}, { + contextDefaults: true, + meta: { + docs: { + description: 'This rule reports defaults being used on the relevant portion of `@param` or `@default`.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-defaults' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + noOptionalParamNames: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=noDefaults.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js new file mode 100644 index 00000000000000..493c26e4d9f818 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMissingSyntax.js @@ -0,0 +1,144 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const setDefaults = state => { + if (!state.selectorMap) { + state.selectorMap = {}; + } +}; + +const incrementSelector = (state, selector, comment) => { + if (!state.selectorMap[selector]) { + state.selectorMap[selector] = {}; + } + + if (!state.selectorMap[selector][comment]) { + state.selectorMap[selector][comment] = 0; + } + + state.selectorMap[selector][comment]++; +}; + +var _default = (0, _iterateJsdoc.default)(({ + info: { + selector, + comment + }, + state +}) => { + setDefaults(state); + incrementSelector(state, selector, comment); +}, { + contextSelected: true, + + exit({ + context, + state + }) { + if (!context.options.length) { + context.report({ + loc: { + start: { + column: 1, + line: 1 + } + }, + message: 'Rule `no-missing-syntax` is missing a `context` option.' + }); + return; + } + + setDefaults(state); + const { + contexts + } = context.options[0]; // Report when MISSING + + contexts.some(cntxt => { + var _cntxt$context, _cntxt$comment, _cntxt$minimum; + + const contextStr = typeof cntxt === 'object' ? (_cntxt$context = cntxt.context) !== null && _cntxt$context !== void 0 ? _cntxt$context : 'any' : cntxt; + const comment = (_cntxt$comment = cntxt === null || cntxt === void 0 ? void 0 : cntxt.comment) !== null && _cntxt$comment !== void 0 ? _cntxt$comment : ''; + const contextKey = contextStr === 'any' ? undefined : contextStr; + + if ((!state.selectorMap[contextKey] || !state.selectorMap[contextKey][comment] || state.selectorMap[contextKey][comment] < ((_cntxt$minimum = cntxt === null || cntxt === void 0 ? void 0 : cntxt.minimum) !== null && _cntxt$minimum !== void 0 ? _cntxt$minimum : 1)) && (contextStr !== 'any' || Object.values(state.selectorMap).every(cmmnt => { + var _cntxt$minimum2; + + return !cmmnt[comment] || cmmnt[comment] < ((_cntxt$minimum2 = cntxt === null || cntxt === void 0 ? void 0 : cntxt.minimum) !== null && _cntxt$minimum2 !== void 0 ? _cntxt$minimum2 : 1); + }))) { + var _cntxt$message; + + const message = (_cntxt$message = cntxt === null || cntxt === void 0 ? void 0 : cntxt.message) !== null && _cntxt$message !== void 0 ? _cntxt$message : 'Syntax is required: {{context}}' + (comment ? ' with {{comment}}' : ''); + context.report({ + data: { + comment, + context: contextStr + }, + loc: { + end: { + line: 1 + }, + start: { + line: 1 + } + }, + message + }); + return true; + } + + return false; + }); + }, + + meta: { + docs: { + description: 'Reports when certain comment structures are always expected.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-missing-syntax' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + }, + message: { + type: 'string' + }, + minimum: { + type: 'integer' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=noMissingSyntax.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMultiAsterisks.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMultiAsterisks.js new file mode 100644 index 00000000000000..66a413a01e0606 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noMultiAsterisks.js @@ -0,0 +1,99 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const middleAsterisks = /^([\t ]|\*(?!\*))+/u; + +var _default = (0, _iterateJsdoc.default)(({ + context, + jsdoc, + utils +}) => { + const { + preventAtEnd = true, + preventAtMiddleLines = true + } = context.options[0] || {}; + jsdoc.source.some(({ + tokens, + number + }) => { + const { + delimiter, + tag, + name, + type, + description, + end + } = tokens; + + if (preventAtMiddleLines && !end && !tag && !type && !name && middleAsterisks.test(description)) { + const fix = () => { + tokens.description = description.replace(middleAsterisks, ''); + }; + + utils.reportJSDoc('Should be no multiple asterisks on middle lines.', { + line: number + }, fix, true); + return true; + } + + if (!preventAtEnd || !end) { + return false; + } + + const isSingleLineBlock = delimiter === '/**'; + const delim = isSingleLineBlock ? '*' : delimiter; + const endAsterisks = isSingleLineBlock ? /\*((?:\*|(?: |\t))*)\*$/u : /((?:\*|(?: |\t))*)\*$/u; + const endingAsterisksAndSpaces = (description + delim).match(endAsterisks); + + if (!endingAsterisksAndSpaces || !isSingleLineBlock && endingAsterisksAndSpaces[1] && !endingAsterisksAndSpaces[1].trim()) { + return false; + } + + const endFix = () => { + if (!isSingleLineBlock) { + tokens.delimiter = ''; + } + + tokens.description = (description + delim).replace(endAsterisks, ''); + }; + + utils.reportJSDoc('Should be no multiple asterisks on end lines.', { + line: number + }, endFix, true); + return true; + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: '', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-multi-asterisks' + }, + fixable: 'code', + schema: [{ + additionalProperies: false, + properties: { + preventAtEnd: { + type: 'boolean' + }, + preventAtMiddleLines: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=noMultiAsterisks.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noRestrictedSyntax.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noRestrictedSyntax.js new file mode 100644 index 00000000000000..ffd44cee98d345 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noRestrictedSyntax.js @@ -0,0 +1,81 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + context, + info: { + selector, + comment + }, + report +}) => { + var _foundContext$context, _foundContext$message; + + if (!context.options.length) { + report('Rule `no-restricted-syntax` is missing a `context` option.'); + return; + } + + const { + contexts + } = context.options[0]; + const foundContext = contexts.find(cntxt => { + return cntxt === selector || typeof cntxt === 'object' && (!cntxt.context || cntxt.context === 'any' || selector === cntxt.context) && comment === cntxt.comment; + }); + const contextStr = typeof foundContext === 'object' ? (_foundContext$context = foundContext.context) !== null && _foundContext$context !== void 0 ? _foundContext$context : 'any' : foundContext; + const message = (_foundContext$message = foundContext === null || foundContext === void 0 ? void 0 : foundContext.message) !== null && _foundContext$message !== void 0 ? _foundContext$message : 'Syntax is restricted: {{context}}.'; + report(message, null, null, { + context: contextStr + }); +}, { + contextSelected: true, + meta: { + docs: { + description: 'Reports when certain comment structures are present.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-restricted-syntax' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + }, + message: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + required: ['contexts'], + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=noRestrictedSyntax.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noTypes.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noTypes.js new file mode 100644 index 00000000000000..c56878ab48d6b3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noTypes.js @@ -0,0 +1,76 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const removeType = ({ + tokens +}) => { + tokens.postTag = ''; + tokens.type = ''; +}; + +var _default = (0, _iterateJsdoc.default)(({ + utils +}) => { + if (!utils.isIteratingFunction() && !utils.isVirtualFunction()) { + return; + } + + const tags = utils.getPresentTags(['param', 'arg', 'argument', 'returns', 'return']); + + for (const tag of tags) { + if (tag.type) { + utils.reportJSDoc(`Types are not permitted on @${tag.tag}.`, tag, () => { + for (const source of tag.source) { + removeType(source); + } + }); + } + } +}, { + contextDefaults: true, + meta: { + docs: { + description: 'This rule reports types being used on `@param` or `@returns`.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-types' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=noTypes.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noUndefinedTypes.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noUndefinedTypes.js new file mode 100644 index 00000000000000..20cae0bcb6f560 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/noUndefinedTypes.js @@ -0,0 +1,198 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _jsdoccomment = require("@es-joy/jsdoccomment"); + +var _jsdocTypePrattParser = require("jsdoc-type-pratt-parser"); + +var _iterateJsdoc = _interopRequireWildcard(require("../iterateJsdoc")); + +var _jsdocUtils = _interopRequireDefault(require("../jsdocUtils")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const extraTypes = ['null', 'undefined', 'void', 'string', 'boolean', 'object', 'function', 'symbol', 'number', 'bigint', 'NaN', 'Infinity', 'any', '*', 'this', 'true', 'false', 'Array', 'Object', 'RegExp', 'Date', 'Function']; + +const stripPseudoTypes = str => { + return str && str.replace(/(?:\.|<>|\.<>|\[\])$/u, ''); +}; + +var _default = (0, _iterateJsdoc.default)(({ + context, + node, + report, + settings, + sourceCode, + utils +}) => { + var _globalScope$childSco; + + const { + scopeManager + } = sourceCode; + const { + globalScope + } = scopeManager; + const { + definedTypes = [] + } = context.options[0] || {}; + let definedPreferredTypes = []; + const { + preferredTypes, + structuredTags, + mode + } = settings; + + if (Object.keys(preferredTypes).length) { + definedPreferredTypes = Object.values(preferredTypes).map(preferredType => { + if (typeof preferredType === 'string') { + // May become an empty string but will be filtered out below + return stripPseudoTypes(preferredType); + } + + if (!preferredType) { + return undefined; + } + + if (typeof preferredType !== 'object') { + utils.reportSettings('Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.'); + } + + return stripPseudoTypes(preferredType.replacement); + }).filter(preferredType => { + return preferredType; + }); + } + + const typedefDeclarations = context.getAllComments().filter(comment => { + return comment.value.startsWith('*'); + }).map(commentNode => { + return (0, _iterateJsdoc.parseComment)(commentNode, ''); + }).flatMap(doc => { + return doc.tags.filter(({ + tag + }) => { + return utils.isNamepathDefiningTag(tag); + }); + }).map(tag => { + return tag.name; + }); + const ancestorNodes = []; + let currentScope = scopeManager.acquire(node); + + while (currentScope && currentScope.block.type !== 'Program') { + ancestorNodes.push(currentScope.block); + currentScope = currentScope.upper; + } // `currentScope` may be `null` or `Program`, so in such a case, + // we look to present tags instead + + + let templateTags = ancestorNodes.length ? ancestorNodes.flatMap(ancestorNode => { + const commentNode = (0, _jsdoccomment.getJSDocComment)(sourceCode, ancestorNode, settings); + + if (!commentNode) { + return []; + } + + const jsdoc = (0, _iterateJsdoc.parseComment)(commentNode, ''); + return _jsdocUtils.default.filterTags(jsdoc.tags, tag => { + return tag.tag === 'template'; + }); + }) : utils.getPresentTags('template'); + const classJsdoc = utils.getClassJsdoc(); + + if (classJsdoc !== null && classJsdoc !== void 0 && classJsdoc.tags) { + templateTags = templateTags.concat(classJsdoc.tags.filter(({ + tag + }) => { + return tag === 'template'; + })); + } + + const closureGenericTypes = templateTags.flatMap(tag => { + return utils.parseClosureTemplateTag(tag); + }); // In modules, including Node, there is a global scope at top with the + // Program scope inside + + const cjsOrESMScope = ((_globalScope$childSco = globalScope.childScopes[0]) === null || _globalScope$childSco === void 0 ? void 0 : _globalScope$childSco.block.type) === 'Program'; + const allDefinedTypes = new Set(globalScope.variables.map(({ + name + }) => { + return name; + }) // If the file is a module, concat the variables from the module scope. + .concat(cjsOrESMScope ? globalScope.childScopes.flatMap(({ + variables + }) => { + return variables; + }).map(({ + name + }) => { + return name; + }) : []).concat(extraTypes).concat(typedefDeclarations).concat(definedTypes).concat(definedPreferredTypes).concat(settings.mode === 'jsdoc' ? [] : closureGenericTypes)); + const jsdocTagsWithPossibleType = utils.filterTags(({ + tag + }) => { + return utils.tagMightHaveTypePosition(tag); + }); + + for (const tag of jsdocTagsWithPossibleType) { + let parsedType; + + try { + parsedType = mode === 'permissive' ? (0, _jsdocTypePrattParser.tryParse)(tag.type) : (0, _jsdocTypePrattParser.parse)(tag.type, mode); + } catch { + // On syntax error, will be handled by valid-types. + continue; + } + + (0, _jsdocTypePrattParser.traverse)(parsedType, ({ + type, + value + }) => { + if (type === 'JsdocTypeName') { + var _structuredTags$tag$t; + + const structuredTypes = (_structuredTags$tag$t = structuredTags[tag.tag]) === null || _structuredTags$tag$t === void 0 ? void 0 : _structuredTags$tag$t.type; + + if (!allDefinedTypes.has(value) && (!Array.isArray(structuredTypes) || !structuredTypes.includes(value))) { + report(`The type '${value}' is undefined.`, null, tag); + } else if (!extraTypes.includes(value)) { + context.markVariableAsUsed(value); + } + } + }); + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Checks that types in jsdoc comments are defined.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-undefined-types' + }, + schema: [{ + additionalProperties: false, + properties: { + definedTypes: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=noUndefinedTypes.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireAsteriskPrefix.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireAsteriskPrefix.js new file mode 100644 index 00000000000000..21d728def8200e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireAsteriskPrefix.js @@ -0,0 +1,167 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + context, + jsdoc, + utils, + indent +}) => { + const [defaultRequireValue = 'always', { + tags: tagMap = {} + } = {}] = context.options; + const { + source + } = jsdoc; + const always = defaultRequireValue === 'always'; + const never = defaultRequireValue === 'never'; + let currentTag; + source.some(({ + number, + tokens + }) => { + var _tagMap$any2; + + const { + delimiter, + tag, + end, + description + } = tokens; + + const neverFix = () => { + tokens.delimiter = ''; + tokens.postDelimiter = ''; + }; + + const checkNever = checkValue => { + var _tagMap$always, _tagMap$never; + + if (delimiter && delimiter !== '/**' && (never && !((_tagMap$always = tagMap.always) !== null && _tagMap$always !== void 0 && _tagMap$always.includes(checkValue)) || (_tagMap$never = tagMap.never) !== null && _tagMap$never !== void 0 && _tagMap$never.includes(checkValue))) { + utils.reportJSDoc('Expected JSDoc line to have no prefix.', { + column: 0, + line: number + }, neverFix); + return true; + } + + return false; + }; + + const alwaysFix = () => { + if (!tokens.start) { + tokens.start = indent + ' '; + } + + tokens.delimiter = '*'; + tokens.postDelimiter = tag || description ? ' ' : ''; + }; + + const checkAlways = checkValue => { + var _tagMap$never2, _tagMap$always2; + + if (!delimiter && (always && !((_tagMap$never2 = tagMap.never) !== null && _tagMap$never2 !== void 0 && _tagMap$never2.includes(checkValue)) || (_tagMap$always2 = tagMap.always) !== null && _tagMap$always2 !== void 0 && _tagMap$always2.includes(checkValue))) { + utils.reportJSDoc('Expected JSDoc line to have the prefix.', { + column: 0, + line: number + }, alwaysFix); + return true; + } + + return false; + }; + + if (tag) { + // Remove at sign + currentTag = tag.slice(1); + } + + if ( // If this is the end but has a tag, the delimiter will also be + // populated and will be safely ignored later + end && !tag) { + return false; + } + + if (!currentTag) { + var _tagMap$any; + + if ((_tagMap$any = tagMap.any) !== null && _tagMap$any !== void 0 && _tagMap$any.includes('*description')) { + return false; + } + + if (checkNever('*description')) { + return true; + } + + if (checkAlways('*description')) { + return true; + } + + return false; + } + + if ((_tagMap$any2 = tagMap.any) !== null && _tagMap$any2 !== void 0 && _tagMap$any2.includes(currentTag)) { + return false; + } + + if (checkNever(currentTag)) { + return true; + } + + if (checkAlways(currentTag)) { + return true; + } + + return false; + }); +}, { + iterateAllJsdocs: true, + meta: { + fixable: 'code', + schema: [{ + enum: ['always', 'never', 'any'], + type: 'string' + }, { + additionalProperties: false, + properties: { + tags: { + properties: { + always: { + items: { + type: 'string' + }, + type: 'array' + }, + any: { + items: { + type: 'string' + }, + type: 'array' + }, + never: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + } + }, + type: 'object' + }], + type: 'layout' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireAsteriskPrefix.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescription.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescription.js new file mode 100644 index 00000000000000..28de8f74230c1a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescription.js @@ -0,0 +1,149 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const checkDescription = description => { + return description.trim().split('\n').filter(Boolean).length; +}; + +var _default = (0, _iterateJsdoc.default)(({ + jsdoc, + report, + utils, + context +}) => { + if (utils.avoidDocs()) { + return; + } + + const { + descriptionStyle = 'body' + } = context.options[0] || {}; + let targetTagName = utils.getPreferredTagName({ + // We skip reporting except when `@description` is essential to the rule, + // so user can block the tag and still meaningfully use this rule + // even if the tag is present (and `check-tag-names` is the one to + // normally report the fact that it is blocked but present) + skipReportingBlockedTag: descriptionStyle !== 'tag', + tagName: 'description' + }); + + if (!targetTagName) { + return; + } + + const isBlocked = typeof targetTagName === 'object' && targetTagName.blocked; + + if (isBlocked) { + targetTagName = targetTagName.tagName; + } + + if (descriptionStyle !== 'tag') { + const { + description + } = utils.getDescription(); + + if (checkDescription(description || '')) { + return; + } + + if (descriptionStyle === 'body') { + const descTags = utils.getPresentTags(['desc', 'description']); + + if (descTags.length) { + const [{ + tag: tagName + }] = descTags; + report(`Remove the @${tagName} tag to leave a plain block description or add additional description text above the @${tagName} line.`); + } else { + report('Missing JSDoc block description.'); + } + + return; + } + } + + const functionExamples = isBlocked ? [] : jsdoc.tags.filter(({ + tag + }) => { + return tag === targetTagName; + }); + + if (!functionExamples.length) { + report(descriptionStyle === 'any' ? `Missing JSDoc block description or @${targetTagName} declaration.` : `Missing JSDoc @${targetTagName} declaration.`); + return; + } + + for (const example of functionExamples) { + if (!checkDescription(`${example.name} ${utils.getTagDescription(example)}`)) { + report(`Missing JSDoc @${targetTagName} description.`, null, example); + } + } +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that all functions have a description.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-description' + }, + schema: [{ + additionalProperties: false, + properties: { + checkConstructors: { + default: true, + type: 'boolean' + }, + checkGetters: { + default: true, + type: 'boolean' + }, + checkSetters: { + default: true, + type: 'boolean' + }, + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + descriptionStyle: { + enum: ['body', 'tag', 'any'], + type: 'string' + }, + exemptedBy: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireDescription.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescriptionCompleteSentence.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescriptionCompleteSentence.js new file mode 100644 index 00000000000000..5f72084c9b84ec --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireDescriptionCompleteSentence.js @@ -0,0 +1,221 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _escapeStringRegexp = _interopRequireDefault(require("escape-string-regexp")); + +var _mainUmd = require("regextras/dist/main-umd"); + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const otherDescriptiveTags = new Set([// 'copyright' and 'see' might be good addition, but as the former may be +// sensitive text, and the latter may have just a link, they are not +// included by default +'summary', 'file', 'fileoverview', 'overview', 'classdesc', 'todo', 'deprecated', 'throws', 'exception', 'yields', 'yield']); + +const extractParagraphs = text => { + return text.split(/(? { + const txt = text // Remove all {} tags. + .replace(/\{[\s\S]*?\}\s*/gu, '') // Remove custom abbreviations + .replace(abbreviationsRegex, ''); + const sentenceEndGrouping = /([.?!])(?:\s+|$)/u; // eslint-disable-next-line unicorn/no-array-method-this-argument + + const puncts = new _mainUmd.RegExtras(sentenceEndGrouping).map(txt, punct => { + return punct; + }); + return txt.split(/[.?!](?:\s+|$)/u) // Re-add the dot. + .map((sentence, idx) => { + return /^\s*$/u.test(sentence) ? sentence : `${sentence}${puncts[idx] || ''}`; + }); +}; + +const isNewLinePrecededByAPeriod = text => { + let lastLineEndsSentence; + const lines = text.split('\n'); + return !lines.some(line => { + if (lastLineEndsSentence === false && /^[A-Z][a-z]/u.test(line)) { + return true; + } + + lastLineEndsSentence = /[.:?!|]$/u.test(line); + return false; + }); +}; + +const isCapitalized = str => { + return str[0] === str[0].toUpperCase(); +}; + +const isTable = str => { + return str.charAt() === '|'; +}; + +const capitalize = str => { + return str.charAt(0).toUpperCase() + str.slice(1); +}; + +const validateDescription = (description, reportOrig, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd) => { + if (!description) { + return false; + } + + const paragraphs = extractParagraphs(description); + return paragraphs.some((paragraph, parIdx) => { + const sentences = extractSentences(paragraph, abbreviationsRegex); + + const fix = fixer => { + let text = sourceCode.getText(jsdocNode); + + if (!/[.:?!]$/u.test(paragraph)) { + const line = paragraph.split('\n').pop(); + text = text.replace(new RegExp(`${(0, _escapeStringRegexp.default)(line)}$`, 'mu'), `${line}.`); + } + + for (const sentence of sentences.filter(sentence_ => { + return !/^\s*$/u.test(sentence_) && !isCapitalized(sentence_) && !isTable(sentence_); + })) { + const beginning = sentence.split('\n')[0]; + + if (tag.tag) { + const reg = new RegExp(`(@${(0, _escapeStringRegexp.default)(tag.tag)}.*)${(0, _escapeStringRegexp.default)(beginning)}`, 'u'); + text = text.replace(reg, (_$0, $1) => { + return $1 + capitalize(beginning); + }); + } else { + text = text.replace(new RegExp('((?:[.!?]|\\*|\\})\\s*)' + (0, _escapeStringRegexp.default)(beginning), 'u'), '$1' + capitalize(beginning)); + } + } + + return fixer.replaceText(jsdocNode, text); + }; + + const report = (msg, fixer, tagObj) => { + if ('line' in tagObj) { + tagObj.line += parIdx * 2; + } else { + tagObj.source[0].number += parIdx * 2; + } // Avoid errors if old column doesn't exist here + + + tagObj.column = 0; + reportOrig(msg, fixer, tagObj); + }; + + if (sentences.some(sentence => { + return !/^\s*$/u.test(sentence) && !isCapitalized(sentence) && !isTable(sentence); + })) { + report('Sentence should start with an uppercase character.', fix, tag); + } + + const paragraphNoAbbreviations = paragraph.replace(abbreviationsRegex, ''); + + if (!/[.!?|]\s*$/u.test(paragraphNoAbbreviations)) { + report('Sentence must end with a period.', fix, tag); + return true; + } + + if (newlineBeforeCapsAssumesBadSentenceEnd && !isNewLinePrecededByAPeriod(paragraphNoAbbreviations)) { + report('A line of text is started with an uppercase character, but preceding line does not end the sentence.', null, tag); + return true; + } + + return false; + }); +}; + +var _default = (0, _iterateJsdoc.default)(({ + sourceCode, + context, + jsdoc, + report, + jsdocNode, + utils +}) => { + const options = context.options[0] || {}; + const { + abbreviations = [], + newlineBeforeCapsAssumesBadSentenceEnd = false + } = options; + const abbreviationsRegex = abbreviations.length ? new RegExp('\\b' + abbreviations.map(abbreviation => { + return (0, _escapeStringRegexp.default)(abbreviation.replace(/\.$/ug, '') + '.'); + }).join('|') + '(?:$|\\s)', 'gu') : ''; + const { + description + } = utils.getDescription(); + + if (validateDescription(description, report, jsdocNode, abbreviationsRegex, sourceCode, { + line: jsdoc.source[0].number + 1 + }, newlineBeforeCapsAssumesBadSentenceEnd)) { + return; + } + + utils.forEachPreferredTag('description', matchingJsdocTag => { + const desc = `${matchingJsdocTag.name} ${utils.getTagDescription(matchingJsdocTag)}`.trim(); + validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, matchingJsdocTag, newlineBeforeCapsAssumesBadSentenceEnd); + }, true); + const { + tagsWithNames + } = utils.getTagsByType(jsdoc.tags); + const tagsWithoutNames = utils.filterTags(({ + tag: tagName + }) => { + return otherDescriptiveTags.has(tagName) || utils.hasOptionTag(tagName) && !tagsWithNames.some(({ + tag + }) => { + // If user accidentally adds tags with names (or like `returns` + // get parsed as having names), do not add to this list + return tag === tagName; + }); + }); + tagsWithNames.some(tag => { + const desc = utils.getTagDescription(tag).replace(/^- /u, '').trimEnd(); + return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd); + }); + tagsWithoutNames.some(tag => { + const desc = `${tag.name} ${utils.getTagDescription(tag)}`.trim(); + return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd); + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Requires that block description, explicit `@description`, and `@param`/`@returns` tag descriptions are written in complete sentences.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-description-complete-sentence' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + abbreviations: { + items: { + type: 'string' + }, + type: 'array' + }, + newlineBeforeCapsAssumesBadSentenceEnd: { + type: 'boolean' + }, + tags: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireDescriptionCompleteSentence.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireExample.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireExample.js new file mode 100644 index 00000000000000..29ad49b2b87d3c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireExample.js @@ -0,0 +1,111 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + context, + jsdoc, + report, + utils +}) => { + if (utils.avoidDocs()) { + return; + } + + const { + exemptNoArguments = false + } = context.options[0] || {}; + const targetTagName = 'example'; + const functionExamples = jsdoc.tags.filter(({ + tag + }) => { + return tag === targetTagName; + }); + + if (!functionExamples.length) { + if (exemptNoArguments && utils.isIteratingFunction() && !utils.hasParams()) { + return; + } + + utils.reportJSDoc(`Missing JSDoc @${targetTagName} declaration.`, null, () => { + utils.addTag(targetTagName); + }); + return; + } + + for (const example of functionExamples) { + const exampleContent = `${example.name} ${utils.getTagDescription(example)}`.trim().split('\n').filter(Boolean); + + if (!exampleContent.length) { + report(`Missing JSDoc @${targetTagName} description.`, null, example); + } + } +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that all functions have examples.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-example' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + checkConstructors: { + default: true, + type: 'boolean' + }, + checkGetters: { + default: false, + type: 'boolean' + }, + checkSetters: { + default: false, + type: 'boolean' + }, + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + exemptedBy: { + items: { + type: 'string' + }, + type: 'array' + }, + exemptNoArguments: { + default: false, + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireExample.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireFileOverview.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireFileOverview.js new file mode 100644 index 00000000000000..5ccd11fcd63b7f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireFileOverview.js @@ -0,0 +1,147 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const defaultTags = { + file: { + initialCommentsOnly: true, + mustExist: true, + preventDuplicates: true + } +}; + +const setDefaults = state => { + // First iteration + if (!state.globalTags) { + state.globalTags = {}; + state.hasDuplicates = {}; + state.hasTag = {}; + state.hasNonCommentBeforeTag = {}; + } +}; + +var _default = (0, _iterateJsdoc.default)(({ + jsdocNode, + state, + utils, + context +}) => { + const { + tags = defaultTags + } = context.options[0] || {}; + setDefaults(state); + + for (const tagName of Object.keys(tags)) { + const targetTagName = utils.getPreferredTagName({ + tagName + }); + const hasTag = targetTagName && utils.hasTag(targetTagName); + state.hasTag[tagName] = hasTag || state.hasTag[tagName]; + const hasDuplicate = state.hasDuplicates[tagName]; + + if (hasDuplicate === false) { + // Was marked before, so if a tag now, is a dupe + state.hasDuplicates[tagName] = hasTag; + } else if (!hasDuplicate && hasTag) { + // No dupes set before, but has first tag, so change state + // from `undefined` to `false` so can detect next time + state.hasDuplicates[tagName] = false; + state.hasNonCommentBeforeTag[tagName] = state.hasNonComment && state.hasNonComment < jsdocNode.range[0]; + } + } +}, { + exit({ + context, + state, + utils + }) { + setDefaults(state); + const { + tags = defaultTags + } = context.options[0] || {}; + + for (const [tagName, { + mustExist = false, + preventDuplicates = false, + initialCommentsOnly = false + }] of Object.entries(tags)) { + const obj = utils.getPreferredTagNameObject({ + tagName + }); + + if (obj && obj.blocked) { + utils.reportSettings(`\`settings.jsdoc.tagNamePreference\` cannot block @${obj.tagName} ` + 'for the `require-file-overview` rule'); + } else { + const targetTagName = obj && obj.replacement || obj; + + if (mustExist && !state.hasTag[tagName]) { + utils.reportSettings(`Missing @${targetTagName}`); + } + + if (preventDuplicates && state.hasDuplicates[tagName]) { + utils.reportSettings(`Duplicate @${targetTagName}`); + } + + if (initialCommentsOnly && state.hasNonCommentBeforeTag[tagName]) { + utils.reportSettings(`@${targetTagName} should be at the beginning of the file`); + } + } + } + }, + + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Checks that all files have one `@file`, `@fileoverview`, or `@overview` tag at the beginning of the file.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-file-overview' + }, + schema: [{ + additionalProperties: false, + properties: { + tags: { + patternProperties: { + '.*': { + additionalProperties: false, + properties: { + initialCommentsOnly: { + type: 'boolean' + }, + mustExist: { + type: 'boolean' + }, + preventDuplicates: { + type: 'boolean' + } + }, + type: 'object' + } + }, + type: 'object' + } + }, + type: 'object' + }], + type: 'suggestion' + }, + + nonComment({ + state, + node + }) { + if (!state.hasNonComment) { + state.hasNonComment = node.range[0]; + } + } + +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireFileOverview.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireHyphenBeforeParamDescription.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireHyphenBeforeParamDescription.js new file mode 100644 index 00000000000000..bd6a881c21aafb --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireHyphenBeforeParamDescription.js @@ -0,0 +1,127 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + sourceCode, + utils, + report, + context, + jsdoc, + jsdocNode +}) => { + const [mainCircumstance, { + tags + } = {}] = context.options; + + const checkHyphens = (jsdocTag, targetTagName, circumstance = mainCircumstance) => { + const always = !circumstance || circumstance === 'always'; + const desc = utils.getTagDescription(jsdocTag); + + if (!desc.trim()) { + return; + } + + const startsWithHyphen = /^\s*-/u.test(desc); + + if (always) { + if (!startsWithHyphen) { + report(`There must be a hyphen before @${targetTagName} description.`, fixer => { + const lineIndex = jsdocTag.line; + const sourceLines = sourceCode.getText(jsdocNode).split('\n'); // Get start index of description, accounting for multi-line descriptions + + const description = desc.split('\n')[0]; + const descriptionIndex = sourceLines[lineIndex].lastIndexOf(description); + const replacementLine = sourceLines[lineIndex].slice(0, descriptionIndex) + '- ' + description; + sourceLines.splice(lineIndex, 1, replacementLine); + const replacement = sourceLines.join('\n'); + return fixer.replaceText(jsdocNode, replacement); + }, jsdocTag); + } + } else if (startsWithHyphen) { + report(`There must be no hyphen before @${targetTagName} description.`, fixer => { + const [unwantedPart] = /^\s*-\s*/u.exec(desc); + const replacement = sourceCode.getText(jsdocNode).replace(desc, desc.slice(unwantedPart.length)); + return fixer.replaceText(jsdocNode, replacement); + }, jsdocTag); + } + }; + + utils.forEachPreferredTag('param', checkHyphens); + + if (tags) { + const tagEntries = Object.entries(tags); + + for (const [tagName, circumstance] of tagEntries) { + if (tagName === '*') { + const preferredParamTag = utils.getPreferredTagName({ + tagName: 'param' + }); + + for (const { + tag + } of jsdoc.tags) { + if (tag === preferredParamTag || tagEntries.some(([tagNme]) => { + return tagNme !== '*' && tagNme === tag; + })) { + continue; + } + + utils.forEachPreferredTag(tag, (jsdocTag, targetTagName) => { + checkHyphens(jsdocTag, targetTagName, circumstance); + }); + } + + continue; + } + + utils.forEachPreferredTag(tagName, (jsdocTag, targetTagName) => { + checkHyphens(jsdocTag, targetTagName, circumstance); + }); + } + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Requires a hyphen before the `@param` description.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-hyphen-before-param-description' + }, + fixable: 'code', + schema: [{ + enum: ['always', 'never'], + type: 'string' + }, { + additionalProperties: false, + properties: { + tags: { + anyOf: [{ + patternProperties: { + '.*': { + enum: ['always', 'never'], + type: 'string' + } + }, + type: 'object' + }, { + enum: ['any'], + type: 'string' + }] + } + }, + type: 'object' + }], + type: 'layout' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireHyphenBeforeParamDescription.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireJsdoc.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireJsdoc.js new file mode 100644 index 00000000000000..b8eafd9965015c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireJsdoc.js @@ -0,0 +1,381 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _jsdoccomment = require("@es-joy/jsdoccomment"); + +var _exportParser = _interopRequireDefault(require("../exportParser")); + +var _iterateJsdoc = require("../iterateJsdoc"); + +var _jsdocUtils = _interopRequireDefault(require("../jsdocUtils")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const OPTIONS_SCHEMA = { + additionalProperties: false, + properties: { + checkConstructors: { + default: true, + type: 'boolean' + }, + checkGetters: { + anyOf: [{ + type: 'boolean' + }, { + enum: ['no-setter'], + type: 'string' + }], + default: true + }, + checkSetters: { + anyOf: [{ + type: 'boolean' + }, { + enum: ['no-getter'], + type: 'string' + }], + default: true + }, + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + context: { + type: 'string' + }, + inlineCommentBlock: { + type: 'boolean' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + enableFixer: { + default: true, + type: 'boolean' + }, + exemptEmptyConstructors: { + default: false, + type: 'boolean' + }, + exemptEmptyFunctions: { + default: false, + type: 'boolean' + }, + fixerMessage: { + default: '', + type: 'string' + }, + publicOnly: { + oneOf: [{ + default: false, + type: 'boolean' + }, { + additionalProperties: false, + default: {}, + properties: { + ancestorsOnly: { + type: 'boolean' + }, + cjs: { + type: 'boolean' + }, + esm: { + type: 'boolean' + }, + window: { + type: 'boolean' + } + }, + type: 'object' + }] + }, + require: { + additionalProperties: false, + default: {}, + properties: { + ArrowFunctionExpression: { + default: false, + type: 'boolean' + }, + ClassDeclaration: { + default: false, + type: 'boolean' + }, + ClassExpression: { + default: false, + type: 'boolean' + }, + FunctionDeclaration: { + default: true, + type: 'boolean' + }, + FunctionExpression: { + default: false, + type: 'boolean' + }, + MethodDefinition: { + default: false, + type: 'boolean' + } + }, + type: 'object' + } + }, + type: 'object' +}; + +const getOption = (context, baseObject, option, key) => { + if (context.options[0] && option in context.options[0] && ( // Todo: boolean shouldn't be returning property, but tests currently require + typeof context.options[0][option] === 'boolean' || key in context.options[0][option])) { + return context.options[0][option][key]; + } + + return baseObject.properties[key].default; +}; + +const getOptions = context => { + const { + publicOnly, + contexts = [], + exemptEmptyConstructors = true, + exemptEmptyFunctions = false, + enableFixer = true, + fixerMessage = '' + } = context.options[0] || {}; + return { + contexts, + enableFixer, + exemptEmptyConstructors, + exemptEmptyFunctions, + fixerMessage, + publicOnly: (baseObj => { + if (!publicOnly) { + return false; + } + + const properties = {}; + + for (const prop of Object.keys(baseObj.properties)) { + const opt = getOption(context, baseObj, 'publicOnly', prop); + properties[prop] = opt; + } + + return properties; + })(OPTIONS_SCHEMA.properties.publicOnly.oneOf[1]), + require: (baseObj => { + const properties = {}; + + for (const prop of Object.keys(baseObj.properties)) { + const opt = getOption(context, baseObj, 'require', prop); + properties[prop] = opt; + } + + return properties; + })(OPTIONS_SCHEMA.properties.require) + }; +}; + +var _default = { + create(context) { + const sourceCode = context.getSourceCode(); + const settings = (0, _iterateJsdoc.getSettings)(context); + + if (!settings) { + return {}; + } + + const { + require: requireOption, + contexts, + publicOnly, + exemptEmptyFunctions, + exemptEmptyConstructors, + enableFixer, + fixerMessage + } = getOptions(context); + + const checkJsDoc = (info, handler, node) => { + const jsDocNode = (0, _jsdoccomment.getJSDocComment)(sourceCode, node, settings); + + if (jsDocNode) { + return; + } // For those who have options configured against ANY constructors (or + // setters or getters) being reported + + + if (_jsdocUtils.default.exemptSpeciaMethods({ + tags: [] + }, node, context, [OPTIONS_SCHEMA])) { + return; + } + + if ( // Avoid reporting param-less, return-less functions (when + // `exemptEmptyFunctions` option is set) + exemptEmptyFunctions && info.isFunctionContext || // Avoid reporting param-less, return-less constructor methods (when + // `exemptEmptyConstructors` option is set) + exemptEmptyConstructors && _jsdocUtils.default.isConstructor(node)) { + const functionParameterNames = _jsdocUtils.default.getFunctionParameterNames(node); + + if (!functionParameterNames.length && !_jsdocUtils.default.hasReturnValue(node)) { + return; + } + } + + const fix = fixer => { + // Default to one line break if the `minLines`/`maxLines` settings allow + const lines = settings.minLines === 0 && settings.maxLines >= 1 ? 1 : settings.minLines; + let baseNode = (0, _jsdoccomment.getReducedASTNode)(node, sourceCode); + const decorator = (0, _jsdoccomment.getDecorator)(baseNode); + + if (decorator) { + baseNode = decorator; + } + + const indent = _jsdocUtils.default.getIndent({ + text: sourceCode.getText(baseNode, baseNode.loc.start.column) + }); + + const { + inlineCommentBlock + } = contexts.find(({ + context: ctxt + }) => { + return ctxt === node.type; + }) || {}; + const insertion = (inlineCommentBlock ? `/** ${fixerMessage}` : `/**\n${indent}*${fixerMessage}\n${indent}`) + `*/${'\n'.repeat(lines)}${indent.slice(0, -1)}`; + return fixer.insertTextBefore(baseNode, insertion); + }; + + const report = () => { + const loc = { + end: node.loc.start + 1, + start: node.loc.start + }; + context.report({ + fix: enableFixer ? fix : null, + loc, + messageId: 'missingJsDoc', + node + }); + }; + + if (publicOnly) { + var _publicOnly$ancestors, _publicOnly$esm, _publicOnly$cjs, _publicOnly$window; + + const opt = { + ancestorsOnly: Boolean((_publicOnly$ancestors = publicOnly === null || publicOnly === void 0 ? void 0 : publicOnly.ancestorsOnly) !== null && _publicOnly$ancestors !== void 0 ? _publicOnly$ancestors : false), + esm: Boolean((_publicOnly$esm = publicOnly === null || publicOnly === void 0 ? void 0 : publicOnly.esm) !== null && _publicOnly$esm !== void 0 ? _publicOnly$esm : true), + initModuleExports: Boolean((_publicOnly$cjs = publicOnly === null || publicOnly === void 0 ? void 0 : publicOnly.cjs) !== null && _publicOnly$cjs !== void 0 ? _publicOnly$cjs : true), + initWindow: Boolean((_publicOnly$window = publicOnly === null || publicOnly === void 0 ? void 0 : publicOnly.window) !== null && _publicOnly$window !== void 0 ? _publicOnly$window : false) + }; + + const exported = _exportParser.default.isUncommentedExport(node, sourceCode, opt, settings); + + if (exported) { + report(); + } + } else { + report(); + } + }; + + const hasOption = prop => { + return requireOption[prop] || contexts.some(ctxt => { + return typeof ctxt === 'object' ? ctxt.context === prop : ctxt === prop; + }); + }; + + return { ..._jsdocUtils.default.getContextObject(_jsdocUtils.default.enforcedContexts(context, []), checkJsDoc), + + ArrowFunctionExpression(node) { + if (!hasOption('ArrowFunctionExpression')) { + return; + } + + if (['VariableDeclarator', 'AssignmentExpression', 'ExportDefaultDeclaration'].includes(node.parent.type) || ['Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition'].includes(node.parent.type) && node === node.parent.value) { + checkJsDoc({ + isFunctionContext: true + }, null, node); + } + }, + + ClassDeclaration(node) { + if (!hasOption('ClassDeclaration')) { + return; + } + + checkJsDoc({ + isFunctionContext: false + }, null, node); + }, + + ClassExpression(node) { + if (!hasOption('ClassExpression')) { + return; + } + + checkJsDoc({ + isFunctionContext: false + }, null, node); + }, + + FunctionDeclaration(node) { + if (!hasOption('FunctionDeclaration')) { + return; + } + + checkJsDoc({ + isFunctionContext: true + }, null, node); + }, + + FunctionExpression(node) { + if (hasOption('MethodDefinition') && node.parent.type === 'MethodDefinition') { + checkJsDoc({ + isFunctionContext: true + }, null, node); + return; + } + + if (!hasOption('FunctionExpression')) { + return; + } + + if (['VariableDeclarator', 'AssignmentExpression', 'ExportDefaultDeclaration'].includes(node.parent.type) || ['Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition'].includes(node.parent.type) && node === node.parent.value) { + checkJsDoc({ + isFunctionContext: true + }, null, node); + } + } + + }; + }, + + meta: { + docs: { + category: 'Stylistic Issues', + description: 'Require JSDoc comments', + recommended: 'true', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc' + }, + fixable: 'code', + messages: { + missingJsDoc: 'Missing JSDoc comment.' + }, + schema: [OPTIONS_SCHEMA], + type: 'suggestion' + } +}; +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireJsdoc.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParam.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParam.js new file mode 100644 index 00000000000000..cacb29ec303228 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParam.js @@ -0,0 +1,454 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const rootNamer = (desiredRoots, currentIndex) => { + let name; + let idx = currentIndex; + const incremented = desiredRoots.length <= 1; + + if (incremented) { + const base = desiredRoots[0]; + const suffix = idx++; + name = `${base}${suffix}`; + } else { + name = desiredRoots.shift(); + } + + return [name, incremented, () => { + return rootNamer(desiredRoots, idx); + }]; +}; // eslint-disable-next-line complexity + + +var _default = (0, _iterateJsdoc.default)(({ + jsdoc, + utils, + context +}) => { + const preferredTagName = utils.getPreferredTagName({ + tagName: 'param' + }); + + if (!preferredTagName) { + return; + } + + const jsdocParameterNames = utils.getJsdocTagsDeep(preferredTagName); + const shallowJsdocParameterNames = jsdocParameterNames.filter(tag => { + return !tag.name.includes('.'); + }).map((tag, idx) => { + return { ...tag, + idx + }; + }); + + if (utils.avoidDocs()) { + return; + } // Param type is specified by type in @type + + + if (utils.hasTag('type')) { + return; + } + + const { + autoIncrementBase = 0, + checkRestProperty = false, + checkDestructured = true, + checkDestructuredRoots = true, + checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/', + enableFixer = true, + enableRootFixer = true, + enableRestElementFixer = true, + unnamedRootBase = ['root'], + useDefaultObjectProperties = false + } = context.options[0] || {}; + const checkTypesRegex = utils.getRegexFromString(checkTypesPattern); + const missingTags = []; + const functionParameterNames = utils.getFunctionParameterNames(useDefaultObjectProperties); + const flattenedRoots = utils.flattenRoots(functionParameterNames).names; + const paramIndex = {}; + + const hasParamIndex = cur => { + return utils.dropPathSegmentQuotes(String(cur)) in paramIndex; + }; + + const getParamIndex = cur => { + return paramIndex[utils.dropPathSegmentQuotes(String(cur))]; + }; + + const setParamIndex = (cur, idx) => { + paramIndex[utils.dropPathSegmentQuotes(String(cur))] = idx; + }; + + for (const [idx, cur] of flattenedRoots.entries()) { + setParamIndex(cur, idx); + } + + const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => { + const remainingRoots = functionParameterNames.slice(indexAtFunctionParams || 0); + const foundIndex = jsdocTags.findIndex(({ + name, + newAdd + }) => { + return !newAdd && remainingRoots.some(remainingRoot => { + if (Array.isArray(remainingRoot)) { + return remainingRoot[1].names.includes(name); + } + + if (typeof remainingRoot === 'object') { + return name === remainingRoot.name; + } + + return name === remainingRoot; + }); + }); + const tags = foundIndex > -1 ? jsdocTags.slice(0, foundIndex) : jsdocTags.filter(({ + tag + }) => { + return tag === preferredTagName; + }); + let tagLineCount = 0; + + for (const { + source + } of tags) { + for (const { + tokens: { + end + } + } of source) { + if (!end) { + tagLineCount++; + } + } + } + + return tagLineCount; + }; + + let [nextRootName, incremented, namer] = rootNamer([...unnamedRootBase], autoIncrementBase); + + for (const [functionParameterIdx, functionParameterName] of functionParameterNames.entries()) { + let inc; + + if (Array.isArray(functionParameterName)) { + const matchedJsdoc = shallowJsdocParameterNames[functionParameterIdx] || jsdocParameterNames[functionParameterIdx]; + let rootName; + + if (functionParameterName[0]) { + rootName = functionParameterName[0]; + } else if (matchedJsdoc && matchedJsdoc.name) { + rootName = matchedJsdoc.name; + + if (matchedJsdoc.type && matchedJsdoc.type.search(checkTypesRegex) === -1) { + continue; + } + } else { + rootName = nextRootName; + inc = incremented; + [nextRootName, incremented, namer] = namer(); + } + + const { + hasRestElement, + hasPropertyRest, + rests, + names + } = functionParameterName[1]; + const notCheckingNames = []; + + if (!enableRestElementFixer && hasRestElement) { + continue; + } + + if (!checkDestructuredRoots) { + continue; + } + + for (const [idx, paramName] of names.entries()) { + // Add root if the root name is not in the docs (and is not already + // in the tags to be fixed) + if (!jsdocParameterNames.find(({ + name + }) => { + return name === rootName; + }) && !missingTags.find(({ + functionParameterName: fpn + }) => { + return fpn === rootName; + })) { + const emptyParamIdx = jsdocParameterNames.findIndex(({ + name + }) => { + return !name; + }); + + if (emptyParamIdx > -1) { + missingTags.push({ + functionParameterIdx: emptyParamIdx, + functionParameterName: rootName, + inc, + remove: true + }); + } else { + missingTags.push({ + functionParameterIdx: hasParamIndex(rootName) ? getParamIndex(rootName) : getParamIndex(paramName), + functionParameterName: rootName, + inc + }); + } + } + + if (!checkDestructured) { + continue; + } + + if (!checkRestProperty && rests[idx]) { + continue; + } + + const fullParamName = `${rootName}.${paramName}`; + const notCheckingName = jsdocParameterNames.find(({ + name, + type: paramType + }) => { + return utils.comparePaths(name)(fullParamName) && paramType.search(checkTypesRegex) === -1 && paramType !== ''; + }); + + if (notCheckingName !== undefined) { + notCheckingNames.push(notCheckingName.name); + } + + if (notCheckingNames.find(name => { + return fullParamName.startsWith(name); + })) { + continue; + } + + if (jsdocParameterNames && !jsdocParameterNames.find(({ + name + }) => { + return utils.comparePaths(name)(fullParamName); + })) { + missingTags.push({ + functionParameterIdx: getParamIndex(functionParameterName[0] ? fullParamName : paramName), + functionParameterName: fullParamName, + inc, + type: hasRestElement && !hasPropertyRest ? '{...any}' : undefined + }); + } + } + + continue; + } + + let funcParamName; + let type; + + if (typeof functionParameterName === 'object') { + if (!enableRestElementFixer && functionParameterName.restElement) { + continue; + } + + funcParamName = functionParameterName.name; + type = '{...any}'; + } else { + funcParamName = functionParameterName; + } + + if (jsdocParameterNames && !jsdocParameterNames.find(({ + name + }) => { + return name === funcParamName; + })) { + missingTags.push({ + functionParameterIdx: getParamIndex(funcParamName), + functionParameterName: funcParamName, + inc, + type + }); + } + } + + const fix = ({ + functionParameterIdx, + functionParameterName, + remove, + inc, + type + }) => { + if (inc && !enableRootFixer) { + return; + } + + const createTokens = (tagIndex, sourceIndex, spliceCount) => { + // console.log(sourceIndex, tagIndex, jsdoc.tags, jsdoc.source); + const tokens = { + number: sourceIndex + 1, + tokens: { + delimiter: '*', + description: '', + end: '', + lineEnd: '', + name: functionParameterName, + newAdd: true, + postDelimiter: ' ', + postName: '', + postTag: ' ', + postType: type ? ' ' : '', + start: jsdoc.source[sourceIndex].tokens.start, + tag: `@${preferredTagName}`, + type: type !== null && type !== void 0 ? type : '' + } + }; + jsdoc.tags.splice(tagIndex, spliceCount, { + name: functionParameterName, + newAdd: true, + source: [tokens], + tag: preferredTagName, + type: type !== null && type !== void 0 ? type : '' + }); + const firstNumber = jsdoc.source[0].number; + jsdoc.source.splice(sourceIndex, spliceCount, tokens); + + for (const [idx, src] of jsdoc.source.slice(sourceIndex).entries()) { + src.number = firstNumber + sourceIndex + idx; + } + }; + + const offset = jsdoc.source.findIndex(({ + tokens: { + tag, + end + } + }) => { + return tag || end; + }); + + if (remove) { + createTokens(functionParameterIdx, offset + functionParameterIdx, 1); + } else { + const expectedIdx = findExpectedIndex(jsdoc.tags, functionParameterIdx); + createTokens(expectedIdx, offset + expectedIdx, 0); + } + }; + + const fixer = () => { + for (const missingTag of missingTags) { + fix(missingTag); + } + }; + + if (missingTags.length && jsdoc.source.length === 1) { + utils.makeMultiline(); + } + + for (const { + functionParameterName + } of missingTags) { + utils.reportJSDoc(`Missing JSDoc @${preferredTagName} "${functionParameterName}" declaration.`, null, enableFixer ? fixer : null); + } +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that all function parameters are documented.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param' + }, + fixable: 'code', + schema: [{ + additionalProperties: false, + properties: { + autoIncrementBase: { + default: 0, + type: 'integer' + }, + checkConstructors: { + default: true, + type: 'boolean' + }, + checkDestructured: { + default: true, + type: 'boolean' + }, + checkDestructuredRoots: { + default: true, + type: 'boolean' + }, + checkGetters: { + default: false, + type: 'boolean' + }, + checkRestProperty: { + default: false, + type: 'boolean' + }, + checkSetters: { + default: false, + type: 'boolean' + }, + checkTypesPattern: { + type: 'string' + }, + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + enableFixer: { + type: 'boolean' + }, + enableRestElementFixer: { + type: 'boolean' + }, + enableRootFixer: { + type: 'boolean' + }, + exemptedBy: { + items: { + type: 'string' + }, + type: 'array' + }, + unnamedRootBase: { + items: { + type: 'string' + }, + type: 'array' + }, + useDefaultObjectProperties: { + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireParam.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamDescription.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamDescription.js new file mode 100644 index 00000000000000..3156db55327bf2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamDescription.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => { + if (!jsdocParameter.description.trim()) { + report(`Missing JSDoc @${targetTagName} "${jsdocParameter.name}" description.`, null, jsdocParameter); + } + }); +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that each `@param` tag has a `description` value.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-description' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireParamDescription.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamName.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamName.js new file mode 100644 index 00000000000000..aeb695cae6b3a9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamName.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => { + if (jsdocParameter.tag && jsdocParameter.name === '') { + report(`There must be an identifier after @${targetTagName} ${jsdocParameter.type === '' ? 'type' : 'tag'}.`, null, jsdocParameter); + } + }); +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that all function parameters have names.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-name' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireParamName.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamType.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamType.js new file mode 100644 index 00000000000000..a63b0222a63700 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireParamType.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => { + if (!jsdocParameter.type) { + report(`Missing JSDoc @${targetTagName} "${jsdocParameter.name}" type.`, null, jsdocParameter); + } + }); +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that each `@param` tag has a `type` value.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-type' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireParamType.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireProperty.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireProperty.js new file mode 100644 index 00000000000000..48e4fd4cf6bf37 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireProperty.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + utils +}) => { + const propertyAssociatedTags = utils.filterTags(({ + tag + }) => { + return ['typedef', 'namespace'].includes(tag); + }); + + if (!propertyAssociatedTags.length) { + return; + } + + const targetTagName = utils.getPreferredTagName({ + tagName: 'property' + }); + + if (utils.hasATag([targetTagName])) { + return; + } + + for (const propertyAssociatedTag of propertyAssociatedTags) { + if (!['object', 'Object', 'PlainObject'].includes(propertyAssociatedTag.type)) { + continue; + } + + utils.reportJSDoc(`Missing JSDoc @${targetTagName}.`, null, () => { + utils.addTag(targetTagName); + }); + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Requires that all `@typedef` and `@namespace` tags have `@property` when their type is a plain `object`, `Object`, or `PlainObject`.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-property' + }, + fixable: 'code', + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireProperty.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyDescription.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyDescription.js new file mode 100644 index 00000000000000..07d7a0238717c4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyDescription.js @@ -0,0 +1,34 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('property', (jsdoc, targetTagName) => { + if (!jsdoc.description.trim()) { + report(`Missing JSDoc @${targetTagName} "${jsdoc.name}" description.`, null, jsdoc); + } + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Requires that each `@property` tag has a `description` value.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-property-description' + }, + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requirePropertyDescription.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyName.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyName.js new file mode 100644 index 00000000000000..5ba4beb8faf1c4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyName.js @@ -0,0 +1,34 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('property', (jsdoc, targetTagName) => { + if (jsdoc.tag && jsdoc.name === '') { + report(`There must be an identifier after @${targetTagName} ${jsdoc.type === '' ? 'type' : 'tag'}.`, null, jsdoc); + } + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Requires that all function `@property` tags have names.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-property-name' + }, + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requirePropertyName.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyType.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyType.js new file mode 100644 index 00000000000000..bc26d7200108b4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requirePropertyType.js @@ -0,0 +1,34 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('property', (jsdoc, targetTagName) => { + if (!jsdoc.type) { + report(`Missing JSDoc @${targetTagName} "${jsdoc.name}" type.`, null, jsdoc); + } + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Requires that each `@property` tag has a `type` value.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-property-type' + }, + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requirePropertyType.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturns.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturns.js new file mode 100644 index 00000000000000..3bf1ad8b05de30 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturns.js @@ -0,0 +1,151 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * We can skip checking for a return value, in case the documentation is inherited + * or the method is either a constructor or an abstract method. + * + * In either of these cases the return value is optional or not defined. + * + * @param {*} utils + * a reference to the utils which are used to probe if a tag is present or not. + * @returns {boolean} + * true in case deep checking can be skipped; otherwise false. + */ +const canSkip = utils => { + return utils.hasATag([// inheritdoc implies that all documentation is inherited + // see https://jsdoc.app/tags-inheritdoc.html + // + // Abstract methods are by definition incomplete, + // so it is not an error if it declares a return value but does not implement it. + 'abstract', 'virtual', // Constructors do not have a return value by definition (https://jsdoc.app/tags-class.html) + // So we can bail out here, too. + 'class', 'constructor', // Return type is specified by type in @type + 'type', // This seems to imply a class as well + 'interface']) || utils.avoidDocs(); +}; + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils, + context +}) => { + const { + forceRequireReturn = false, + forceReturnsWithAsync = false + } = context.options[0] || {}; // A preflight check. We do not need to run a deep check + // in case the @returns comment is optional or undefined. + + if (canSkip(utils)) { + return; + } + + const tagName = utils.getPreferredTagName({ + tagName: 'returns' + }); + + if (!tagName) { + return; + } + + const tags = utils.getTags(tagName); + + if (tags.length > 1) { + report(`Found more than one @${tagName} declaration.`); + } + + const iteratingFunction = utils.isIteratingFunction(); // In case the code returns something, we expect a return value in JSDoc. + + const [tag] = tags; + const missingReturnTag = typeof tag === 'undefined' || tag === null; + + const shouldReport = () => { + if (!missingReturnTag) { + return false; + } + + if (forceRequireReturn && (iteratingFunction || utils.isVirtualFunction())) { + return true; + } + + const isAsync = !iteratingFunction && utils.hasTag('async') || iteratingFunction && utils.isAsync(); + + if (forceReturnsWithAsync && isAsync) { + return true; + } + + return iteratingFunction && utils.hasValueOrExecutorHasNonEmptyResolveValue(forceReturnsWithAsync); + }; + + if (shouldReport()) { + report(`Missing JSDoc @${tagName} declaration.`); + } +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that returns are documented.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns' + }, + schema: [{ + additionalProperties: false, + properties: { + checkConstructors: { + default: false, + type: 'boolean' + }, + checkGetters: { + default: true, + type: 'boolean' + }, + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + exemptedBy: { + items: { + type: 'string' + }, + type: 'array' + }, + forceRequireReturn: { + default: false, + type: 'boolean' + }, + forceReturnsWithAsync: { + default: false, + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireReturns.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsCheck.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsCheck.js new file mode 100755 index 00000000000000..29c1fb47057bb4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsCheck.js @@ -0,0 +1,103 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const canSkip = (utils, settings) => { + const voidingTags = [// An abstract function is by definition incomplete + // so it is perfectly fine if a return is documented but + // not present within the function. + // A subclass may inherit the doc and implement the + // missing return. + 'abstract', 'virtual', // A constructor function returns `this` by default, so may be `@returns` + // tag indicating this but no explicit return + 'class', 'constructor', 'interface']; + + if (settings.mode === 'closure') { + // Structural Interface in GCC terms, equivalent to @interface tag as far as this rule is concerned + voidingTags.push('record'); + } + + return utils.hasATag(voidingTags) || utils.isConstructor() || utils.classHasTag('interface') || settings.mode === 'closure' && utils.classHasTag('record'); +}; + +var _default = (0, _iterateJsdoc.default)(({ + context, + node, + report, + settings, + utils +}) => { + const { + exemptAsync = true, + exemptGenerators = settings.mode === 'typescript', + reportMissingReturnForUndefinedTypes = false + } = context.options[0] || {}; + + if (canSkip(utils, settings)) { + return; + } + + if (exemptAsync && utils.isAsync()) { + return; + } + + const tagName = utils.getPreferredTagName({ + tagName: 'returns' + }); + + if (!tagName) { + return; + } + + const tags = utils.getTags(tagName); + + if (tags.length === 0) { + return; + } + + if (tags.length > 1) { + report(`Found more than one @${tagName} declaration.`); + return; + } // In case a return value is declared in JSDoc, we also expect one in the code. + + + if ((reportMissingReturnForUndefinedTypes || utils.hasDefinedTypeTag(tags[0])) && !utils.hasValueOrExecutorHasNonEmptyResolveValue(exemptAsync) && (!exemptGenerators || !node.generator)) { + report(`JSDoc @${tagName} declaration present but return expression not available in function.`); + } +}, { + meta: { + docs: { + description: 'Requires a return statement in function body if a `@returns` tag is specified in jsdoc comment.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-check' + }, + schema: [{ + additionalProperties: false, + properties: { + exemptAsync: { + default: true, + type: 'boolean' + }, + exemptGenerators: { + type: 'boolean' + }, + reportMissingReturnForUndefinedTypes: { + default: false, + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireReturnsCheck.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsDescription.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsDescription.js new file mode 100644 index 00000000000000..2a29da09af458c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsDescription.js @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('returns', (jsdocTag, targetTagName) => { + const type = jsdocTag.type && jsdocTag.type.trim(); + + if (['void', 'undefined', 'Promise', 'Promise'].includes(type)) { + return; + } + + if (!jsdocTag.description.trim()) { + report(`Missing JSDoc @${targetTagName} description.`, null, jsdocTag); + } + }); +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that the `@returns` tag has a `description` value.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-description' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireReturnsDescription.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsType.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsType.js new file mode 100644 index 00000000000000..561391d44ebda9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireReturnsType.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + utils.forEachPreferredTag('returns', (jsdocTag, targetTagName) => { + if (!jsdocTag.type) { + report(`Missing JSDoc @${targetTagName} type.`, null, jsdocTag); + } + }); +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that `@returns` tag has `type` value.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-type' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireReturnsType.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireThrows.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireThrows.js new file mode 100644 index 00000000000000..51426af9d78ee9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireThrows.js @@ -0,0 +1,108 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * We can skip checking for a throws value, in case the documentation is inherited + * or the method is either a constructor or an abstract method. + * + * @param {*} utils a reference to the utils which are used to probe if a tag is present or not. + * @returns {boolean} true in case deep checking can be skipped; otherwise false. + */ +const canSkip = utils => { + return utils.hasATag([// inheritdoc implies that all documentation is inherited + // see https://jsdoc.app/tags-inheritdoc.html + // + // Abstract methods are by definition incomplete, + // so it is not necessary to document that they throw an error. + 'abstract', 'virtual', // The designated type can itself document `@throws` + 'type']) || utils.avoidDocs(); +}; + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils +}) => { + // A preflight check. We do not need to run a deep check for abstract + // functions. + if (canSkip(utils)) { + return; + } + + const tagName = utils.getPreferredTagName({ + tagName: 'throws' + }); + + if (!tagName) { + return; + } + + const tags = utils.getTags(tagName); + const iteratingFunction = utils.isIteratingFunction(); // In case the code returns something, we expect a return value in JSDoc. + + const [tag] = tags; + const missingThrowsTag = typeof tag === 'undefined' || tag === null; + + const shouldReport = () => { + if (!missingThrowsTag) { + return false; + } + + return iteratingFunction && utils.hasThrowValue(); + }; + + if (shouldReport()) { + report(`Missing JSDoc @${tagName} declaration.`); + } +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires that throw statements are documented.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-throws' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + exemptedBy: { + items: { + type: 'string' + }, + type: 'array' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireThrows.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireYields.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireYields.js new file mode 100644 index 00000000000000..8b6fc0b70cea93 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireYields.js @@ -0,0 +1,186 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * We can skip checking for a yield value, in case the documentation is inherited + * or the method has a constructor or abstract tag. + * + * In either of these cases the yield value is optional or not defined. + * + * @param {*} utils a reference to the utils which are used to probe if a tag is present or not. + * @returns {boolean} true in case deep checking can be skipped; otherwise false. + */ +const canSkip = utils => { + return utils.hasATag([// inheritdoc implies that all documentation is inherited + // see https://jsdoc.app/tags-inheritdoc.html + // + // Abstract methods are by definition incomplete, + // so it is not an error if it declares a yield value but does not implement it. + 'abstract', 'virtual', // Constructors do not have a yield value + // so we can bail out here, too. + 'class', 'constructor', // Yield (and any `next`) type is specified accompanying the targeted + // @type + 'type', // This seems to imply a class as well + 'interface']) || utils.avoidDocs(); +}; + +const checkTagName = (utils, report, tagName) => { + const preferredTagName = utils.getPreferredTagName({ + tagName + }); + + if (!preferredTagName) { + return []; + } + + const tags = utils.getTags(preferredTagName); + + if (tags.length > 1) { + report(`Found more than one @${preferredTagName} declaration.`); + } // In case the code yields something, we expect a yields value in JSDoc. + + + const [tag] = tags; + const missingTag = typeof tag === 'undefined' || tag === null; + return [preferredTagName, missingTag]; +}; + +var _default = (0, _iterateJsdoc.default)(({ + report, + utils, + context +}) => { + const { + next = false, + nextWithGeneratorTag = false, + forceRequireNext = false, + forceRequireYields = false, + withGeneratorTag = true + } = context.options[0] || {}; // A preflight check. We do not need to run a deep check + // in case the @yield comment is optional or undefined. + + if (canSkip(utils)) { + return; + } + + const iteratingFunction = utils.isIteratingFunction(); + const [preferredYieldTagName, missingYieldTag] = checkTagName(utils, report, 'yields'); + + if (preferredYieldTagName) { + const shouldReportYields = () => { + if (!missingYieldTag) { + return false; + } + + if (withGeneratorTag && utils.hasTag('generator') || forceRequireYields && iteratingFunction && utils.isGenerator()) { + return true; + } + + return iteratingFunction && utils.isGenerator() && utils.hasYieldValue(); + }; + + if (shouldReportYields()) { + report(`Missing JSDoc @${preferredYieldTagName} declaration.`); + } + } + + if (next || nextWithGeneratorTag || forceRequireNext) { + const [preferredNextTagName, missingNextTag] = checkTagName(utils, report, 'next'); + + if (!preferredNextTagName) { + return; + } + + const shouldReportNext = () => { + if (!missingNextTag) { + return false; + } + + if (nextWithGeneratorTag && utils.hasTag('generator')) { + return true; + } + + if (!next && !forceRequireNext || !iteratingFunction || !utils.isGenerator()) { + return false; + } + + return forceRequireNext || utils.hasYieldReturnValue(); + }; + + if (shouldReportNext()) { + report(`Missing JSDoc @${preferredNextTagName} declaration.`); + } + } +}, { + contextDefaults: true, + meta: { + docs: { + description: 'Requires yields are documented.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-yields' + }, + schema: [{ + additionalProperties: false, + properties: { + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + exemptedBy: { + items: { + type: 'string' + }, + type: 'array' + }, + forceRequireNext: { + default: false, + type: 'boolean' + }, + forceRequireYields: { + default: false, + type: 'boolean' + }, + next: { + default: false, + type: 'boolean' + }, + nextWithGeneratorTag: { + default: false, + type: 'boolean' + }, + withGeneratorTag: { + default: true, + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireYields.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireYieldsCheck.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireYieldsCheck.js new file mode 100644 index 00000000000000..e229c67fd322d0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/requireYieldsCheck.js @@ -0,0 +1,153 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const canSkip = (utils, settings) => { + const voidingTags = [// An abstract function is by definition incomplete + // so it is perfectly fine if a yield is documented but + // not present within the function. + // A subclass may inherit the doc and implement the + // missing yield. + 'abstract', 'virtual', // Constructor functions do not have a yield value + // so we can bail here, too. + 'class', 'constructor', // This seems to imply a class as well + 'interface']; + + if (settings.mode === 'closure') { + // Structural Interface in GCC terms, equivalent to @interface tag as far as this rule is concerned + voidingTags.push('record'); + } + + return utils.hasATag(voidingTags) || utils.isConstructor() || utils.classHasTag('interface') || settings.mode === 'closure' && utils.classHasTag('record'); +}; + +const checkTagName = (utils, report, tagName) => { + const preferredTagName = utils.getPreferredTagName({ + tagName + }); + + if (!preferredTagName) { + return []; + } + + const tags = utils.getTags(preferredTagName); + + if (tags.length === 0) { + return []; + } + + if (tags.length > 1) { + report(`Found more than one @${preferredTagName} declaration.`); + return []; + } + + return [preferredTagName, tags[0]]; +}; + +var _default = (0, _iterateJsdoc.default)(({ + context, + report, + settings, + utils +}) => { + if (canSkip(utils, settings)) { + return; + } + + const { + next = false, + checkGeneratorsOnly = false + } = context.options[0] || {}; + const [preferredYieldTagName, yieldTag] = checkTagName(utils, report, 'yields'); + + if (preferredYieldTagName) { + const shouldReportYields = () => { + if (checkGeneratorsOnly && !utils.isGenerator()) { + return true; + } + + return utils.hasDefinedTypeTag(yieldTag) && !utils.hasYieldValue(); + }; // In case a yield value is declared in JSDoc, we also expect one in the code. + + + if (shouldReportYields()) { + report(`JSDoc @${preferredYieldTagName} declaration present but yield expression not available in function.`); + } + } + + if (next) { + const [preferredNextTagName, nextTag] = checkTagName(utils, report, 'next'); + + if (preferredNextTagName) { + const shouldReportNext = () => { + if (checkGeneratorsOnly && !utils.isGenerator()) { + return true; + } + + return utils.hasDefinedTypeTag(nextTag) && !utils.hasYieldReturnValue(); + }; + + if (shouldReportNext()) { + report(`JSDoc @${preferredNextTagName} declaration present but yield expression with return value not available in function.`); + } + } + } +}, { + meta: { + docs: { + description: 'Requires a yield statement in function body if a `@yields` tag is specified in jsdoc comment.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-yields-check' + }, + schema: [{ + additionalProperties: false, + properties: { + checkGeneratorsOnly: { + default: false, + type: 'boolean' + }, + contexts: { + items: { + anyOf: [{ + type: 'string' + }, { + additionalProperties: false, + properties: { + comment: { + type: 'string' + }, + context: { + type: 'string' + } + }, + type: 'object' + }] + }, + type: 'array' + }, + exemptedBy: { + items: { + type: 'string' + }, + type: 'array' + }, + next: { + default: false, + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=requireYieldsCheck.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/tagLines.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/tagLines.js new file mode 100644 index 00000000000000..6e14686946f75b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/tagLines.js @@ -0,0 +1,174 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _iterateJsdoc.default)(({ + context, + jsdoc, + utils +}) => { + const [alwaysNever = 'never', { + count = 1, + noEndLines = false, + tags = {} + } = {}] = context.options; + jsdoc.tags.some((tg, tagIdx) => { + let lastTag; + let reportIndex = null; + + for (const [idx, { + tokens: { + tag, + name, + type, + description, + end + } + }] of tg.source.entries()) { + var _tags$lastTag$slice, _tags$lastTag$slice2; + + // May be text after a line break within a tag description + if (description) { + reportIndex = null; + } + + if (lastTag && ['any', 'always'].includes((_tags$lastTag$slice = tags[lastTag.slice(1)]) === null || _tags$lastTag$slice === void 0 ? void 0 : _tags$lastTag$slice.lines)) { + continue; + } + + if (!tag && !name && !type && !description && !end && (alwaysNever === 'never' || lastTag && ((_tags$lastTag$slice2 = tags[lastTag.slice(1)]) === null || _tags$lastTag$slice2 === void 0 ? void 0 : _tags$lastTag$slice2.lines) === 'never')) { + reportIndex = idx; + continue; + } + + lastTag = tag; + } + + if (reportIndex !== null) { + const fixer = () => { + utils.removeTagItem(tagIdx, reportIndex); + }; + + utils.reportJSDoc('Expected no lines between tags', { + line: tg.source[0].number + 1 + }, fixer); + return true; + } + + return false; + }); + (noEndLines ? jsdoc.tags.slice(0, -1) : jsdoc.tags).some((tg, tagIdx) => { + const lines = []; + let currentTag; + let tagSourceIdx = 0; + + for (const [idx, { + number, + tokens: { + tag, + name, + type, + description, + end + } + }] of tg.source.entries()) { + if (description) { + lines.splice(0, lines.length); + tagSourceIdx = idx; + } + + if (tag) { + currentTag = tag; + } + + if (!tag && !name && !type && !description && !end) { + lines.push({ + idx, + number + }); + } + } + + const currentTg = currentTag && tags[currentTag.slice(1)]; + const tagCount = currentTg === null || currentTg === void 0 ? void 0 : currentTg.count; + const defaultAlways = alwaysNever === 'always' && (currentTg === null || currentTg === void 0 ? void 0 : currentTg.lines) !== 'never' && (currentTg === null || currentTg === void 0 ? void 0 : currentTg.lines) !== 'any' && lines.length < count; + let overrideAlways; + let fixCount = count; + + if (!defaultAlways) { + fixCount = typeof tagCount === 'number' ? tagCount : count; + overrideAlways = (currentTg === null || currentTg === void 0 ? void 0 : currentTg.lines) === 'always' && lines.length < fixCount; + } + + if (defaultAlways || overrideAlways) { + var _lines2; + + const fixer = () => { + var _lines; + + utils.addLines(tagIdx, ((_lines = lines[lines.length - 1]) === null || _lines === void 0 ? void 0 : _lines.idx) || tagSourceIdx + 1, fixCount - lines.length); + }; + + const line = ((_lines2 = lines[lines.length - 1]) === null || _lines2 === void 0 ? void 0 : _lines2.number) || tg.source[tagSourceIdx].number; + utils.reportJSDoc(`Expected ${fixCount} line${fixCount === 1 ? '' : 's'} between tags but found ${lines.length}`, { + line + }, fixer); + return true; + } + + return false; + }); +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Enforces lines (or no lines) between tags.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-tag-lines' + }, + fixable: 'code', + schema: [{ + enum: ['always', 'any', 'never'], + type: 'string' + }, { + additionalProperies: false, + properties: { + count: { + type: 'integer' + }, + noEndLines: { + type: 'boolean' + }, + tags: { + patternProperties: { + '.*': { + additionalProperties: false, + properties: { + count: { + type: 'integer' + }, + lines: { + enum: ['always', 'never', 'any'], + type: 'string' + } + } + } + }, + type: 'object' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=tagLines.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/validTypes.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/validTypes.js new file mode 100644 index 00000000000000..6f2cf5c5cbf179 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/validTypes.js @@ -0,0 +1,216 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _jsdocTypePrattParser = require("jsdoc-type-pratt-parser"); + +var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const asExpression = /as\s+/u; + +const tryParsePathIgnoreError = path => { + try { + (0, _jsdocTypePrattParser.tryParse)(path); + return true; + } catch {// Keep the original error for including the whole type + } + + return false; +}; // eslint-disable-next-line complexity + + +var _default = (0, _iterateJsdoc.default)(({ + jsdoc, + report, + utils, + context, + settings +}) => { + const { + allowEmptyNamepaths = false + } = context.options[0] || {}; + const { + mode + } = settings; + + for (const tag of jsdoc.tags) { + const validNamepathParsing = function (namepath, tagName) { + if (tryParsePathIgnoreError(namepath)) { + return true; + } + + let handled = false; + + if (tagName) { + // eslint-disable-next-line default-case + switch (tagName) { + case 'module': + { + if (!namepath.startsWith('module:')) { + handled = tryParsePathIgnoreError(`module:${namepath}`); + } + + break; + } + + case 'memberof': + case 'memberof!': + { + const endChar = namepath.slice(-1); + + if (['#', '.', '~'].includes(endChar)) { + handled = tryParsePathIgnoreError(namepath.slice(0, -1)); + } + + break; + } + + case 'borrows': + { + const startChar = namepath.charAt(); + + if (['#', '.', '~'].includes(startChar)) { + handled = tryParsePathIgnoreError(namepath.slice(1)); + } + } + } + } + + if (!handled) { + report(`Syntax error in namepath: ${namepath}`, null, tag); + return false; + } + + return true; + }; + + const validTypeParsing = function (type) { + try { + if (mode === 'permissive') { + (0, _jsdocTypePrattParser.tryParse)(type); + } else { + (0, _jsdocTypePrattParser.parse)(type, mode); + } + } catch { + report(`Syntax error in type: ${type}`, null, tag); + return false; + } + + return true; + }; + + if (tag.tag === 'borrows') { + const thisNamepath = utils.getTagDescription(tag).replace(asExpression, '').trim(); + + if (!asExpression.test(utils.getTagDescription(tag)) || !thisNamepath) { + report(`@borrows must have an "as" expression. Found "${utils.getTagDescription(tag)}"`, null, tag); + continue; + } + + if (validNamepathParsing(thisNamepath, 'borrows')) { + const thatNamepath = tag.name; + validNamepathParsing(thatNamepath); + } + + continue; + } + + const otherModeMaps = ['jsdoc', 'typescript', 'closure', 'permissive'].filter(mde => { + return mde !== mode; + }).map(mde => { + return utils.getTagStructureForMode(mde); + }); + const tagMightHaveNamePosition = utils.tagMightHaveNamePosition(tag.tag, otherModeMaps); + + if (tagMightHaveNamePosition !== true && tag.name) { + const modeInfo = tagMightHaveNamePosition === false ? '' : ` in "${mode}" mode`; + report(`@${tag.tag} should not have a name${modeInfo}.`, null, tag); + continue; + } + + const mightHaveTypePosition = utils.tagMightHaveTypePosition(tag.tag, otherModeMaps); + + if (mightHaveTypePosition !== true && tag.type) { + const modeInfo = mightHaveTypePosition === false ? '' : ` in "${mode}" mode`; + report(`@${tag.tag} should not have a bracketed type${modeInfo}.`, null, tag); + continue; + } // REQUIRED NAME + + + const tagMustHaveNamePosition = utils.tagMustHaveNamePosition(tag.tag, otherModeMaps); // Don't handle `@param` here though it does require name as handled by + // `require-param-name` (`@property` would similarly seem to require one, + // but is handled by `require-property-name`) + + if (tagMustHaveNamePosition !== false && !tag.name && !allowEmptyNamepaths && !['param', 'arg', 'argument', 'property', 'prop'].includes(tag.tag) && (tag.tag !== 'see' || !utils.getTagDescription(tag).includes('{@link'))) { + const modeInfo = tagMustHaveNamePosition === true ? '' : ` in "${mode}" mode`; + report(`Tag @${tag.tag} must have a name/namepath${modeInfo}.`, null, tag); + continue; + } // REQUIRED TYPE + + + const mustHaveTypePosition = utils.tagMustHaveTypePosition(tag.tag, otherModeMaps); + + if (mustHaveTypePosition !== false && !tag.type) { + const modeInfo = mustHaveTypePosition === true ? '' : ` in "${mode}" mode`; + report(`Tag @${tag.tag} must have a type${modeInfo}.`, null, tag); + continue; + } // REQUIRED TYPE OR NAME/NAMEPATH + + + const tagMissingRequiredTypeOrNamepath = utils.tagMissingRequiredTypeOrNamepath(tag, otherModeMaps); + + if (tagMissingRequiredTypeOrNamepath !== false && !allowEmptyNamepaths) { + const modeInfo = tagMissingRequiredTypeOrNamepath === true ? '' : ` in "${mode}" mode`; + report(`Tag @${tag.tag} must have either a type or namepath${modeInfo}.`, null, tag); + continue; + } // VALID TYPE + + + const hasTypePosition = mightHaveTypePosition === true && Boolean(tag.type); + + if (hasTypePosition) { + validTypeParsing(tag.type); + } // VALID NAME/NAMEPATH + + + const hasNameOrNamepathPosition = (tagMustHaveNamePosition !== false || utils.tagMightHaveNamepath(tag.tag)) && Boolean(tag.name); + + if (hasNameOrNamepathPosition) { + if (mode !== 'jsdoc' && tag.tag === 'template') { + for (const namepath of utils.parseClosureTemplateTag(tag)) { + validNamepathParsing(namepath); + } + } else { + validNamepathParsing(tag.name, tag.tag); + } + } + } +}, { + iterateAllJsdocs: true, + meta: { + docs: { + description: 'Requires all types to be valid JSDoc or Closure compiler types without syntax errors.', + url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-valid-types' + }, + schema: [{ + additionalProperies: false, + properties: { + allowEmptyNamepaths: { + default: false, + type: 'boolean' + } + }, + type: 'object' + }], + type: 'suggestion' + } +}); + +exports.default = _default; +module.exports = exports.default; +//# sourceMappingURL=validTypes.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/tagNames.js b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/tagNames.js new file mode 100644 index 00000000000000..a02e0b73d1003a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/tagNames.js @@ -0,0 +1,146 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typeScriptTags = exports.jsdocTags = exports.closureTags = void 0; +const jsdocTagsUndocumented = { + // Undocumented but present; see + // https://github.com/jsdoc/jsdoc/issues/1283#issuecomment-516816802 + // https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js#L594 + modifies: [] +}; +const jsdocTags = { ...jsdocTagsUndocumented, + abstract: ['virtual'], + access: [], + alias: [], + async: [], + augments: ['extends'], + author: [], + borrows: [], + callback: [], + class: ['constructor'], + classdesc: [], + constant: ['const'], + constructs: [], + copyright: [], + default: ['defaultvalue'], + deprecated: [], + description: ['desc'], + enum: [], + event: [], + example: [], + exports: [], + external: ['host'], + file: ['fileoverview', 'overview'], + fires: ['emits'], + function: ['func', 'method'], + generator: [], + global: [], + hideconstructor: [], + ignore: [], + implements: [], + inheritdoc: [], + // Allowing casing distinct from jsdoc `definitions.js` (required in Closure) + inheritDoc: [], + inner: [], + instance: [], + interface: [], + kind: [], + lends: [], + license: [], + listens: [], + member: ['var'], + memberof: [], + 'memberof!': [], + mixes: [], + mixin: [], + module: [], + name: [], + namespace: [], + override: [], + package: [], + param: ['arg', 'argument'], + private: [], + property: ['prop'], + protected: [], + public: [], + readonly: [], + requires: [], + returns: ['return'], + see: [], + since: [], + static: [], + summary: [], + this: [], + throws: ['exception'], + todo: [], + tutorial: [], + type: [], + typedef: [], + variation: [], + version: [], + yields: ['yield'] +}; +exports.jsdocTags = jsdocTags; +const typeScriptTags = { ...jsdocTags, + // `@template` is also in TypeScript per: + // https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc + template: [] +}; +exports.typeScriptTags = typeScriptTags; +const undocumentedClosureTags = { + // These are in Closure source but not in jsdoc source nor in the Closure + // docs: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java + closurePrimitive: [], + customElement: [], + expose: [], + hidden: [], + idGenerator: [], + meaning: [], + mixinClass: [], + mixinFunction: [], + ngInject: [], + owner: [], + typeSummary: [], + wizaction: [] +}; +const { + /* eslint-disable no-unused-vars */ + inheritdoc, + // Will be inverted to prefer `return` + returns, + + /* eslint-enable no-unused-vars */ + ...typeScriptTagsInClosure +} = typeScriptTags; +const closureTags = { ...typeScriptTagsInClosure, + ...undocumentedClosureTags, + // From https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler + // These are all recognized in https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js + // except for the experimental `noinline` and the casing differences noted below + // Defined as a synonym of `const` in jsdoc `definitions.js` + define: [], + dict: [], + export: [], + externs: [], + final: [], + // With casing distinct from jsdoc `definitions.js` + implicitCast: [], + noalias: [], + nocollapse: [], + nocompile: [], + noinline: [], + nosideeffects: [], + polymer: [], + polymerBehavior: [], + preserve: [], + // Defined as a synonym of `interface` in jsdoc `definitions.js` + record: [], + return: ['returns'], + struct: [], + suppress: [], + unrestricted: [] +}; +exports.closureTags = closureTags; +//# sourceMappingURL=tagNames.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/package.json b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/package.json new file mode 100644 index 00000000000000..34e0bf74fb37fc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/package.json @@ -0,0 +1,111 @@ +{ + "author": { + "email": "gajus@gajus.com", + "name": "Gajus Kuizinas", + "url": "http://gajus.com" + }, + "dependencies": { + "@es-joy/jsdoccomment": "0.12.0", + "comment-parser": "1.3.0", + "debug": "^4.3.3", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "^2.0.0", + "regextras": "^0.8.0", + "semver": "^7.3.5", + "spdx-expression-parse": "^3.0.1" + }, + "description": "JSDoc linting rules for ESLint.", + "devDependencies": { + "@babel/cli": "^7.16.0", + "@babel/core": "^7.16.0", + "@babel/eslint-parser": "^7.16.3", + "@babel/node": "^7.16.0", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-transform-flow-strip-types": "^7.16.0", + "@babel/preset-env": "^7.16.4", + "@babel/register": "^7.16.0", + "@hkdobrev/run-if-changed": "^0.3.1", + "@typescript-eslint/parser": "^5.5.0", + "babel-plugin-add-module-exports": "^1.0.4", + "babel-plugin-istanbul": "^6.1.1", + "camelcase": "^6.2.1", + "chai": "^4.3.4", + "cross-env": "^7.0.3", + "decamelize": "^5.0.1", + "eslint": "^8.3.0", + "eslint-config-canonical": "^32.43.0", + "gitdown": "^3.1.4", + "glob": "^7.2.0", + "husky": "^7.0.4", + "lint-staged": "^12.1.2", + "lodash.defaultsdeep": "^4.6.1", + "mocha": "^9.1.3", + "nyc": "^15.1.0", + "open-editor": "^3.0.0", + "rimraf": "^3.0.2", + "semantic-release": "^18.0.1", + "typescript": "^4.5.2" + }, + "engines": { + "node": "^12 || ^14 || ^16 || ^17" + }, + "keywords": [ + "eslint", + "plugin", + "jsdoc" + ], + "license": "BSD-3-Clause", + "lint-staged": { + "./*.js": "npm run lint-arg --", + ".eslintignore": "npm run lint", + "src/**/*.js": "npm run lint-arg --", + "test/**/*.js": "npm run lint-arg --" + }, + "main": "./dist/index.js", + "name": "eslint-plugin-jsdoc", + "nyc": { + "branches": 100, + "check-coverage": false, + "exclude": [ + "src/rules/checkExamples.js" + ], + "functions": 100, + "include": [ + "src/" + ], + "instrument": false, + "lines": 100, + "require": [ + "@babel/register" + ], + "sourceMap": false, + "statements": 100 + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/gajus/eslint-plugin-jsdoc" + }, + "run-if-changed": { + "package-lock.json": "npm run install-offline" + }, + "scripts": { + "build": "rimraf ./dist && cross-env NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored", + "check-readme": "babel-node ./src/bin/generateReadme.js --check", + "create-readme": "babel-node ./src/bin/generateReadme.js", + "create-rule": "babel-node ./src/bin/generateRule.js", + "install-offline": "npm install --prefer-offline --no-audit", + "lint": "eslint --report-unused-disable-directives --ignore-pattern '!.ncurc.js' ./src ./test .ncurc.js", + "lint-arg": "eslint --report-unused-disable-directives", + "lint-fix": "eslint --report-unused-disable-directives --fix ./src ./test", + "prepare": "husky install", + "test": "cross-env BABEL_ENV=test nyc --reporter text-summary mocha --reporter dot --recursive --require @babel/register --timeout 12000", + "test-cov": "cross-env BABEL_ENV=test nyc mocha --reporter dot --recursive --require @babel/register --timeout 12000", + "test-index": "cross-env BABEL_ENV=test mocha --recursive --require @babel/register --reporter progress --timeout 12000 test/rules/index.js", + "test-no-cov": "cross-env BABEL_ENV=test mocha --reporter dot --recursive --require @babel/register --timeout 12000" + }, + "version": "37.1.0" +} diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md deleted file mode 100644 index fd8767b753596c..00000000000000 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md +++ /dev/null @@ -1,362 +0,0 @@ -# eslint-plugin-markdown - -[![npm Version](https://img.shields.io/npm/v/eslint-plugin-markdown.svg)](https://www.npmjs.com/package/eslint-plugin-markdown) -[![Build Status](https://img.shields.io/github/workflow/status/eslint/eslint-plugin-markdown/CI/main.svg)](https://github.com/eslint/eslint-plugin-markdown/actions) - -Lint JS, JSX, TypeScript, and more inside Markdown. - -A JS code snippet in a Markdown editor has red squiggly underlines. A tooltip explains the problem. - -## Usage - -### Installing - -Install the plugin alongside ESLint v6 or greater: - -```sh -npm install --save-dev eslint eslint-plugin-markdown -``` - -### Configuring - -Extending the `plugin:markdown/recommended` config will enable the Markdown processor on all `.md` files: - -```js -// .eslintrc.js -module.exports = { - extends: "plugin:markdown/recommended" -}; -``` - -#### Advanced Configuration - -Add the plugin to your `.eslintrc` and use the `processor` option in an `overrides` entry to enable the plugin's `markdown/markdown` processor on Markdown files. -Each fenced code block inside a Markdown document has a virtual filename appended to the Markdown file's path. -The virtual filename's extension will match the fenced code block's syntax tag, so for example, ```js code blocks in README.md would match README.md/*.js. -[`overrides` glob patterns](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) for these virtual filenames can customize configuration for code blocks without affecting regular code. -For more information on configuring processors, refer to the [ESLint documentation](https://eslint.org/docs/user-guide/configuring#specifying-processor). - -```js -// .eslintrc.js -module.exports = { - // 1. Add the plugin. - plugins: ["markdown"], - overrides: [ - { - // 2. Enable the Markdown processor for all .md files. - files: ["**/*.md"], - processor: "markdown/markdown" - }, - { - // 3. Optionally, customize the configuration ESLint uses for ```js - // fenced code blocks inside .md files. - files: ["**/*.md/*.js"], - // ... - rules: { - // ... - } - } - ] -}; -``` - -#### Frequently-Disabled Rules - -Some rules that catch mistakes in regular code are less helpful in documentation. -For example, `no-undef` would flag variables that are declared outside of a code snippet because they aren't relevant to the example. -The `plugin:markdown/recommended` config disables these rules in Markdown files: - -- [`no-undef`](https://eslint.org/docs/rules/no-undef) -- [`no-unused-expressions`](https://eslint.org/docs/rules/no-unused-expressions) -- [`no-unused-vars`](https://eslint.org/docs/rules/no-unused-vars) -- [`padded-blocks`](https://eslint.org/docs/rules/padded-blocks) - -Use [`overrides` glob patterns](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to disable more rules just for Markdown code blocks: - -```js -module.exports = { - // ... - overrides: [ - // ... - { - // 1. Target ```js code blocks in .md files. - files: ["**/*.md/*.js"], - rules: { - // 2. Disable other rules. - "no-console": "off", - "import/no-unresolved": "off" - } - } - ] -}; -``` - -#### Strict Mode - -`"use strict"` directives in every code block would be annoying. -The `plugin:markdown/recommended` config enables the [`impliedStrict` parser option](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) and disables the [`strict` rule](https://eslint.org/docs/rules/strict) in Markdown files. -This opts into strict mode parsing without repeated `"use strict"` directives. - -#### Unsatisfiable Rules - -Markdown code blocks are not real files, so ESLint's file-format rules do not apply. -The `plugin:markdown/recommended` config disables these rules in Markdown files: - -- [`eol-last`](https://eslint.org/docs/rules/eol-last): The Markdown parser trims trailing newlines from code blocks. -- [`unicode-bom`](https://eslint.org/docs/rules/unicode-bom): Markdown code blocks do not have Unicode Byte Order Marks. - -#### Migrating from `eslint-plugin-markdown` v1 - -`eslint-plugin-markdown` v1 used an older version of ESLint's processor API. -The Markdown processor automatically ran on `.md`, `.mkdn`, `.mdown`, and `.markdown` files, and it only extracted fenced code blocks marked with `js`, `javascript`, `jsx`, or `node` syntax. -Configuration specifically for fenced code blocks went inside an `overrides` entry with a `files` pattern matching the containing Markdown document's filename that applied to all fenced code blocks inside the file. - -```js -// .eslintrc.js for eslint-plugin-markdown v1 -module.exports = { - plugins: ["markdown"], - overrides: [ - { - files: ["**/*.md"], - // In v1, configuration for fenced code blocks went inside an - // `overrides` entry with a .md pattern, for example: - parserOptions: { - ecmaFeatures: { - impliedStrict: true - } - }, - rules: { - "no-console": "off" - } - } - ] -}; -``` - -[RFC3](https://github.com/eslint/rfcs/blob/master/designs/2018-processors-improvements/README.md) designed a new processor API to remove these limitations, and the new API was [implemented](https://github.com/eslint/eslint/pull/11552) as part of ESLint v6. -`eslint-plugin-markdown` v2 uses this new API. - -```bash -$ npm install --save-dev eslint@latest eslint-plugin-markdown@latest -``` - -All of the Markdown file extensions that were previously hard-coded are now fully configurable in `.eslintrc.js`. -Use the new `processor` option to apply the `markdown/markdown` processor on any Markdown documents matching a `files` pattern. -Each fenced code block inside a Markdown document has a virtual filename appended to the Markdown file's path. -The virtual filename's extension will match the fenced code block's syntax tag, so for example, ```js code blocks in README.md would match README.md/*.js. - -```js -// eslintrc.js for eslint-plugin-markdown v2 -module.exports = { - plugins: ["markdown"], - overrides: [ - { - // In v2, explicitly apply eslint-plugin-markdown's `markdown` - // processor on any Markdown files you want to lint. - files: ["**/*.md"], - processor: "markdown/markdown" - }, - { - // In v2, configuration for fenced code blocks is separate from the - // containing Markdown file. Each code block has a virtual filename - // appended to the Markdown file's path. - files: ["**/*.md/*.js"], - // Configuration for fenced code blocks goes with the override for - // the code block's virtual filename, for example: - parserOptions: { - ecmaFeatures: { - impliedStrict: true - } - }, - rules: { - "no-console": "off" - } - } - ] -}; -``` - -If you need to precisely mimic the behavior of v1 with the hard-coded Markdown extensions and fenced code block syntaxes, you can use those as glob patterns in `overrides[].files`: - -```js -// eslintrc.js for v2 mimicking v1 behavior -module.exports = { - plugins: ["markdown"], - overrides: [ - { - files: ["**/*.{md,mkdn,mdown,markdown}"], - processor: "markdown/markdown" - }, - { - files: ["**/*.{md,mkdn,mdown,markdown}/*.{js,javascript,jsx,node}"] - // ... - } - ] -}; -``` - -### Running - -#### ESLint v7 - -You can run ESLint as usual and do not need to use the `--ext` option. -ESLint v7 [automatically lints file extensions specified in `overrides[].files` patterns in config files](https://github.com/eslint/rfcs/blob/0253e3a95511c65d622eaa387eb73f824249b467/designs/2019-additional-lint-targets/README.md). - -#### ESLint v6 - -Use the [`--ext` option](https://eslint.org/docs/user-guide/command-line-interface#ext) to include `.js` and `.md` extensions in ESLint's file search: - -```sh -eslint --ext js,md . -``` - -### Autofixing - -With this plugin, [ESLint's `--fix` option](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some issues in your Markdown fenced code blocks. -To enable this, pass the `--fix` flag when you run ESLint: - -```bash -eslint --fix . -``` - -## What Gets Linted? - -With this plugin, ESLint will lint [fenced code blocks](https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks) in your Markdown documents: - -````markdown -```js -// This gets linted -var answer = 6 * 7; -console.log(answer); -``` - -Here is some regular Markdown text that will be ignored. - -```js -// This also gets linted - -/* eslint quotes: [2, "double"] */ - -function hello() { - console.log("Hello, world!"); -} -hello(); -``` - -```jsx -// This can be linted too if you add `.jsx` files to `overrides` in ESLint v7 -// or pass `--ext jsx` in ESLint v6. -var div =
; -``` -```` - -Blocks that don't specify a syntax are ignored: - -````markdown -``` -This is plain text and doesn't get linted. -``` -```` - -Unless a fenced code block's syntax appears as a file extension in `overrides[].files` in ESLint v7, it will be ignored. -If using ESLint v6, you must also include the extension with the `--ext` option. - -````markdown -```python -print("This doesn't get linted either.") -``` -```` - -## Configuration Comments - -The processor will convert HTML comments immediately preceding a code block into JavaScript block comments and insert them at the beginning of the source code that it passes to ESLint. -This permits configuring ESLint via configuration comments while keeping the configuration comments themselves hidden when the markdown is rendered. -Comment bodies are passed through unmodified, so the plugin supports any [configuration comments](http://eslint.org/docs/user-guide/configuring) supported by ESLint itself. - -This example enables the `browser` environment, disables the `no-alert` rule, and configures the `quotes` rule to prefer single quotes: - -````markdown - - - - -```js -alert('Hello, world!'); -``` -```` - -Each code block in a file is linted separately, so configuration comments apply only to the code block that immediately follows. - -````markdown -Assuming `no-alert` is enabled in `.eslintrc`, the first code block will have no error from `no-alert`: - - - - -```js -alert("Hello, world!"); -``` - -But the next code block will have an error from `no-alert`: - - - -```js -alert("Hello, world!"); -``` -```` - -### Skipping Blocks - -Sometimes it can be useful to have code blocks marked with `js` even though they don't contain valid JavaScript syntax, such as commented JSON blobs that need `js` syntax highlighting. -Standard `eslint-disable` comments only silence rule reporting, but ESLint still reports any syntax errors it finds. -In cases where a code block should not even be parsed, insert a non-standard `` comment before the block, and this plugin will hide the following block from ESLint. -Neither rule nor syntax errors will be reported. - -````markdown -There are comments in this JSON, so we use `js` syntax for better -highlighting. Skip the block to prevent warnings about invalid syntax. - - - -```js -{ - // This code block is hidden from ESLint. - "hello": "world" -} -``` - -```js -console.log("This code block is linted normally."); -``` -```` - -## Editor Integrations - -### VSCode - -[`vscode-eslint`](https://github.com/microsoft/vscode-eslint) has built-in support for the Markdown processor. - -### Atom - -The [`linter-eslint`](https://atom.io/packages/linter-eslint) package allows for linting within the [Atom IDE](https://atom.io/). - -In order to see `eslint-plugin-markdown` work its magic within Markdown code blocks in your Atom editor, you can go to `linter-eslint`'s settings and within "List of scopes to run ESLint on...", add the cursor scope "source.gfm". - -However, this reports a problem when viewing Markdown which does not have configuration, so you may wish to use the cursor scope "source.embedded.js", but note that `eslint-plugin-markdown` configuration comments and skip directives won't work in this context. - -## Contributing - -```sh -$ git clone https://github.com/eslint/eslint-plugin-markdown.git -$ cd eslint-plugin-markdown -$ npm install -$ npm test -``` - -This project follows the [ESLint contribution guidelines](http://eslint.org/docs/developer-guide/contributing/). diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/README.md b/tools/node_modules/eslint/node_modules/eslint-scope/README.md deleted file mode 100644 index 4ad41d5c1e43d0..00000000000000 --- a/tools/node_modules/eslint/node_modules/eslint-scope/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# ESLint Scope - -ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). - -## Install - -``` -npm i eslint-scope --save -``` - -## 📖 Usage - -To use in an ESM file: - -```js -import * as eslintScope from 'eslint-scope'; -``` - -To use in a CommonJS file: - -```js -const eslintScope = require('eslint-scope'); -``` - -Example: - -```js -import * as eslintScope from 'eslint-scope'; -import * as espree from 'espree'; -import estraverse from 'estraverse'; - -const ast = espree.parse(code, { range: true }); -const scopeManager = eslintScope.analyze(ast); - -const currentScope = scopeManager.acquire(ast); // global scope - -estraverse.traverse(ast, { - enter (node, parent) { - // do stuff - - if (/Function/.test(node.type)) { - currentScope = scopeManager.acquire(node); // get current function scope - } - }, - leave(node, parent) { - if (/Function/.test(node.type)) { - currentScope = currentScope.upper; // set to parent scope - } - - // do stuff - } -}); -``` - -## Contributing - -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues). - -## Build Commands - -* `npm test` - run all linting and tests -* `npm run lint` - run all linting - -## License - -ESLint Scope is licensed under a permissive BSD 2-clause license. diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/README.md b/tools/node_modules/eslint/node_modules/eslint-utils/README.md deleted file mode 100644 index 0b917591b0220b..00000000000000 --- a/tools/node_modules/eslint/node_modules/eslint-utils/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# eslint-utils - -[![npm version](https://img.shields.io/npm/v/eslint-utils.svg)](https://www.npmjs.com/package/eslint-utils) -[![Downloads/month](https://img.shields.io/npm/dm/eslint-utils.svg)](http://www.npmtrends.com/eslint-utils) -[![Build Status](https://github.com/mysticatea/eslint-utils/workflows/CI/badge.svg)](https://github.com/mysticatea/eslint-utils/actions) -[![Coverage Status](https://codecov.io/gh/mysticatea/eslint-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-utils) -[![Dependency Status](https://david-dm.org/mysticatea/eslint-utils.svg)](https://david-dm.org/mysticatea/eslint-utils) - -## 🏁 Goal - -This package provides utility functions and classes for make ESLint custom rules. - -For examples: - -- [getStaticValue](https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue) evaluates static value on AST. -- [ReferenceTracker](https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. - -## 📖 Usage - -See [documentation](https://eslint-utils.mysticatea.dev/). - -## 📰 Changelog - -See [releases](https://github.com/mysticatea/eslint-utils/releases). - -## ❤️ Contributing - -Welcome contributing! - -Please use GitHub's Issues/PRs. - -### Development Tools - -- `npm test` runs tests and measures coverage. -- `npm run clean` removes the coverage result of `npm test` command. -- `npm run coverage` shows the coverage result of the last `npm test` command. -- `npm run lint` runs ESLint. -- `npm run watch` runs tests on each file change. diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md deleted file mode 100644 index d7dbe65fa010bc..00000000000000 --- a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# eslint-visitor-keys - -[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) -[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) -[![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) -[![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) - -Constants and utilities about visitor keys to traverse AST. - -## 💿 Installation - -Use [npm] to install. - -```bash -$ npm install eslint-visitor-keys -``` - -### Requirements - -- [Node.js] 10.0.0 or later. - -## 📖 Usage - -```js -const evk = require("eslint-visitor-keys") -``` - -### evk.KEYS - -> type: `{ [type: string]: string[] | undefined }` - -Visitor keys. This keys are frozen. - -This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. - -For example: - -``` -console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] -``` - -### evk.getKeys(node) - -> type: `(node: object) => string[]` - -Get the visitor keys of a given AST node. - -This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. - -This will be used to traverse unknown nodes. - -For example: - -``` -const node = { - type: "AssignmentExpression", - left: { type: "Identifier", name: "foo" }, - right: { type: "Literal", value: 0 } -} -console.log(evk.getKeys(node)) // → ["type", "left", "right"] -``` - -### evk.unionWith(additionalKeys) - -> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` - -Make the union set with `evk.KEYS` and the given keys. - -- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. -- It removes duplicated keys as keeping the first one. - -For example: - -``` -console.log(evk.unionWith({ - MethodDefinition: ["decorators"] -})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } -``` - -## 📰 Change log - -See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). - -## 🍻 Contributing - -Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). - -### Development commands - -- `npm test` runs tests and measures code coverage. -- `npm run lint` checks source codes with ESLint. -- `npm run coverage` opens the code coverage report of the previous test with your default browser. -- `npm run release` publishes this package to [npm] registory. - - -[npm]: https://www.npmjs.com/ -[Node.js]: https://nodejs.org/en/ -[ESTree]: https://github.com/estree/estree diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md deleted file mode 100644 index 8bc9149dceb05d..00000000000000 --- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# eslint-visitor-keys - -[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) -[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) -[![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) -[![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) - -Constants and utilities about visitor keys to traverse AST. - -## 💿 Installation - -Use [npm] to install. - -```bash -$ npm install eslint-visitor-keys -``` - -### Requirements - -- [Node.js] `^12.22.0`, `^14.17.0`, or `>=16.0.0` - - -## 📖 Usage - -To use in an ESM file: - -```js -import * as evk from "eslint-visitor-keys" -``` - -To use in a CommonJS file: - -```js -const evk = require("eslint-visitor-keys") -``` - -### evk.KEYS - -> type: `{ [type: string]: string[] | undefined }` - -Visitor keys. This keys are frozen. - -This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. - -For example: - -``` -console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] -``` - -### evk.getKeys(node) - -> type: `(node: object) => string[]` - -Get the visitor keys of a given AST node. - -This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. - -This will be used to traverse unknown nodes. - -For example: - -``` -const node = { - type: "AssignmentExpression", - left: { type: "Identifier", name: "foo" }, - right: { type: "Literal", value: 0 } -} -console.log(evk.getKeys(node)) // → ["type", "left", "right"] -``` - -### evk.unionWith(additionalKeys) - -> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` - -Make the union set with `evk.KEYS` and the given keys. - -- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. -- It removes duplicated keys as keeping the first one. - -For example: - -``` -console.log(evk.unionWith({ - MethodDefinition: ["decorators"] -})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } -``` - -## 📰 Change log - -See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). - -## 🍻 Contributing - -Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). - -### Development commands - -- `npm test` runs tests and measures code coverage. -- `npm run lint` checks source codes with ESLint. -- `npm run coverage` opens the code coverage report of the previous test with your default browser. -- `npm run release` publishes this package to [npm] registory. - - -[npm]: https://www.npmjs.com/ -[Node.js]: https://nodejs.org/ -[ESTree]: https://github.com/estree/estree diff --git a/tools/node_modules/eslint/node_modules/espree/README.md b/tools/node_modules/eslint/node_modules/espree/README.md deleted file mode 100644 index b8bad72b4ceebe..00000000000000 --- a/tools/node_modules/eslint/node_modules/espree/README.md +++ /dev/null @@ -1,247 +0,0 @@ -[![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree) -[![Build Status](https://travis-ci.org/eslint/espree.svg?branch=master)](https://travis-ci.org/eslint/espree) -[![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree) -[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE) - -# Espree - -Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of [Acorn](https://github.com/ternjs/acorn), which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima. - -## Usage - -Install: - -``` -npm i espree -``` - -To use in an ESM file: - -```js -import * as espree from "espree"; - -const ast = espree.parse(code); -``` - -To use in a Common JS file: - -```js -const espree = require("espree"); - -const ast = espree.parse(code); -``` - -## API - -### `parse()` - -`parse` parses the given code and returns a abstract syntax tree (AST). It takes two parameters. - -- `code` [string]() - the code which needs to be parsed. -- `options (Optional)` [Object]() - read more about this [here](#options). - -```js -import * as espree from "espree"; - -const ast = espree.parse(code); -``` - -**Example :** - -```js -const ast = espree.parse('let foo = "bar"', { ecmaVersion: 6 }); -console.log(ast); -``` - -
Output -

- -``` -Node { - type: 'Program', - start: 0, - end: 15, - body: [ - Node { - type: 'VariableDeclaration', - start: 0, - end: 15, - declarations: [Array], - kind: 'let' - } - ], - sourceType: 'script' -} -``` - -

-
- -### `tokenize()` - -`tokenize` returns the tokens of a given code. It takes two parameters. - -- `code` [string]() - the code which needs to be parsed. -- `options (Optional)` [Object]() - read more about this [here](#options). - -Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array - -**Example :** - -```js -import * as espree from "espree"; - -const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 }); -console.log(tokens); -``` - -
Output -

- -``` -Token { type: 'Keyword', value: 'let', start: 0, end: 3 }, -Token { type: 'Identifier', value: 'foo', start: 4, end: 7 }, -Token { type: 'Punctuator', value: '=', start: 8, end: 9 }, -Token { type: 'String', value: '"bar"', start: 10, end: 15 } -``` - -

-
- -### `version` - -Returns the current `espree` version - -### `VisitorKeys` - -Returns all visitor keys for traversing the AST from [eslint-visitor-keys](https://github.com/eslint/eslint-visitor-keys) - -### `latestEcmaVersion` - -Returns the latest ECMAScript supported by `espree` - -### `supportedEcmaVersions` - -Returns an array of all supported ECMAScript versions - -## Options - -```js -const options = { - // attach range information to each node - range: false, - - // attach line/column location information to each node - loc: false, - - // create a top-level comments array containing all comments - comment: false, - - // create a top-level tokens array containing all tokens - tokens: false, - - // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. - // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), or 2022 (same as 13) to use the year-based naming. - // You can also set "latest" to use the most recently supported version. - ecmaVersion: 5, - - // specify which type of script you're parsing ("script", "module", or "commonjs") - sourceType: "script", - - // specify additional language features - ecmaFeatures: { - - // enable JSX parsing - jsx: false, - - // enable return in global scope (set to true automatically when sourceType is "commonjs") - globalReturn: false, - - // enable implied strict mode (if ecmaVersion >= 5) - impliedStrict: false - } -} -``` - -## Esprima Compatibility Going Forward - -The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the [ESTree](https://github.com/estree/estree) API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same. - -Espree may also deviate from Esprima in the interface it exposes. - -## Contributing - -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/espree/issues). - -Espree is licensed under a permissive BSD 2-clause license. - -## Security Policy - -We work hard to ensure that Espree is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). - -## Build Commands - -* `npm test` - run all linting and tests -* `npm run lint` - run all linting - -## Differences from Espree 2.x - -* The `tokenize()` method does not use `ecmaFeatures`. Any string will be tokenized completely based on ECMAScript 6 semantics. -* Trailing whitespace no longer is counted as part of a node. -* `let` and `const` declarations are no longer parsed by default. You must opt-in by using an `ecmaVersion` newer than `5` or setting `sourceType` to `module`. -* The `esparse` and `esvalidate` binary scripts have been removed. -* There is no `tolerant` option. We will investigate adding this back in the future. - -## Known Incompatibilities - -In an effort to help those wanting to transition from other parsers to Espree, the following is a list of noteworthy incompatibilities with other parsers. These are known differences that we do not intend to change. - -### Esprima 1.2.2 - -* Esprima counts trailing whitespace as part of each AST node while Espree does not. In Espree, the end of a node is where the last token occurs. -* Espree does not parse `let` and `const` declarations by default. -* Error messages returned for parsing errors are different. -* There are two addition properties on every node and token: `start` and `end`. These represent the same data as `range` and are used internally by Acorn. - -### Esprima 2.x - -* Esprima 2.x uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2. - -## Frequently Asked Questions - -### Why another parser - -[ESLint](http://eslint.org) had been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development increased dramatically and Esprima had fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that caused our users frustration. - -We decided the only way for us to move forward was to create our own parser, bringing us inline with JSHint and JSLint, and allowing us to keep implementing new features as we need them. We chose to fork Esprima instead of starting from scratch in order to move as quickly as possible with a compatible API. - -With Espree 2.0.0, we are no longer a fork of Esprima but rather a translation layer between Acorn and Esprima syntax. This allows us to put work back into a community-supported parser (Acorn) that is continuing to grow and evolve while maintaining an Esprima-compatible parser for those utilities still built on Esprima. - -### Have you tried working with Esprima? - -Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima and will continue to do so. However, there are some different philosophies around how the projects work that need to be worked through. The initial goal was to have Espree track Esprima and eventually merge the two back together, but we ultimately decided that building on top of Acorn was a better choice due to Acorn's plugin support. - -### Why don't you just use Acorn? - -Acorn is a great JavaScript parser that produces an AST that is compatible with Esprima. Unfortunately, ESLint relies on more than just the AST to do its job. It relies on Esprima's tokens and comment attachment features to get a complete picture of the source code. We investigated switching to Acorn, but the inconsistencies between Esprima and Acorn created too much work for a project like ESLint. - -We are building on top of Acorn, however, so that we can contribute back and help make Acorn even better. - -### What ECMAScript features do you support? - -Espree supports all ECMAScript 2021 features and partially supports ECMAScript 2022 features. - -Because ECMAScript 2022 is still under development, we are implementing features as they are finalized. Currently, Espree supports: - -* [Class instance fields](https://github.com/tc39/proposal-class-fields) -* [Class private instance methods and accessors](https://github.com/tc39/proposal-private-methods) -* [Class static fields, static private methods and accessors](https://github.com/tc39/proposal-static-class-features) -* [RegExp match indices](https://github.com/tc39/proposal-regexp-match-indices) -* [Top-level await](https://github.com/tc39/proposal-top-level-await) -* [Class static initialization blocks](https://github.com/tc39/proposal-class-static-block) - -See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized. - -### How do you determine which experimental features to support? - -In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features. diff --git a/tools/node_modules/eslint/node_modules/esquery/README.md b/tools/node_modules/eslint/node_modules/esquery/README.md deleted file mode 100644 index 8264efcb90db96..00000000000000 --- a/tools/node_modules/eslint/node_modules/esquery/README.md +++ /dev/null @@ -1,27 +0,0 @@ -ESQuery is a library for querying the AST output by Esprima for patterns of syntax using a CSS style selector system. Check out the demo: - -[demo](https://estools.github.io/esquery/) - -The following selectors are supported: -* AST node type: `ForStatement` -* [wildcard](http://dev.w3.org/csswg/selectors4/#universal-selector): `*` -* [attribute existence](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr]` -* [attribute value](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr="foo"]` or `[attr=123]` -* attribute regex: `[attr=/foo.*/]` or (with flags) `[attr=/foo.*/is]` -* attribute conditions: `[attr!="foo"]`, `[attr>2]`, `[attr<3]`, `[attr>=2]`, or `[attr<=3]` -* nested attribute: `[attr.level2="foo"]` -* field: `FunctionDeclaration > Identifier.id` -* [First](http://dev.w3.org/csswg/selectors4/#the-first-child-pseudo) or [last](http://dev.w3.org/csswg/selectors4/#the-last-child-pseudo) child: `:first-child` or `:last-child` -* [nth-child](http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo) (no ax+b support): `:nth-child(2)` -* [nth-last-child](http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo) (no ax+b support): `:nth-last-child(1)` -* [descendant](http://dev.w3.org/csswg/selectors4/#descendant-combinators): `ancestor descendant` -* [child](http://dev.w3.org/csswg/selectors4/#child-combinators): `parent > child` -* [following sibling](http://dev.w3.org/csswg/selectors4/#general-sibling-combinators): `node ~ sibling` -* [adjacent sibling](http://dev.w3.org/csswg/selectors4/#adjacent-sibling-combinators): `node + adjacent` -* [negation](http://dev.w3.org/csswg/selectors4/#negation-pseudo): `:not(ForStatement)` -* [has](https://drafts.csswg.org/selectors-4/#has-pseudo): `:has(ForStatement)` -* [matches-any](http://dev.w3.org/csswg/selectors4/#matches): `:matches([attr] > :first-child, :last-child)` -* [subject indicator](http://dev.w3.org/csswg/selectors4/#subject): `!IfStatement > [name="foo"]` -* class of AST node: `:statement`, `:expression`, `:declaration`, `:function`, or `:pattern` - -[![Build Status](https://travis-ci.org/estools/esquery.png?branch=master)](https://travis-ci.org/estools/esquery) diff --git a/tools/node_modules/eslint/node_modules/esrecurse/README.md b/tools/node_modules/eslint/node_modules/esrecurse/README.md deleted file mode 100644 index ffea6b434a4a63..00000000000000 --- a/tools/node_modules/eslint/node_modules/esrecurse/README.md +++ /dev/null @@ -1,171 +0,0 @@ -### Esrecurse [![Build Status](https://travis-ci.org/estools/esrecurse.svg?branch=master)](https://travis-ci.org/estools/esrecurse) - -Esrecurse ([esrecurse](https://github.com/estools/esrecurse)) is -[ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm) -recursive traversing functionality. - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -esrecurse.visit(ast, { - XXXStatement: function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); - } -}); -``` - -We can use `Visitor` instance. - -```javascript -var visitor = new esrecurse.Visitor({ - XXXStatement: function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); - } -}); - -visitor.visit(ast); -``` - -We can inherit `Visitor` instance easily. - -```javascript -class Derived extends esrecurse.Visitor { - constructor() - { - super(null); - } - - XXXStatement(node) { - } -} -``` - -```javascript -function DerivedVisitor() { - esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); -} -util.inherits(DerivedVisitor, esrecurse.Visitor); -DerivedVisitor.prototype.XXXStatement = function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); -}; -``` - -And you can invoke default visiting operation inside custom visit operation. - -```javascript -function DerivedVisitor() { - esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); -} -util.inherits(DerivedVisitor, esrecurse.Visitor); -DerivedVisitor.prototype.XXXStatement = function (node) { - // do something... - this.visitChildren(node); -}; -``` - -The `childVisitorKeys` option does customize the behaviour of `this.visitChildren(node)`. -We can use user-defined node types. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - // Extending the existing traversing rules. - childVisitorKeys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } - } -); -``` - -We can use the `fallback` option as well. -If the `fallback` option is `"iteration"`, `esrecurse` would visit all enumerable properties of unknown nodes. -Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). - -```javascript -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - fallback: 'iteration' - } -); -``` - -If the `fallback` option is a function, `esrecurse` calls this function to determine the enumerable properties of unknown nodes. -Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). - -```javascript -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - fallback: function (node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument' - }); - } - } -); -``` - -### License - -Copyright (C) 2014 [Yusuke Suzuki](https://github.com/Constellation) - (twitter: [@Constellation](https://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/eslint/node_modules/estraverse/README.md b/tools/node_modules/eslint/node_modules/estraverse/README.md deleted file mode 100644 index ccd3377f3e9449..00000000000000 --- a/tools/node_modules/eslint/node_modules/estraverse/README.md +++ /dev/null @@ -1,153 +0,0 @@ -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) - -Estraverse ([estraverse](http://github.com/estools/estraverse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -traversal functions from [esmangle project](http://github.com/estools/esmangle). - -### Documentation - -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -estraverse.traverse(ast, { - enter: function (node, parent) { - if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') - return estraverse.VisitorOption.Skip; - }, - leave: function (node, parent) { - if (node.type == 'VariableDeclarator') - console.log(node.id.name); - } -}); -``` - -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. - -```javascript -estraverse.traverse(ast, { - enter: function (node) { - this.break(); - } -}); -``` - -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. - -```javascript -result = estraverse.replace(tree, { - enter: function (node) { - // Replace it with replaced. - if (node.type === 'Literal') - return replaced; - } -}); -``` - -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Extending the existing traversing rules. - keys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } -}); -``` - -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Iterating the child **nodes** of unknown nodes. - fallback: 'iteration' -}); -``` - -When `visitor.fallback` is a function, we can determine which keys to visit on each node. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Skip the `argument` property of each node - fallback: function(node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument'; - }); - } -}); -``` - -### License - -Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/eslint/node_modules/esutils/README.md b/tools/node_modules/eslint/node_modules/esutils/README.md deleted file mode 100644 index 517526cfb99b97..00000000000000 --- a/tools/node_modules/eslint/node_modules/esutils/README.md +++ /dev/null @@ -1,174 +0,0 @@ -### esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils) -esutils ([esutils](http://github.com/estools/esutils)) is -utility box for ECMAScript language tools. - -### API - -### ast - -#### ast.isExpression(node) - -Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section -[11](https://es5.github.io/#x11). - -#### ast.isStatement(node) - -Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section -[12](https://es5.github.io/#x12). - -#### ast.isIterationStatement(node) - -Returns true if `node` is an IterationStatement as defined in ECMA262 edition -5.1 section [12.6](https://es5.github.io/#x12.6). - -#### ast.isSourceElement(node) - -Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1 -section [14](https://es5.github.io/#x14). - -#### ast.trailingStatement(node) - -Returns `Statement?` if `node` has trailing `Statement`. -```js -if (cond) - consequent; -``` -When taking this `IfStatement`, returns `consequent;` statement. - -#### ast.isProblematicIfStatement(node) - -Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code. -```js -{ - type: 'IfStatement', - consequent: { - type: 'WithStatement', - body: { - type: 'IfStatement', - consequent: {type: 'EmptyStatement'} - } - }, - alternate: {type: 'EmptyStatement'} -} -``` -The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`. - - -### code - -#### code.isDecimalDigit(code) - -Return true if provided code is decimal digit. - -#### code.isHexDigit(code) - -Return true if provided code is hexadecimal digit. - -#### code.isOctalDigit(code) - -Return true if provided code is octal digit. - -#### code.isWhiteSpace(code) - -Return true if provided code is white space. White space characters are formally defined in ECMA262. - -#### code.isLineTerminator(code) - -Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262. - -#### code.isIdentifierStart(code) - -Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262. - -#### code.isIdentifierPart(code) - -Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262. - -### keyword - -#### keyword.isKeywordES5(id, strict) - -Returns `true` if provided identifier string is a Keyword or Future Reserved Word -in ECMA262 edition 5.1. They are formally defined in ECMA262 sections -[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2), -respectively. If the `strict` flag is truthy, this function additionally checks whether -`id` is a Keyword or Future Reserved Word under strict mode. - -#### keyword.isKeywordES6(id, strict) - -Returns `true` if provided identifier string is a Keyword or Future Reserved Word -in ECMA262 edition 6. They are formally defined in ECMA262 sections -[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and -[11.6.2.2](http://ecma-international.org/ecma-262/6.0/#sec-future-reserved-words), -respectively. If the `strict` flag is truthy, this function additionally checks whether -`id` is a Keyword or Future Reserved Word under strict mode. - -#### keyword.isReservedWordES5(id, strict) - -Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1. -They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1). -If the `strict` flag is truthy, this function additionally checks whether `id` -is a Reserved Word under strict mode. - -#### keyword.isReservedWordES6(id, strict) - -Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. -They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words). -If the `strict` flag is truthy, this function additionally checks whether `id` -is a Reserved Word under strict mode. - -#### keyword.isRestrictedWord(id) - -Returns `true` if provided identifier string is one of `eval` or `arguments`. -They are restricted in strict mode code throughout ECMA262 edition 5.1 and -in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors). - -#### keyword.isIdentifierNameES5(id) - -Return true if provided identifier string is an IdentifierName as specified in -ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). - -#### keyword.isIdentifierNameES6(id) - -Return true if provided identifier string is an IdentifierName as specified in -ECMA262 edition 6 section [11.6](http://ecma-international.org/ecma-262/6.0/#sec-names-and-keywords). - -#### keyword.isIdentifierES5(id, strict) - -Return true if provided identifier string is an Identifier as specified in -ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict` -flag is truthy, this function additionally checks whether `id` is an Identifier -under strict mode. - -#### keyword.isIdentifierES6(id, strict) - -Return true if provided identifier string is an Identifier as specified in -ECMA262 edition 6 section [12.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers). -If the `strict` flag is truthy, this function additionally checks whether `id` -is an Identifier under strict mode. - -### License - -Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/eslint/node_modules/fast-deep-equal/README.md b/tools/node_modules/eslint/node_modules/fast-deep-equal/README.md deleted file mode 100644 index d3f4ffcc316f96..00000000000000 --- a/tools/node_modules/eslint/node_modules/fast-deep-equal/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# fast-deep-equal -The fastest deep equal with ES6 Map, Set and Typed arrays support. - -[![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal) -[![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal) -[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master) - - -## Install - -```bash -npm install fast-deep-equal -``` - - -## Features - -- ES5 compatible -- works in node.js (8+) and browsers (IE9+) -- checks equality of Date and RegExp objects by value. - -ES6 equal (`require('fast-deep-equal/es6')`) also supports: -- Maps -- Sets -- Typed arrays - - -## Usage - -```javascript -var equal = require('fast-deep-equal'); -console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true -``` - -To support ES6 Maps, Sets and Typed arrays equality use: - -```javascript -var equal = require('fast-deep-equal/es6'); -console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true -``` - -To use with React (avoiding the traversal of React elements' _owner -property that contains circular references and is not needed when -comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)): - -```javascript -var equal = require('fast-deep-equal/react'); -var equal = require('fast-deep-equal/es6/react'); -``` - - -## Performance benchmark - -Node.js v12.6.0: - -``` -fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled) -fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled) -fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled) -nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled) -shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled) -underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled) -lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled) -deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled) -deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled) -ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled) -util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled) -assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled) - -The fastest is fast-deep-equal -``` - -To run benchmark (requires node.js 6+): - -```bash -npm run benchmark -``` - -__Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application. - - -## Enterprise support - -fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. - - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. - - -## License - -[MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE) diff --git a/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/README.md b/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/README.md deleted file mode 100644 index 02cf49ff385b8b..00000000000000 --- a/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# fast-json-stable-stringify - -Deterministic `JSON.stringify()` - a faster version of [@substack](https://github.com/substack)'s json-stable-strigify without [jsonify](https://github.com/substack/jsonify). - -You can also pass in a custom comparison function. - -[![Build Status](https://travis-ci.org/epoberezkin/fast-json-stable-stringify.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-json-stable-stringify) -[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-json-stable-stringify/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-json-stable-stringify?branch=master) - -# example - -``` js -var stringify = require('fast-json-stable-stringify'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); -``` - -output: - -``` -{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} -``` - - -# methods - -``` js -var stringify = require('fast-json-stable-stringify') -``` - -## var str = stringify(obj, opts) - -Return a deterministic stringified string `str` from the object `obj`. - - -## options - -### cmp - -If `opts` is given, you can supply an `opts.cmp` to have a custom comparison -function for object keys. Your function `opts.cmp` is called with these -parameters: - -``` js -opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) -``` - -For example, to sort on the object key names in reverse order you could write: - -``` js -var stringify = require('fast-json-stable-stringify'); - -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; -}); -console.log(s); -``` - -which results in the output string: - -``` -{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} -``` - -Or if you wanted to sort on the object values in reverse order, you could write: - -``` -var stringify = require('fast-json-stable-stringify'); - -var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; -var s = stringify(obj, function (a, b) { - return a.value < b.value ? 1 : -1; -}); -console.log(s); -``` - -which outputs: - -``` -{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} -``` - -### cycles - -Pass `true` in `opts.cycles` to stringify circular property as `__cycle__` - the result will not be a valid JSON string in this case. - -TypeError will be thrown in case of circular object without this option. - - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install fast-json-stable-stringify -``` - - -# benchmark - -To run benchmark (requires Node.js 6+): -``` -node benchmark -``` - -Results: -``` -fast-json-stable-stringify x 17,189 ops/sec ±1.43% (83 runs sampled) -json-stable-stringify x 13,634 ops/sec ±1.39% (85 runs sampled) -fast-stable-stringify x 20,212 ops/sec ±1.20% (84 runs sampled) -faster-stable-stringify x 15,549 ops/sec ±1.12% (84 runs sampled) -The fastest is fast-stable-stringify -``` - - -## Enterprise support - -fast-json-stable-stringify package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-json-stable-stringify?utm_source=npm-fast-json-stable-stringify&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. - - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. - - -# license - -[MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE) diff --git a/tools/node_modules/eslint/node_modules/fast-levenshtein/README.md b/tools/node_modules/eslint/node_modules/fast-levenshtein/README.md deleted file mode 100644 index a7789953969398..00000000000000 --- a/tools/node_modules/eslint/node_modules/fast-levenshtein/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# fast-levenshtein - Levenshtein algorithm in Javascript - -[![Build Status](https://secure.travis-ci.org/hiddentao/fast-levenshtein.png)](http://travis-ci.org/hiddentao/fast-levenshtein) -[![NPM module](https://badge.fury.io/js/fast-levenshtein.png)](https://badge.fury.io/js/fast-levenshtein) -[![NPM downloads](https://img.shields.io/npm/dm/fast-levenshtein.svg?maxAge=2592000)](https://www.npmjs.com/package/fast-levenshtein) -[![Follow on Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/hiddentao) - -An efficient Javascript implementation of the [Levenshtein algorithm](http://en.wikipedia.org/wiki/Levenshtein_distance) with locale-specific collator support. - -## Features - -* Works in node.js and in the browser. -* Better performance than other implementations by not needing to store the whole matrix ([more info](http://www.codeproject.com/Articles/13525/Fast-memory-efficient-Levenshtein-algorithm)). -* Locale-sensitive string comparisions if needed. -* Comprehensive test suite and performance benchmark. -* Small: <1 KB minified and gzipped - -## Installation - -### node.js - -Install using [npm](http://npmjs.org/): - -```bash -$ npm install fast-levenshtein -``` - -### Browser - -Using bower: - -```bash -$ bower install fast-levenshtein -``` - -If you are not using any module loader system then the API will then be accessible via the `window.Levenshtein` object. - -## Examples - -**Default usage** - -```javascript -var levenshtein = require('fast-levenshtein'); - -var distance = levenshtein.get('back', 'book'); // 2 -var distance = levenshtein.get('我愛你', '我叫你'); // 1 -``` - -**Locale-sensitive string comparisons** - -It supports using [Intl.Collator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator) for locale-sensitive string comparisons: - -```javascript -var levenshtein = require('fast-levenshtein'); - -levenshtein.get('mikailovitch', 'Mikhaïlovitch', { useCollator: true}); -// 1 -``` - -## Building and Testing - -To build the code and run the tests: - -```bash -$ npm install -g grunt-cli -$ npm install -$ npm run build -``` - -## Performance - -_Thanks to [Titus Wormer](https://github.com/wooorm) for [encouraging me](https://github.com/hiddentao/fast-levenshtein/issues/1) to do this._ - -Benchmarked against other node.js levenshtein distance modules (on Macbook Air 2012, Core i7, 8GB RAM): - -```bash -Running suite Implementation comparison [benchmark/speed.js]... ->> levenshtein-edit-distance x 234 ops/sec ±3.02% (73 runs sampled) ->> levenshtein-component x 422 ops/sec ±4.38% (83 runs sampled) ->> levenshtein-deltas x 283 ops/sec ±3.83% (78 runs sampled) ->> natural x 255 ops/sec ±0.76% (88 runs sampled) ->> levenshtein x 180 ops/sec ±3.55% (86 runs sampled) ->> fast-levenshtein x 1,792 ops/sec ±2.72% (95 runs sampled) -Benchmark done. -Fastest test is fast-levenshtein at 4.2x faster than levenshtein-component -``` - -You can run this benchmark yourself by doing: - -```bash -$ npm install -$ npm run build -$ npm run benchmark -``` - -## Contributing - -If you wish to submit a pull request please update and/or create new tests for any changes you make and ensure the grunt build passes. - -See [CONTRIBUTING.md](https://github.com/hiddentao/fast-levenshtein/blob/master/CONTRIBUTING.md) for details. - -## License - -MIT - see [LICENSE.md](https://github.com/hiddentao/fast-levenshtein/blob/master/LICENSE.md) diff --git a/tools/node_modules/eslint/node_modules/file-entry-cache/README.md b/tools/node_modules/eslint/node_modules/file-entry-cache/README.md deleted file mode 100644 index 854a51233640bd..00000000000000 --- a/tools/node_modules/eslint/node_modules/file-entry-cache/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# file-entry-cache -> Super simple cache for file metadata, useful for process that work o a given series of files -> and that only need to repeat the job on the changed ones since the previous run of the process — Edit - -[![NPM Version](http://img.shields.io/npm/v/file-entry-cache.svg?style=flat)](https://npmjs.org/package/file-entry-cache) -[![Build Status](http://img.shields.io/travis/royriojas/file-entry-cache.svg?style=flat)](https://travis-ci.org/royriojas/file-entry-cache) - -## install - -```bash -npm i --save file-entry-cache -``` - -## Usage - -The module exposes two functions `create` and `createFromFile`. - -## `create(cacheName, [directory, useCheckSum])` -- **cacheName**: the name of the cache to be created -- **directory**: Optional the directory to load the cache from -- **usecheckSum**: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file. - -## `createFromFile(pathToCache, [useCheckSum])` -- **pathToCache**: the path to the cache file (this combines the cache name and directory) -- **useCheckSum**: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file. - -```js -// loads the cache, if one does not exists for the given -// Id a new one will be prepared to be created -var fileEntryCache = require('file-entry-cache'); - -var cache = fileEntryCache.create('testCache'); - -var files = expand('../fixtures/*.txt'); - -// the first time this method is called, will return all the files -var oFiles = cache.getUpdatedFiles(files); - -// this will persist this to disk checking each file stats and -// updating the meta attributes `size` and `mtime`. -// custom fields could also be added to the meta object and will be persisted -// in order to retrieve them later -cache.reconcile(); - -// use this if you want the non visited file entries to be kept in the cache -// for more than one execution -// -// cache.reconcile( true /* noPrune */) - -// on a second run -var cache2 = fileEntryCache.create('testCache'); - -// will return now only the files that were modified or none -// if no files were modified previous to the execution of this function -var oFiles = cache.getUpdatedFiles(files); - -// if you want to prevent a file from being considered non modified -// something useful if a file failed some sort of validation -// you can then remove the entry from the cache doing -cache.removeEntry('path/to/file'); // path to file should be the same path of the file received on `getUpdatedFiles` -// that will effectively make the file to appear again as modified until the validation is passed. In that -// case you should not remove it from the cache - -// if you need all the files, so you can determine what to do with the changed ones -// you can call -var oFiles = cache.normalizeEntries(files); - -// oFiles will be an array of objects like the following -entry = { - key: 'some/name/file', the path to the file - changed: true, // if the file was changed since previous run - meta: { - size: 3242, // the size of the file - mtime: 231231231, // the modification time of the file - data: {} // some extra field stored for this file (useful to save the result of a transformation on the file - } -} - -``` - -## Motivation for this module - -I needed a super simple and dumb **in-memory cache** with optional disk persistence (write-back cache) in order to make -a script that will beautify files with `esformatter` to execute only on the files that were changed since the last run. - -In doing so the process of beautifying files was reduced from several seconds to a small fraction of a second. - -This module uses [flat-cache](https://www.npmjs.com/package/flat-cache) a super simple `key/value` cache storage with -optional file persistance. - -The main idea is to read the files when the task begins, apply the transforms required, and if the process succeed, -then store the new state of the files. The next time this module request for `getChangedFiles` will return only -the files that were modified. Making the process to end faster. - -This module could also be used by processes that modify the files applying a transform, in that case the result of the -transform could be stored in the `meta` field, of the entries. Anything added to the meta field will be persisted. -Those processes won't need to call `getChangedFiles` they will instead call `normalizeEntries` that will return the -entries with a `changed` field that can be used to determine if the file was changed or not. If it was not changed -the transformed stored data could be used instead of actually applying the transformation, saving time in case of only -a few files changed. - -In the worst case scenario all the files will be processed. In the best case scenario only a few of them will be processed. - -## Important notes -- The values set on the meta attribute of the entries should be `stringify-able` ones if possible, flat-cache uses `circular-json` to try to persist circular structures, but this should be considered experimental. The best results are always obtained with non circular values -- All the changes to the cache state are done to memory first and only persisted after reconcile. - -## License - -MIT - - diff --git a/tools/node_modules/eslint/node_modules/flat-cache/README.md b/tools/node_modules/eslint/node_modules/flat-cache/README.md deleted file mode 100644 index 03e256ac4b5658..00000000000000 --- a/tools/node_modules/eslint/node_modules/flat-cache/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# flat-cache -> A stupidly simple key/value storage using files to persist the data - -[![NPM Version](http://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache) -[![Build Status](https://api.travis-ci.org/royriojas/flat-cache.svg?branch=master)](https://travis-ci.org/royriojas/flat-cache) - -## install - -```bash -npm i --save flat-cache -``` - -## Usage - -```js -var flatCache = require('flat-cache') -// loads the cache, if one does not exists for the given -// Id a new one will be prepared to be created -var cache = flatCache.load('cacheId'); - -// sets a key on the cache -cache.setKey('key', { foo: 'var' }); - -// get a key from the cache -cache.getKey('key') // { foo: 'var' } - -// fetch the entire persisted object -cache.all() // { 'key': { foo: 'var' } } - -// remove a key -cache.removeKey('key'); // removes a key from the cache - -// save it to disk -cache.save(); // very important, if you don't save no changes will be persisted. -// cache.save( true /* noPrune */) // can be used to prevent the removal of non visited keys - -// loads the cache from a given directory, if one does -// not exists for the given Id a new one will be prepared to be created -var cache = flatCache.load('cacheId', path.resolve('./path/to/folder')); - -// The following methods are useful to clear the cache -// delete a given cache -flatCache.clearCacheById('cacheId') // removes the cacheId document if one exists. - -// delete all cache -flatCache.clearAll(); // remove the cache directory -``` - -## Motivation for this module - -I needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make -a script that will beutify files with `esformatter` only execute on the files that were changed since the last run. -To make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value` -storage was needed and Bam! this module was born. - -## Important notes -- If no directory is especified when the `load` method is called, a folder named `.cache` will be created - inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you - might want to ignore the default `.cache` folder, or specify a custom directory. -- The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references -- All the changes to the cache state are done to memory -- I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module - intentionally dumb and simple -- Non visited keys are removed when `cache.save()` is called. If this is not desired, you can pass `true` to the save call - like: `cache.save( true /* noPrune */ )`. - -## License - -MIT - -## Changelog - -[changelog](./changelog.md) diff --git a/tools/node_modules/eslint/node_modules/flatted/README.md b/tools/node_modules/eslint/node_modules/flatted/README.md deleted file mode 100644 index 78763277c28160..00000000000000 --- a/tools/node_modules/eslint/node_modules/flatted/README.md +++ /dev/null @@ -1,111 +0,0 @@ -# flatted - -[![Downloads](https://img.shields.io/npm/dm/flatted.svg)](https://www.npmjs.com/package/flatted) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/flatted/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/flatted?branch=main) [![Build Status](https://travis-ci.com/WebReflection/flatted.svg?branch=main)](https://travis-ci.com/WebReflection/flatted) [![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC) ![WebReflection status](https://offline.report/status/webreflection.svg) - -![snow flake](./flatted.jpg) - -**Social Media Photo by [Matt Seymour](https://unsplash.com/@mattseymour) on [Unsplash](https://unsplash.com/)** - -## Announcement 📣 - -There is a standard approach to recursion and more data-types than what JSON allow, and it's part of this [Structured Clone Module](https://github.com/ungap/structured-clone/#readme). - -Beside acting as a polyfill, its `@ungap/structured-clone/json` export provides both `stringify` and `parse`, and it's been tested for being faster than *flatted*, but its produced output is also smaller than *flatted*. - -The *@ungap/structured-clone* module is, in short, a drop in replacement for *flatted*, but it's not compatible with *flatted* specialized syntax. - -However, if recursion, as well as more data-types, are what you are after, or interesting for your projects, consider switching to this new module whenever you can 👍 - -- - - - -A super light (0.5K) and fast circular JSON parser, directly from the creator of [CircularJSON](https://github.com/WebReflection/circular-json/#circularjson). - -Now available also for **[PHP](./php/flatted.php)**. - -```js -npm i flatted -``` - -Usable via [CDN](https://unpkg.com/flatted) or as regular module. - -```js -// ESM -import {parse, stringify, toJSON, fromJSON} from 'flatted'; - -// CJS -const {parse, stringify, toJSON, fromJSON} = require('flatted'); - -const a = [{}]; -a[0].a = a; -a.push(a); - -stringify(a); // [["1","0"],{"a":"0"}] -``` - -## toJSON and from JSON - -If you'd like to implicitly survive JSON serialization, these two helpers helps: - -```js -import {toJSON, fromJSON} from 'flatted'; - -class RecursiveMap extends Map { - static fromJSON(any) { - return new this(fromJSON(any)); - } - toJSON() { - return toJSON([...this.entries()]); - } -} - -const recursive = new RecursiveMap; -const same = {}; -same.same = same; -recursive.set('same', same); - -const asString = JSON.stringify(recursive); -const asMap = RecursiveMap.fromJSON(JSON.parse(asString)); -asMap.get('same') === asMap.get('same').same; -// true -``` - - -## Flatted VS JSON - -As it is for every other specialized format capable of serializing and deserializing circular data, you should never `JSON.parse(Flatted.stringify(data))`, and you should never `Flatted.parse(JSON.stringify(data))`. - -The only way this could work is to `Flatted.parse(Flatted.stringify(data))`, as it is also for _CircularJSON_ or any other, otherwise there's no granted data integrity. - -Also please note this project serializes and deserializes only data compatible with JSON, so that sockets, or anything else with internal classes different from those allowed by JSON standard, won't be serialized and unserialized as expected. - - -### New in V1: Exact same JSON API - - * Added a [reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Syntax) parameter to `.parse(string, reviver)` and revive your own objects. - * Added a [replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Syntax) and a `space` parameter to `.stringify(object, replacer, space)` for feature parity with JSON signature. - - -### Compatibility -All ECMAScript engines compatible with `Map`, `Set`, `Object.keys`, and `Array.prototype.reduce` will work, even if polyfilled. - - -### How does it work ? -While stringifying, all Objects, including Arrays, and strings, are flattened out and replaced as unique index. `*` - -Once parsed, all indexes will be replaced through the flattened collection. - -`*` represented as string to avoid conflicts with numbers - -```js -// logic example -var a = [{one: 1}, {two: '2'}]; -a[0].a = a; -// a is the main object, will be at index '0' -// {one: 1} is the second object, index '1' -// {two: '2'} the third, in '2', and it has a string -// which will be found at index '3' - -Flatted.stringify(a); -// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"] -// a[one,two] {one: 1, a} {two: '2'} '2' -``` diff --git a/tools/node_modules/eslint/node_modules/fs.realpath/README.md b/tools/node_modules/eslint/node_modules/fs.realpath/README.md deleted file mode 100644 index a42ceac62663ac..00000000000000 --- a/tools/node_modules/eslint/node_modules/fs.realpath/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# fs.realpath - -A backwards-compatible fs.realpath for Node v6 and above - -In Node v6, the JavaScript implementation of fs.realpath was replaced -with a faster (but less resilient) native implementation. That raises -new and platform-specific errors and cannot handle long or excessively -symlink-looping paths. - -This module handles those cases by detecting the new errors and -falling back to the JavaScript implementation. On versions of Node -prior to v6, it has no effect. - -## USAGE - -```js -var rp = require('fs.realpath') - -// async version -rp.realpath(someLongAndLoopingPath, function (er, real) { - // the ELOOP was handled, but it was a bit slower -}) - -// sync version -var real = rp.realpathSync(someLongAndLoopingPath) - -// monkeypatch at your own risk! -// This replaces the fs.realpath/fs.realpathSync builtins -rp.monkeypatch() - -// un-do the monkeypatching -rp.unmonkeypatch() -``` diff --git a/tools/node_modules/eslint/node_modules/functional-red-black-tree/README.md b/tools/node_modules/eslint/node_modules/functional-red-black-tree/README.md deleted file mode 100644 index edd19cbf31206f..00000000000000 --- a/tools/node_modules/eslint/node_modules/functional-red-black-tree/README.md +++ /dev/null @@ -1,237 +0,0 @@ -functional-red-black-tree -========================= -A [fully persistent](http://en.wikipedia.org/wiki/Persistent_data_structure) [red-black tree](http://en.wikipedia.org/wiki/Red%E2%80%93black_tree) written 100% in JavaScript. Works both in node.js and in the browser via [browserify](http://browserify.org/). - -Functional (or fully presistent) data structures allow for non-destructive updates. So if you insert an element into the tree, it returns a new tree with the inserted element rather than destructively updating the existing tree in place. Doing this requires using extra memory, and if one were naive it could cost as much as reallocating the entire tree. Instead, this data structure saves some memory by recycling references to previously allocated subtrees. This requires using only O(log(n)) additional memory per update instead of a full O(n) copy. - -Some advantages of this is that it is possible to apply insertions and removals to the tree while still iterating over previous versions of the tree. Functional and persistent data structures can also be useful in many geometric algorithms like point location within triangulations or ray queries, and can be used to analyze the history of executing various algorithms. This added power though comes at a cost, since it is generally a bit slower to use a functional data structure than an imperative version. However, if your application needs this behavior then you may consider using this module. - -# Install - - npm install functional-red-black-tree - -# Example - -Here is an example of some basic usage: - -```javascript -//Load the library -var createTree = require("functional-red-black-tree") - -//Create a tree -var t1 = createTree() - -//Insert some items into the tree -var t2 = t1.insert(1, "foo") -var t3 = t2.insert(2, "bar") - -//Remove something -var t4 = t3.remove(1) -``` - - -# API - -```javascript -var createTree = require("functional-red-black-tree") -``` - -## Overview - -- [Tree methods](#tree-methods) - - [`var tree = createTree([compare])`](#var-tree-=-createtreecompare) - - [`tree.keys`](#treekeys) - - [`tree.values`](#treevalues) - - [`tree.length`](#treelength) - - [`tree.get(key)`](#treegetkey) - - [`tree.insert(key, value)`](#treeinsertkey-value) - - [`tree.remove(key)`](#treeremovekey) - - [`tree.find(key)`](#treefindkey) - - [`tree.ge(key)`](#treegekey) - - [`tree.gt(key)`](#treegtkey) - - [`tree.lt(key)`](#treeltkey) - - [`tree.le(key)`](#treelekey) - - [`tree.at(position)`](#treeatposition) - - [`tree.begin`](#treebegin) - - [`tree.end`](#treeend) - - [`tree.forEach(visitor(key,value)[, lo[, hi]])`](#treeforEachvisitorkeyvalue-lo-hi) - - [`tree.root`](#treeroot) -- [Node properties](#node-properties) - - [`node.key`](#nodekey) - - [`node.value`](#nodevalue) - - [`node.left`](#nodeleft) - - [`node.right`](#noderight) -- [Iterator methods](#iterator-methods) - - [`iter.key`](#iterkey) - - [`iter.value`](#itervalue) - - [`iter.node`](#iternode) - - [`iter.tree`](#itertree) - - [`iter.index`](#iterindex) - - [`iter.valid`](#itervalid) - - [`iter.clone()`](#iterclone) - - [`iter.remove()`](#iterremove) - - [`iter.update(value)`](#iterupdatevalue) - - [`iter.next()`](#iternext) - - [`iter.prev()`](#iterprev) - - [`iter.hasNext`](#iterhasnext) - - [`iter.hasPrev`](#iterhasprev) - -## Tree methods - -### `var tree = createTree([compare])` -Creates an empty functional tree - -* `compare` is an optional comparison function, same semantics as array.sort() - -**Returns** An empty tree ordered by `compare` - -### `tree.keys` -A sorted array of all the keys in the tree - -### `tree.values` -An array array of all the values in the tree - -### `tree.length` -The number of items in the tree - -### `tree.get(key)` -Retrieves the value associated to the given key - -* `key` is the key of the item to look up - -**Returns** The value of the first node associated to `key` - -### `tree.insert(key, value)` -Creates a new tree with the new pair inserted. - -* `key` is the key of the item to insert -* `value` is the value of the item to insert - -**Returns** A new tree with `key` and `value` inserted - -### `tree.remove(key)` -Removes the first item with `key` in the tree - -* `key` is the key of the item to remove - -**Returns** A new tree with the given item removed if it exists - -### `tree.find(key)` -Returns an iterator pointing to the first item in the tree with `key`, otherwise `null`. - -### `tree.ge(key)` -Find the first item in the tree whose key is `>= key` - -* `key` is the key to search for - -**Returns** An iterator at the given element. - -### `tree.gt(key)` -Finds the first item in the tree whose key is `> key` - -* `key` is the key to search for - -**Returns** An iterator at the given element - -### `tree.lt(key)` -Finds the last item in the tree whose key is `< key` - -* `key` is the key to search for - -**Returns** An iterator at the given element - -### `tree.le(key)` -Finds the last item in the tree whose key is `<= key` - -* `key` is the key to search for - -**Returns** An iterator at the given element - -### `tree.at(position)` -Finds an iterator starting at the given element - -* `position` is the index at which the iterator gets created - -**Returns** An iterator starting at position - -### `tree.begin` -An iterator pointing to the first element in the tree - -### `tree.end` -An iterator pointing to the last element in the tree - -### `tree.forEach(visitor(key,value)[, lo[, hi]])` -Walks a visitor function over the nodes of the tree in order. - -* `visitor(key,value)` is a callback that gets executed on each node. If a truthy value is returned from the visitor, then iteration is stopped. -* `lo` is an optional start of the range to visit (inclusive) -* `hi` is an optional end of the range to visit (non-inclusive) - -**Returns** The last value returned by the callback - -### `tree.root` -Returns the root node of the tree - - -## Node properties -Each node of the tree has the following properties: - -### `node.key` -The key associated to the node - -### `node.value` -The value associated to the node - -### `node.left` -The left subtree of the node - -### `node.right` -The right subtree of the node - -## Iterator methods - -### `iter.key` -The key of the item referenced by the iterator - -### `iter.value` -The value of the item referenced by the iterator - -### `iter.node` -The value of the node at the iterator's current position. `null` is iterator is node valid. - -### `iter.tree` -The tree associated to the iterator - -### `iter.index` -Returns the position of this iterator in the sequence. - -### `iter.valid` -Checks if the iterator is valid - -### `iter.clone()` -Makes a copy of the iterator - -### `iter.remove()` -Removes the item at the position of the iterator - -**Returns** A new binary search tree with `iter`'s item removed - -### `iter.update(value)` -Updates the value of the node in the tree at this iterator - -**Returns** A new binary search tree with the corresponding node updated - -### `iter.next()` -Advances the iterator to the next position - -### `iter.prev()` -Moves the iterator backward one element - -### `iter.hasNext` -If true, then the iterator is not at the end of the sequence - -### `iter.hasPrev` -If true, then the iterator is not at the beginning of the sequence - -# Credits -(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/gensync/README.md b/tools/node_modules/eslint/node_modules/gensync/README.md deleted file mode 100644 index f68ce1a37b927d..00000000000000 --- a/tools/node_modules/eslint/node_modules/gensync/README.md +++ /dev/null @@ -1,196 +0,0 @@ -# gensync - -This module allows for developers to write common code that can share -implementation details, hiding whether an underlying request happens -synchronously or asynchronously. This is in contrast with many current Node -APIs which explicitly implement the same API twice, once with calls to -synchronous functions, and once with asynchronous functions. - -Take for example `fs.readFile` and `fs.readFileSync`, if you're writing an API -that loads a file and then performs a synchronous operation on the data, it -can be frustrating to maintain two parallel functions. - - -## Example - -```js -const fs = require("fs"); -const gensync = require("gensync"); - -const readFile = gensync({ - sync: fs.readFileSync, - errback: fs.readFile, -}); - -const myOperation = gensync(function* (filename) { - const code = yield* readFile(filename, "utf8"); - - return "// some custom prefix\n" + code; -}); - -// Load and add the prefix synchronously: -const result = myOperation.sync("./some-file.js"); - -// Load and add the prefix asynchronously with promises: -myOperation.async("./some-file.js").then(result => { - -}); - -// Load and add the prefix asynchronously with promises: -myOperation.errback("./some-file.js", (err, result) => { - -}); -``` - -This could even be exposed as your official API by doing -```js -// Using the common 'Sync' suffix for sync functions, and 'Async' suffix for -// promise-returning versions. -exports.myOperationSync = myOperation.sync; -exports.myOperationAsync = myOperation.async; -exports.myOperation = myOperation.errback; -``` -or potentially expose one of the async versions as the default, with a -`.sync` property on the function to expose the synchronous version. -```js -module.exports = myOperation.errback; -module.exports.sync = myOperation.sync; -```` - - -## API - -### gensync(generatorFnOrOptions) - -Returns a function that can be "await"-ed in another `gensync` generator -function, or executed via - -* `.sync(...args)` - Returns the computed value, or throws. -* `.async(...args)` - Returns a promise for the computed value. -* `.errback(...args, (err, result) => {})` - Calls the callback with the computed value, or error. - - -#### Passed a generator - -Wraps the generator to populate the `.sync`/`.async`/`.errback` helpers above to -allow for evaluation of the generator for the final value. - -##### Example - -```js -const readFile = function* () { - return 42; -}; - -const readFileAndMore = gensync(function* (){ - const val = yield* readFile(); - return 42 + val; -}); - -// In general cases -const code = readFileAndMore.sync("./file.js", "utf8"); -readFileAndMore.async("./file.js", "utf8").then(code => {}) -readFileAndMore.errback("./file.js", "utf8", (err, code) => {}); - -// In a generator being called indirectly with .sync/.async/.errback -const code = yield* readFileAndMore("./file.js", "utf8"); -``` - - -#### Passed an options object - -* `opts.sync` - - Example: `(...args) => 4` - - A function that will be called when `.sync()` is called on the `gensync()` - result, or when the result is passed to `yield*` in another generator that - is being run synchronously. - - Also called for `.async()` calls if no async handlers are provided. - -* `opts.async` - - Example: `async (...args) => 4` - - A function that will be called when `.async()` or `.errback()` is called on - the `gensync()` result, or when the result is passed to `yield*` in another - generator that is being run asynchronously. - -* `opts.errback` - - Example: `(...args, cb) => cb(null, 4)` - - A function that will be called when `.async()` or `.errback()` is called on - the `gensync()` result, or when the result is passed to `yield*` in another - generator that is being run asynchronously. - - This option allows for simpler compatibility with many existing Node APIs, - and also avoids introducing the extra even loop turns that promises introduce - to access the result value. - -* `opts.name` - - Example: `"readFile"` - - A string name to apply to the returned function. If no value is provided, - the name of `errback`/`async`/`sync` functions will be used, with any - `Sync` or `Async` suffix stripped off. If the callback is simply named - with ES6 inference (same name as the options property), the name is ignored. - -* `opts.arity` - - Example: `4` - - A number for the length to set on the returned function. If no value - is provided, the length will be carried over from the `sync` function's - `length` value. - -##### Example - -```js -const readFile = gensync({ - sync: fs.readFileSync, - errback: fs.readFile, -}); - -const code = readFile.sync("./file.js", "utf8"); -readFile.async("./file.js", "utf8").then(code => {}) -readFile.errback("./file.js", "utf8", (err, code) => {}); -``` - - -### gensync.all(iterable) - -`Promise.all`-like combinator that works with an iterable of generator objects -that could be passed to `yield*` within a gensync generator. - -#### Example - -```js -const loadFiles = gensync(function* () { - return yield* gensync.all([ - readFile("./one.js"), - readFile("./two.js"), - readFile("./three.js"), - ]); -}); -``` - - -### gensync.race(iterable) - -`Promise.race`-like combinator that works with an iterable of generator objects -that could be passed to `yield*` within a gensync generator. - -#### Example - -```js -const loadFiles = gensync(function* () { - return yield* gensync.race([ - readFile("./one.js"), - readFile("./two.js"), - readFile("./three.js"), - ]); -}); -``` diff --git a/tools/node_modules/eslint/node_modules/glob-parent/README.md b/tools/node_modules/eslint/node_modules/glob-parent/README.md deleted file mode 100644 index 6ae18a1a089e55..00000000000000 --- a/tools/node_modules/eslint/node_modules/glob-parent/README.md +++ /dev/null @@ -1,134 +0,0 @@ -

- - - -

- -# glob-parent - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] - -Extract the non-magic parent path from a glob string. - -## Usage - -```js -var globParent = require('glob-parent'); - -globParent('path/to/*.js'); // 'path/to' -globParent('/root/path/to/*.js'); // '/root/path/to' -globParent('/*.js'); // '/' -globParent('*.js'); // '.' -globParent('**/*.js'); // '.' -globParent('path/{to,from}'); // 'path' -globParent('path/!(to|from)'); // 'path' -globParent('path/?(to|from)'); // 'path' -globParent('path/+(to|from)'); // 'path' -globParent('path/*(to|from)'); // 'path' -globParent('path/@(to|from)'); // 'path' -globParent('path/**/*'); // 'path' - -// if provided a non-glob path, returns the nearest dir -globParent('path/foo/bar.js'); // 'path/foo' -globParent('path/foo/'); // 'path/foo' -globParent('path/foo'); // 'path' (see issue #3 for details) -``` - -## API - -### `globParent(maybeGlobString, [options])` - -Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. - -#### options - -```js -{ - // Disables the automatic conversion of slashes for Windows - flipBackslashes: true; -} -``` - -## Escaping - -The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: - -- `?` (question mark) unless used as a path segment alone -- `*` (asterisk) -- `|` (pipe) -- `(` (opening parenthesis) -- `)` (closing parenthesis) -- `{` (opening curly brace) -- `}` (closing curly brace) -- `[` (opening bracket) -- `]` (closing bracket) - -**Example** - -```js -globParent('foo/[bar]/'); // 'foo' -globParent('foo/\\[bar]/'); // 'foo/[bar]' -``` - -## Limitations - -### Braces & Brackets - -This library attempts a quick and imperfect method of determining which path -parts have glob magic without fully parsing/lexing the pattern. There are some -advanced use cases that can trip it up, such as nested braces where the outer -pair is escaped and the inner one contains a path separator. If you find -yourself in the unlikely circumstance of being affected by this or need to -ensure higher-fidelity glob handling in your library, it is recommended that you -pre-process your input with [expand-braces] and/or [expand-brackets]. - -### Windows - -Backslashes are not valid path separators for globs. If a path with backslashes -is provided anyway, for simple cases, glob-parent will replace the path -separator for you and return the non-glob parent path (now with -forward-slashes, which are still valid as Windows path separators). - -This cannot be used in conjunction with escape characters. - -```js -// BAD -globParent('C:\\Program Files \\(x86\\)\\*.ext'); // 'C:/Program Files /(x86/)' - -// GOOD -globParent('C:/Program Files\\(x86\\)/*.ext'); // 'C:/Program Files (x86)' -``` - -If you are using escape characters for a pattern without path parts (i.e. -relative to `cwd`), prefix with `./` to avoid confusing glob-parent. - -```js -// BAD -globParent('foo \\[bar]'); // 'foo ' -globParent('foo \\[bar]*'); // 'foo ' - -// GOOD -globParent('./foo \\[bar]'); // 'foo [bar]' -globParent('./foo \\[bar]*'); // '.' -``` - -## License - -ISC - - -[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/glob-parent -[npm-image]: https://img.shields.io/npm/v/glob-parent.svg?style=flat-square - -[ci-url]: https://github.com/gulpjs/glob-parent/actions?query=workflow:dev -[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/glob-parent/dev?style=flat-square - -[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg?style=flat-square - - - -[expand-braces]: https://github.com/jonschlinkert/expand-braces -[expand-brackets]: https://github.com/jonschlinkert/expand-brackets - diff --git a/tools/node_modules/eslint/node_modules/glob/README.md b/tools/node_modules/eslint/node_modules/glob/README.md deleted file mode 100644 index 83f0c83a0c19ed..00000000000000 --- a/tools/node_modules/eslint/node_modules/glob/README.md +++ /dev/null @@ -1,378 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![a fun cartoon logo made of glob characters](logo/glob.png) - -## Usage - -Install with npm - -``` -npm i glob -``` - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* `cb` `{Function}` - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* return: `{Array}` filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` `{String}` pattern to search for -* `options` `{Object}` -* `cb` `{Function}` Called when an error occurs, or matches are found - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'FILE'` - Path exists, and is not a directory - * `'DIR'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the specific - thing that matched. It is not deduplicated or resolved to a realpath. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of glob patterns to exclude matches. - Note: `ignore` patterns are *always* in `dot:true` mode, regardless - of any other settings. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) -* `absolute` Set to true to always receive absolute paths for matched - files. Unlike `realpath`, this also affects the values returned in - the `match` event. -* `fs` File-system object with Node's `fs` API. By default, the built-in - `fs` module will be used. Set to a volume provided by a library like - `memfs` to avoid using the "real" file-system. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -### Comments and Negation - -Previously, this module let you mark a pattern as a "comment" if it -started with a `#` character, or a "negated" pattern if it started -with a `!` character. - -These options were deprecated in version 5, and removed in version 6. - -To specify things that should not match, use the `ignore` option. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Glob Logo -Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). - -The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` - -![](oh-my-glob.gif) diff --git a/tools/node_modules/eslint/node_modules/ignore/README.md b/tools/node_modules/eslint/node_modules/ignore/README.md deleted file mode 100755 index c4d8230ccbe5c3..00000000000000 --- a/tools/node_modules/eslint/node_modules/ignore/README.md +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - - - - - - - -
LinuxOS XWindowsCoverageDownloads
- - Build Status - - - Windows Build Status - - - Coverage Status - - - npm module downloads per month -
- -# ignore - -`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore). - -Pay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module. - -##### Tested on - -- Linux + Node: `0.8` - `7.x` -- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. - -Actually, `ignore` does not rely on any versions of node specially. - -Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md). - -## Table Of Main Contents - -- [Usage](#usage) -- [`Pathname` Conventions](#pathname-conventions) -- [Guide for 2.x -> 3.x](#upgrade-2x---3x) -- [Guide for 3.x -> 4.x](#upgrade-3x---4x) -- See Also: - - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. - -## Usage - -```js -import ignore from 'ignore' -const ig = ignore().add(['.abc/*', '!.abc/d/']) -``` - -### Filter the given paths - -```js -const paths = [ - '.abc/a.js', // filtered out - '.abc/d/e.js' // included -] - -ig.filter(paths) // ['.abc/d/e.js'] -ig.ignores('.abc/a.js') // true -``` - -### As the filter function - -```js -paths.filter(ig.createFilter()); // ['.abc/d/e.js'] -``` - -### Win32 paths will be handled - -```js -ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) -// if the code above runs on windows, the result will be -// ['.abc\\d\\e.js'] -``` - -## Why another ignore? - -- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. - -- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so - - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. - - `ignore` don't cares about sub-modules of git projects. - -- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: - - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. - - '`**/foo`' should match '`foo`' anywhere. - - Prevent re-including a file if a parent directory of that file is excluded. - - Handle trailing whitespaces: - - `'a '`(one space) should not match `'a '`(two spaces). - - `'a \ '` matches `'a '` - - All test cases are verified with the result of `git check-ignore`. - -# Methods - -## .add(pattern: string | Ignore): this -## .add(patterns: Array): this - -- **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance -- **patterns** `Array` Array of ignore patterns. - -Adds a rule or several rules to the current manager. - -Returns `this` - -Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. - -```js -ignore().add('#abc').ignores('#abc') // false -ignore().add('\#abc').ignores('#abc') // true -``` - -`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: - -```js -ignore() -.add(fs.readFileSync(filenameOfGitignore).toString()) -.filter(filenames) -``` - -`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. - -## .addIgnoreFile(path) - -REMOVED in `3.x` for now. - -To upgrade `ignore@2.x` up to `3.x`, use - -```js -import fs from 'fs' - -if (fs.existsSync(filename)) { - ignore().add(fs.readFileSync(filename).toString()) -} -``` - -instead. - -## .filter(paths: Array): Array - -```ts -type Pathname = string -``` - -Filters the given array of pathnames, and returns the filtered array. - -- **paths** `Array.` The array of `pathname`s to be filtered. - -### `Pathname` Conventions: - -#### 1. `Pathname` should be a `path.relative()`d pathname - -`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory. - -```js -// WRONG -ig.ignores('./abc') - -// WRONG, for it will never happen. -// If the gitignore rule locates at the root directory, -// `'/abc'` should be changed to `'abc'`. -// ``` -// path.relative('/', '/abc') -> 'abc' -// ``` -ig.ignores('/abc') - -// Right -ig.ignores('abc') - -// Right -ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' -``` - -In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules. - -Suppose the dir structure is: - -``` -/path/to/your/repo - |-- a - | |-- a.js - | - |-- .b - | - |-- .c - |-- .DS_store -``` - -Then the `paths` might be like this: - -```js -[ - 'a/a.js' - '.b', - '.c/.DS_store' -] -``` - -Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: - -```js -import glob from 'glob' - -glob('**', { - // Adds a / character to directory matches. - mark: true -}, (err, files) => { - if (err) { - return console.error(err) - } - - let filtered = ignore().add(patterns).filter(files) - console.log(filtered) -}) -``` - -#### 2. filenames and dirnames - -`node-ignore` does NO `fs.stat` during path matching, so for the example below: - -```js -ig.add('config/') - -// `ig` does NOT know if 'config' is a normal file, directory or something -ig.ignores('config') // And it returns `false` - -ig.ignores('config/') // returns `true` -``` - -Specially for people who develop some library based on `node-ignore`, it is important to understand that. - -## .ignores(pathname: Pathname): boolean - -> new in 3.2.0 - -Returns `Boolean` whether `pathname` should be ignored. - -```js -ig.ignores('.abc/a.js') // true -``` - -## .createFilter() - -Creates a filter function which could filter an array of paths with `Array.prototype.filter`. - -Returns `function(path)` the filter function. - -## `options.ignorecase` since 4.0.0 - -Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (default value), otherwise case sensitive. - -```js -const ig = ignore({ - ignorecase: false -}) - -ig.add('*.png') - -ig.ignores('*.PNG') // false -``` - -**** - -# Upgrade Guide - -## Upgrade 2.x -> 3.x - -- All `options` of 2.x are unnecessary and removed, so just remove them. -- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. -- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. - -## Upgrade 3.x -> 4.x - -Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6: - -```js -var ignore = require('ignore/legacy') -``` - -**** - -# Collaborators - -- [@whitecolor](https://github.com/whitecolor) *Alex* -- [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé* -- [@azproduction](https://github.com/azproduction) *Mikhail Davydov* -- [@TrySound](https://github.com/TrySound) *Bogdan Chadkin* -- [@JanMattner](https://github.com/JanMattner) *Jan Mattner* -- [@ntwb](https://github.com/ntwb) *Stephen Edgar* -- [@kasperisager](https://github.com/kasperisager) *Kasper Isager* -- [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders* diff --git a/tools/node_modules/eslint/node_modules/imurmurhash/README.md b/tools/node_modules/eslint/node_modules/imurmurhash/README.md deleted file mode 100644 index f35b20a0ef5bfe..00000000000000 --- a/tools/node_modules/eslint/node_modules/imurmurhash/README.md +++ /dev/null @@ -1,122 +0,0 @@ -iMurmurHash.js -============== - -An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). - -This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. - -Installation ------------- - -To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. - -```html - - -``` - ---- - -To use iMurmurHash in Node.js, install the module using NPM: - -```bash -npm install imurmurhash -``` - -Then simply include it in your scripts: - -```javascript -MurmurHash3 = require('imurmurhash'); -``` - -Quick Example -------------- - -```javascript -// Create the initial hash -var hashState = MurmurHash3('string'); - -// Incrementally add text -hashState.hash('more strings'); -hashState.hash('even more strings'); - -// All calls can be chained if desired -hashState.hash('and').hash('some').hash('more'); - -// Get a result -hashState.result(); -// returns 0xe4ccfe6b -``` - -Functions ---------- - -### MurmurHash3 ([string], [seed]) -Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: - -```javascript -// Use the cached object, calling the function again will return the same -// object (but reset, so the current state would be lost) -hashState = MurmurHash3(); -... - -// Create a new object that can be safely used however you wish. Calling the -// function again will simply return a new state object, and no state loss -// will occur, at the cost of creating more objects. -hashState = new MurmurHash3(); -``` - -Both methods can be mixed however you like if you have different use cases. - ---- - -### MurmurHash3.prototype.hash (string) -Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. - ---- - -### MurmurHash3.prototype.result () -Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. - -```javascript -// Do the whole string at once -MurmurHash3('this is a test string').result(); -// 0x70529328 - -// Do part of the string, get a result, then the other part -var m = MurmurHash3('this is a'); -m.result(); -// 0xbfc4f834 -m.hash(' test string').result(); -// 0x70529328 (same as above) -``` - ---- - -### MurmurHash3.prototype.reset ([seed]) -Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. - ---- - -License (MIT) -------------- -Copyright (c) 2013 Gary Court, Jens Taylor - -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. diff --git a/tools/node_modules/eslint/node_modules/inflight/README.md b/tools/node_modules/eslint/node_modules/inflight/README.md deleted file mode 100644 index 6dc8929171a8c5..00000000000000 --- a/tools/node_modules/eslint/node_modules/inflight/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# inflight - -Add callbacks to requests in flight to avoid async duplication - -## USAGE - -```javascript -var inflight = require('inflight') - -// some request that does some stuff -function req(key, callback) { - // key is any random string. like a url or filename or whatever. - // - // will return either a falsey value, indicating that the - // request for this key is already in flight, or a new callback - // which when called will call all callbacks passed to inflightk - // with the same key - callback = inflight(key, callback) - - // If we got a falsey value back, then there's already a req going - if (!callback) return - - // this is where you'd fetch the url or whatever - // callback is also once()-ified, so it can safely be assigned - // to multiple events etc. First call wins. - setTimeout(function() { - callback(null, key) - }, 100) -} - -// only assigns a single setTimeout -// when it dings, all cbs get called -req('foo', cb1) -req('foo', cb2) -req('foo', cb3) -req('foo', cb4) -``` diff --git a/tools/node_modules/eslint/node_modules/inherits/README.md b/tools/node_modules/eslint/node_modules/inherits/README.md deleted file mode 100644 index b1c56658557b81..00000000000000 --- a/tools/node_modules/eslint/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/tools/node_modules/eslint/node_modules/is-extglob/README.md b/tools/node_modules/eslint/node_modules/is-extglob/README.md deleted file mode 100644 index 0416af5c326983..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-extglob/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) - -> Returns true if a string has an extglob. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-extglob -``` - -## Usage - -```js -var isExtglob = require('is-extglob'); -``` - -**True** - -```js -isExtglob('?(abc)'); -isExtglob('@(abc)'); -isExtglob('!(abc)'); -isExtglob('*(abc)'); -isExtglob('+(abc)'); -``` - -**False** - -Escaped extglobs: - -```js -isExtglob('\\?(abc)'); -isExtglob('\\@(abc)'); -isExtglob('\\!(abc)'); -isExtglob('\\*(abc)'); -isExtglob('\\+(abc)'); -``` - -Everything else... - -```js -isExtglob('foo.js'); -isExtglob('!foo.js'); -isExtglob('*.js'); -isExtglob('**/abc.js'); -isExtglob('abc/*.js'); -isExtglob('abc/(aaa|bbb).js'); -isExtglob('abc/[a-z].js'); -isExtglob('abc/{a,b}.js'); -isExtglob('abc/?.js'); -isExtglob('abc.js'); -isExtglob('abc/def/ghi.js'); -``` - -## History - -**v2.0** - -Adds support for escaping. Escaped exglobs no longer return true. - -## About - -### Related projects - -* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-glob/README.md b/tools/node_modules/eslint/node_modules/is-glob/README.md deleted file mode 100644 index 740724b276e289..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-glob/README.md +++ /dev/null @@ -1,206 +0,0 @@ -# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) - -> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-glob -``` - -You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). - -## Usage - -```js -var isGlob = require('is-glob'); -``` - -### Default behavior - -**True** - -Patterns that have glob characters or regex patterns will return `true`: - -```js -isGlob('!foo.js'); -isGlob('*.js'); -isGlob('**/abc.js'); -isGlob('abc/*.js'); -isGlob('abc/(aaa|bbb).js'); -isGlob('abc/[a-z].js'); -isGlob('abc/{a,b}.js'); -//=> true -``` - -Extglobs - -```js -isGlob('abc/@(a).js'); -isGlob('abc/!(a).js'); -isGlob('abc/+(a).js'); -isGlob('abc/*(a).js'); -isGlob('abc/?(a).js'); -//=> true -``` - -**False** - -Escaped globs or extglobs return `false`: - -```js -isGlob('abc/\\@(a).js'); -isGlob('abc/\\!(a).js'); -isGlob('abc/\\+(a).js'); -isGlob('abc/\\*(a).js'); -isGlob('abc/\\?(a).js'); -isGlob('\\!foo.js'); -isGlob('\\*.js'); -isGlob('\\*\\*/abc.js'); -isGlob('abc/\\*.js'); -isGlob('abc/\\(aaa|bbb).js'); -isGlob('abc/\\[a-z].js'); -isGlob('abc/\\{a,b}.js'); -//=> false -``` - -Patterns that do not have glob patterns return `false`: - -```js -isGlob('abc.js'); -isGlob('abc/def/ghi.js'); -isGlob('foo.js'); -isGlob('abc/@.js'); -isGlob('abc/+.js'); -isGlob('abc/?.js'); -isGlob(); -isGlob(null); -//=> false -``` - -Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): - -```js -isGlob(['**/*.js']); -isGlob(['foo.js']); -//=> false -``` - -### Option strict - -When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that -some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. - -**True** - -Patterns that have glob characters or regex patterns will return `true`: - -```js -isGlob('!foo.js', {strict: false}); -isGlob('*.js', {strict: false}); -isGlob('**/abc.js', {strict: false}); -isGlob('abc/*.js', {strict: false}); -isGlob('abc/(aaa|bbb).js', {strict: false}); -isGlob('abc/[a-z].js', {strict: false}); -isGlob('abc/{a,b}.js', {strict: false}); -//=> true -``` - -Extglobs - -```js -isGlob('abc/@(a).js', {strict: false}); -isGlob('abc/!(a).js', {strict: false}); -isGlob('abc/+(a).js', {strict: false}); -isGlob('abc/*(a).js', {strict: false}); -isGlob('abc/?(a).js', {strict: false}); -//=> true -``` - -**False** - -Escaped globs or extglobs return `false`: - -```js -isGlob('\\!foo.js', {strict: false}); -isGlob('\\*.js', {strict: false}); -isGlob('\\*\\*/abc.js', {strict: false}); -isGlob('abc/\\*.js', {strict: false}); -isGlob('abc/\\(aaa|bbb).js', {strict: false}); -isGlob('abc/\\[a-z].js', {strict: false}); -isGlob('abc/\\{a,b}.js', {strict: false}); -//=> false -``` - -## About - -
-Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
- -
-Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
- -
-Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
- -### Related projects - -You might also be interested in these projects: - -* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") -* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") -* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") -* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 47 | [jonschlinkert](https://github.com/jonschlinkert) | -| 5 | [doowb](https://github.com/doowb) | -| 1 | [phated](https://github.com/phated) | -| 1 | [danhper](https://github.com/danhper) | -| 1 | [paulmillr](https://github.com/paulmillr) | - -### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -### License - -Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/isexe/README.md b/tools/node_modules/eslint/node_modules/isexe/README.md deleted file mode 100644 index 35769e84408ce9..00000000000000 --- a/tools/node_modules/eslint/node_modules/isexe/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# isexe - -Minimal module to check if a file is executable, and a normal file. - -Uses `fs.stat` and tests against the `PATHEXT` environment variable on -Windows. - -## USAGE - -```javascript -var isexe = require('isexe') -isexe('some-file-name', function (err, isExe) { - if (err) { - console.error('probably file does not exist or something', err) - } else if (isExe) { - console.error('this thing can be run') - } else { - console.error('cannot be run') - } -}) - -// same thing but synchronous, throws errors -var isExe = isexe.sync('some-file-name') - -// treat errors as just "not executable" -isexe('maybe-missing-file', { ignoreErrors: true }, callback) -var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) -``` - -## API - -### `isexe(path, [options], [callback])` - -Check if the path is executable. If no callback provided, and a -global `Promise` object is available, then a Promise will be returned. - -Will raise whatever errors may be raised by `fs.stat`, unless -`options.ignoreErrors` is set to true. - -### `isexe.sync(path, [options])` - -Same as `isexe` but returns the value and throws any errors raised. - -### Options - -* `ignoreErrors` Treat all errors as "no, this is not executable", but - don't raise them. -* `uid` Number to use as the user id -* `gid` Number to use as the group id -* `pathExt` List of path extensions to use instead of `PATHEXT` - environment variable on Windows. diff --git a/tools/node_modules/eslint/node_modules/js-tokens/README.md b/tools/node_modules/eslint/node_modules/js-tokens/README.md deleted file mode 100644 index 00cdf1634db1d9..00000000000000 --- a/tools/node_modules/eslint/node_modules/js-tokens/README.md +++ /dev/null @@ -1,240 +0,0 @@ -Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) -======== - -A regex that tokenizes JavaScript. - -```js -var jsTokens = require("js-tokens").default - -var jsString = "var foo=opts.foo;\n..." - -jsString.match(jsTokens) -// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] -``` - - -Installation -============ - -`npm install js-tokens` - -```js -import jsTokens from "js-tokens" -// or: -var jsTokens = require("js-tokens").default -``` - - -Usage -===== - -### `jsTokens` ### - -A regex with the `g` flag that matches JavaScript tokens. - -The regex _always_ matches, even invalid JavaScript and the empty string. - -The next match is always directly after the previous. - -### `var token = matchToToken(match)` ### - -```js -import {matchToToken} from "js-tokens" -// or: -var matchToToken = require("js-tokens").matchToToken -``` - -Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: -String, value: String}` object. The following types are available: - -- string -- comment -- regex -- number -- name -- punctuator -- whitespace -- invalid - -Multi-line comments and strings also have a `closed` property indicating if the -token was closed or not (see below). - -Comments and strings both come in several flavors. To distinguish them, check if -the token starts with `//`, `/*`, `'`, `"` or `` ` ``. - -Names are ECMAScript IdentifierNames, that is, including both identifiers and -keywords. You may use [is-keyword-js] to tell them apart. - -Whitespace includes both line terminators and other whitespace. - -[is-keyword-js]: https://github.com/crissdev/is-keyword-js - - -ECMAScript support -================== - -The intention is to always support the latest ECMAScript version whose feature -set has been finalized. - -If adding support for a newer version requires changes, a new version with a -major verion bump will be released. - -Currently, ECMAScript 2018 is supported. - - -Invalid code handling -===================== - -Unterminated strings are still matched as strings. JavaScript strings cannot -contain (unescaped) newlines, so unterminated strings simply end at the end of -the line. Unterminated template strings can contain unescaped newlines, though, -so they go on to the end of input. - -Unterminated multi-line comments are also still matched as comments. They -simply go on to the end of the input. - -Unterminated regex literals are likely matched as division and whatever is -inside the regex. - -Invalid ASCII characters have their own capturing group. - -Invalid non-ASCII characters are treated as names, to simplify the matching of -names (except unicode spaces which are treated as whitespace). Note: See also -the [ES2018](#es2018) section. - -Regex literals may contain invalid regex syntax. They are still matched as -regex literals. They may also contain repeated regex flags, to keep the regex -simple. - -Strings may contain invalid escape sequences. - - -Limitations -=========== - -Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be -perfect. But that’s not the point either. - -You may compare jsTokens with [esprima] by using `esprima-compare.js`. -See `npm run esprima-compare`! - -[esprima]: http://esprima.org/ - -### Template string interpolation ### - -Template strings are matched as single tokens, from the starting `` ` `` to the -ending `` ` ``, including interpolations (whose tokens are not matched -individually). - -Matching template string interpolations requires recursive balancing of `{` and -`}`—something that JavaScript regexes cannot do. Only one level of nesting is -supported. - -### Division and regex literals collision ### - -Consider this example: - -```js -var g = 9.82 -var number = bar / 2/g - -var regex = / 2/g -``` - -A human can easily understand that in the `number` line we’re dealing with -division, and in the `regex` line we’re dealing with a regex literal. How come? -Because humans can look at the whole code to put the `/` characters in context. -A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also -look backwards. See the [ES2018](#es2018) section). - -When the `jsTokens` regex scans throught the above, it will see the following -at the end of both the `number` and `regex` rows: - -```js -/ 2/g -``` - -It is then impossible to know if that is a regex literal, or part of an -expression dealing with division. - -Here is a similar case: - -```js -foo /= 2/g -foo(/= 2/g) -``` - -The first line divides the `foo` variable with `2/g`. The second line calls the -`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only -sees forwards, it cannot tell the two cases apart. - -There are some cases where we _can_ tell division and regex literals apart, -though. - -First off, we have the simple cases where there’s only one slash in the line: - -```js -var foo = 2/g -foo /= 2 -``` - -Regex literals cannot contain newlines, so the above cases are correctly -identified as division. Things are only problematic when there are more than -one non-comment slash in a single line. - -Secondly, not every character is a valid regex flag. - -```js -var number = bar / 2/e -``` - -The above example is also correctly identified as division, because `e` is not a -valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` -(any letter) as flags, but it is not worth it since it increases the amount of -ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are -allowed. This means that the above example will be identified as division as -long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 -characters long. - -Lastly, we can look _forward_ for information. - -- If the token following what looks like a regex literal is not valid after a - regex literal, but is valid in a division expression, then the regex literal - is treated as division instead. For example, a flagless regex cannot be - followed by a string, number or name, but all of those three can be the - denominator of a division. -- Generally, if what looks like a regex literal is followed by an operator, the - regex literal is treated as division instead. This is because regexes are - seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division - could likely be part of such an expression. - -Please consult the regex source and the test cases for precise information on -when regex or division is matched (should you need to know). In short, you -could sum it up as: - -If the end of a statement looks like a regex literal (even if it isn’t), it -will be treated as one. Otherwise it should work as expected (if you write sane -code). - -### ES2018 ### - -ES2018 added some nice regex improvements to the language. - -- [Unicode property escapes] should allow telling names and invalid non-ASCII - characters apart without blowing up the regex size. -- [Lookbehind assertions] should allow matching telling division and regex - literals apart in more cases. -- [Named capture groups] might simplify some things. - -These things would be nice to do, but are not critical. They probably have to -wait until the oldest maintained Node.js LTS release supports those features. - -[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html -[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html -[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html - - -License -======= - -[MIT](LICENSE). diff --git a/tools/node_modules/eslint/node_modules/js-yaml/README.md b/tools/node_modules/eslint/node_modules/js-yaml/README.md deleted file mode 100644 index 3cbc4bd2ddb33a..00000000000000 --- a/tools/node_modules/eslint/node_modules/js-yaml/README.md +++ /dev/null @@ -1,246 +0,0 @@ -JS-YAML - YAML 1.2 parser / writer for JavaScript -================================================= - -[![CI](https://github.com/nodeca/js-yaml/workflows/CI/badge.svg?branch=master)](https://github.com/nodeca/js-yaml/actions) -[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml) - -__[Online Demo](http://nodeca.github.com/js-yaml/)__ - - -This is an implementation of [YAML](http://yaml.org/), a human-friendly data -serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was -completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. - - -Installation ------------- - -### YAML module for node.js - -``` -npm install js-yaml -``` - - -### CLI executable - -If you want to inspect your YAML files from CLI, install js-yaml globally: - -``` -npm install -g js-yaml -``` - -#### Usage - -``` -usage: js-yaml [-h] [-v] [-c] [-t] file - -Positional arguments: - file File with YAML document(s) - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -c, --compact Display errors in compact mode - -t, --trace Show stack trace on error -``` - - -API ---- - -Here we cover the most 'useful' methods. If you need advanced details (creating -your own tags), see [examples](https://github.com/nodeca/js-yaml/tree/master/examples) -for more info. - -``` javascript -const yaml = require('js-yaml'); -const fs = require('fs'); - -// Get document, or throw exception on error -try { - const doc = yaml.load(fs.readFileSync('/home/ixti/example.yml', 'utf8')); - console.log(doc); -} catch (e) { - console.log(e); -} -``` - - -### load (string [ , options ]) - -Parses `string` as single YAML document. Returns either a -plain object, a string, a number, `null` or `undefined`, or throws `YAMLException` on error. By default, does -not support regexps, functions and undefined. - -options: - -- `filename` _(default: null)_ - string to be used as a file path in - error/warning messages. -- `onWarning` _(default: null)_ - function to call on warning messages. - Loader will call this function with an instance of `YAMLException` for each warning. -- `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use. - - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: - http://www.yaml.org/spec/1.2/spec.html#id2802346 - - `JSON_SCHEMA` - all JSON-supported types: - http://www.yaml.org/spec/1.2/spec.html#id2803231 - - `CORE_SCHEMA` - same as `JSON_SCHEMA`: - http://www.yaml.org/spec/1.2/spec.html#id2804923 - - `DEFAULT_SCHEMA` - all supported YAML types. -- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. - -NOTE: This function **does not** understand multi-document sources, it throws -exception on those. - -NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. -So, the JSON schema is not as strictly defined in the YAML specification. -It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. -The core schema also has no such restrictions. It allows binary notation for integers. - - -### loadAll (string [, iterator] [, options ]) - -Same as `load()`, but understands multi-document sources. Applies -`iterator` to each document if specified, or returns array of documents. - -``` javascript -const yaml = require('js-yaml'); - -yaml.loadAll(data, function (doc) { - console.log(doc); -}); -``` - - -### dump (object [ , options ]) - -Serializes `object` as a YAML document. Uses `DEFAULT_SCHEMA`, so it will -throw an exception if you try to dump regexps or functions. However, you can -disable exceptions by setting the `skipInvalid` option to `true`. - -options: - -- `indent` _(default: 2)_ - indentation width to use (in spaces). -- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements -- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function - in the safe schema) and skip pairs and single values with such types. -- `flowLevel` _(default: -1)_ - specifies level of nesting, when to switch from - block to flow style for collections. -1 means block style everwhere -- `styles` - "tag" => "style" map. Each tag may have own set of styles. -- `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use. -- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a - function, use the function to sort the keys. -- `lineWidth` _(default: `80`)_ - set max line width. Set `-1` for unlimited width. -- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references -- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older - yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 -- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. -- `quotingType` _(`'` or `"`, default: `'`)_ - strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters. -- `forceQuotes` _(default: `false`)_ - if `true`, all non-key strings will be quoted even if they normally don't need to. -- `replacer` - callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`). - -The following table show availlable styles (e.g. "canonical", -"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml -output is shown on the right side after `=>` (default setting) or `->`: - -``` none -!!null - "canonical" -> "~" - "lowercase" => "null" - "uppercase" -> "NULL" - "camelcase" -> "Null" - -!!int - "binary" -> "0b1", "0b101010", "0b1110001111010" - "octal" -> "0o1", "0o52", "0o16172" - "decimal" => "1", "42", "7290" - "hexadecimal" -> "0x1", "0x2A", "0x1C7A" - -!!bool - "lowercase" => "true", "false" - "uppercase" -> "TRUE", "FALSE" - "camelcase" -> "True", "False" - -!!float - "lowercase" => ".nan", '.inf' - "uppercase" -> ".NAN", '.INF' - "camelcase" -> ".NaN", '.Inf' -``` - -Example: - -``` javascript -dump(object, { - 'styles': { - '!!null': 'canonical' // dump null as ~ - }, - 'sortKeys': true // sort object keys -}); -``` - -Supported YAML types --------------------- - -The list of standard YAML tags and corresponding JavaScript types. See also -[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and -[YAML types repository](http://yaml.org/type/). - -``` -!!null '' # null -!!bool 'yes' # bool -!!int '3...' # number -!!float '3.14...' # number -!!binary '...base64...' # buffer -!!timestamp 'YYYY-...' # date -!!omap [ ... ] # array of key-value pairs -!!pairs [ ... ] # array or array pairs -!!set { ... } # array of objects with given keys and null values -!!str '...' # string -!!seq [ ... ] # array -!!map { ... } # object -``` - -**JavaScript-specific tags** - -See [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) for -extra types. - - -Caveats -------- - -Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects -or arrays as keys, and stringifies (by calling `toString()` method) them at the -moment of adding them. - -``` yaml ---- -? [ foo, bar ] -: - baz -? { foo: bar } -: - baz - - baz -``` - -``` javascript -{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } -``` - -Also, reading of properties on implicit block mapping keys is not supported yet. -So, the following YAML document cannot be loaded. - -``` yaml -&anchor foo: - foo: bar - *anchor: duplicate key - baz: bat - *anchor: duplicate key -``` - - -js-yaml for enterprise ----------------------- - -Available as part of the Tidelift Subscription - -The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/LICENSE b/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/LICENSE new file mode 100644 index 00000000000000..7b06c58dc6bde8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Simon Seyock + +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. diff --git a/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/dist/index.js b/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/dist/index.js new file mode 100644 index 00000000000000..afc146d87f2246 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/dist/index.js @@ -0,0 +1,2340 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jtpp = {})); +}(this, (function (exports) { 'use strict'; + + function tokenToString(token) { + if (token.text !== undefined && token.text !== '') { + return `'${token.type}' with value '${token.text}'`; + } + else { + return `'${token.type}'`; + } + } + class NoParsletFoundError extends Error { + constructor(token) { + super(`No parslet found for token: ${tokenToString(token)}`); + this.token = token; + Object.setPrototypeOf(this, NoParsletFoundError.prototype); + } + getToken() { + return this.token; + } + } + class EarlyEndOfParseError extends Error { + constructor(token) { + super(`The parsing ended early. The next token was: ${tokenToString(token)}`); + this.token = token; + Object.setPrototypeOf(this, EarlyEndOfParseError.prototype); + } + getToken() { + return this.token; + } + } + class UnexpectedTypeError extends Error { + constructor(result, message) { + let error = `Unexpected type: '${result.type}'.`; + if (message !== undefined) { + error += ` Message: ${message}`; + } + super(error); + Object.setPrototypeOf(this, UnexpectedTypeError.prototype); + } + } + // export class UnexpectedTokenError extends Error { + // private expected: Token + // private found: Token + // + // constructor (expected: Token, found: Token) { + // super(`The parsing ended early. The next token was: ${tokenToString(token)}`) + // + // this.token = token + // + // Object.setPrototypeOf(this, EarlyEndOfParseError.prototype) + // } + // + // getToken() { + // return this.token + // } + // } + + function makePunctuationRule(type) { + return text => { + if (text.startsWith(type)) { + return { type, text: type }; + } + else { + return null; + } + }; + } + function getQuoted(text) { + let position = 0; + let char; + const mark = text[0]; + let escaped = false; + if (mark !== '\'' && mark !== '"') { + return null; + } + while (position < text.length) { + position++; + char = text[position]; + if (!escaped && char === mark) { + position++; + break; + } + escaped = !escaped && char === '\\'; + } + if (char !== mark) { + throw new Error('Unterminated String'); + } + return text.slice(0, position); + } + const identifierStartRegex = /[$_\p{ID_Start}]|\\u\p{Hex_Digit}{4}|\\u\{0*(?:\p{Hex_Digit}{1,5}|10\p{Hex_Digit}{4})\}/u; + // A hyphen is not technically allowed, but to keep it liberal for now, + // adding it here + const identifierContinueRegex = /[$\-\p{ID_Continue}\u200C\u200D]|\\u\p{Hex_Digit}{4}|\\u\{0*(?:\p{Hex_Digit}{1,5}|10\p{Hex_Digit}{4})\}/u; + function getIdentifier(text) { + let char = text[0]; + if (!identifierStartRegex.test(char)) { + return null; + } + let position = 1; + do { + char = text[position]; + if (!identifierContinueRegex.test(char)) { + break; + } + position++; + } while (position < text.length); + return text.slice(0, position); + } + const numberRegex = /[0-9]/; + function getNumber(text) { + let position = 0; + let char; + do { + char = text[position]; + if (!numberRegex.test(char)) { + break; + } + position++; + } while (position < text.length); + if (position === 0) { + return null; + } + return text.slice(0, position); + } + const identifierRule = text => { + const value = getIdentifier(text); + if (value == null) { + return null; + } + return { + type: 'Identifier', + text: value + }; + }; + function makeKeyWordRule(type) { + return text => { + if (!text.startsWith(type)) { + return null; + } + const prepends = text[type.length]; + if (prepends !== undefined && identifierContinueRegex.test(prepends)) { + return null; + } + return { + type: type, + text: type + }; + }; + } + const stringValueRule = text => { + const value = getQuoted(text); + if (value == null) { + return null; + } + return { + type: 'StringValue', + text: value + }; + }; + const eofRule = text => { + if (text.length > 0) { + return null; + } + return { + type: 'EOF', + text: '' + }; + }; + const numberRule = text => { + const value = getNumber(text); + if (value === null) { + return null; + } + return { + type: 'Number', + text: value + }; + }; + const rules = [ + eofRule, + makePunctuationRule('=>'), + makePunctuationRule('('), + makePunctuationRule(')'), + makePunctuationRule('{'), + makePunctuationRule('}'), + makePunctuationRule('['), + makePunctuationRule(']'), + makePunctuationRule('|'), + makePunctuationRule('&'), + makePunctuationRule('<'), + makePunctuationRule('>'), + makePunctuationRule(','), + makePunctuationRule(';'), + makePunctuationRule('*'), + makePunctuationRule('?'), + makePunctuationRule('!'), + makePunctuationRule('='), + makePunctuationRule(':'), + makePunctuationRule('...'), + makePunctuationRule('.'), + makePunctuationRule('#'), + makePunctuationRule('~'), + makePunctuationRule('/'), + makePunctuationRule('@'), + makeKeyWordRule('undefined'), + makeKeyWordRule('null'), + makeKeyWordRule('function'), + makeKeyWordRule('this'), + makeKeyWordRule('new'), + makeKeyWordRule('module'), + makeKeyWordRule('event'), + makeKeyWordRule('external'), + makeKeyWordRule('typeof'), + makeKeyWordRule('keyof'), + makeKeyWordRule('readonly'), + makeKeyWordRule('import'), + identifierRule, + stringValueRule, + numberRule + ]; + class Lexer { + constructor() { + this.text = ''; + } + lex(text) { + this.text = text; + this.current = undefined; + this.next = undefined; + this.advance(); + } + token() { + if (this.current === undefined) { + throw new Error('Lexer not lexing'); + } + return this.current; + } + peek() { + if (this.next === undefined) { + this.next = this.read(); + } + return this.next; + } + last() { + return this.previous; + } + advance() { + this.previous = this.current; + if (this.next !== undefined) { + this.current = this.next; + this.next = undefined; + return; + } + this.current = this.read(); + } + read() { + const text = this.text.trim(); + for (const rule of rules) { + const token = rule(text); + if (token !== null) { + this.text = text.slice(token.text.length); + return token; + } + } + throw new Error('Unexpected Token ' + text); + } + } + + function assertTerminal(result) { + if (result === undefined) { + throw new Error('Unexpected undefined'); + } + if (result.type === 'JsdocTypeKeyValue' || result.type === 'JsdocTypeParameterList' || result.type === 'JsdocTypeProperty' || result.type === 'JsdocTypeReadonlyProperty') { + throw new UnexpectedTypeError(result); + } + return result; + } + function assertPlainKeyValueOrTerminal(result) { + if (result.type === 'JsdocTypeKeyValue') { + return assertPlainKeyValue(result); + } + return assertTerminal(result); + } + function assertPlainKeyValueOrName(result) { + if (result.type === 'JsdocTypeName') { + return result; + } + return assertPlainKeyValue(result); + } + function assertPlainKeyValue(result) { + if (!isPlainKeyValue(result)) { + if (result.type === 'JsdocTypeKeyValue') { + throw new UnexpectedTypeError(result, 'Expecting no left side expression.'); + } + else { + throw new UnexpectedTypeError(result); + } + } + return result; + } + function assertNumberOrVariadicName(result) { + var _a; + if (result.type === 'JsdocTypeVariadic') { + if (((_a = result.element) === null || _a === void 0 ? void 0 : _a.type) === 'JsdocTypeName') { + return result; + } + throw new UnexpectedTypeError(result); + } + if (result.type !== 'JsdocTypeNumber' && result.type !== 'JsdocTypeName') { + throw new UnexpectedTypeError(result); + } + return result; + } + function isPlainKeyValue(result) { + return result.type === 'JsdocTypeKeyValue' && !result.meta.hasLeftSideExpression; + } + + // higher precedence = higher importance + var Precedence; + (function (Precedence) { + Precedence[Precedence["ALL"] = 0] = "ALL"; + Precedence[Precedence["PARAMETER_LIST"] = 1] = "PARAMETER_LIST"; + Precedence[Precedence["OBJECT"] = 2] = "OBJECT"; + Precedence[Precedence["KEY_VALUE"] = 3] = "KEY_VALUE"; + Precedence[Precedence["UNION"] = 4] = "UNION"; + Precedence[Precedence["INTERSECTION"] = 5] = "INTERSECTION"; + Precedence[Precedence["PREFIX"] = 6] = "PREFIX"; + Precedence[Precedence["POSTFIX"] = 7] = "POSTFIX"; + Precedence[Precedence["TUPLE"] = 8] = "TUPLE"; + Precedence[Precedence["SYMBOL"] = 9] = "SYMBOL"; + Precedence[Precedence["OPTIONAL"] = 10] = "OPTIONAL"; + Precedence[Precedence["NULLABLE"] = 11] = "NULLABLE"; + Precedence[Precedence["KEY_OF_TYPE_OF"] = 12] = "KEY_OF_TYPE_OF"; + Precedence[Precedence["FUNCTION"] = 13] = "FUNCTION"; + Precedence[Precedence["ARROW"] = 14] = "ARROW"; + Precedence[Precedence["GENERIC"] = 15] = "GENERIC"; + Precedence[Precedence["NAME_PATH"] = 16] = "NAME_PATH"; + Precedence[Precedence["ARRAY_BRACKETS"] = 17] = "ARRAY_BRACKETS"; + Precedence[Precedence["PARENTHESIS"] = 18] = "PARENTHESIS"; + Precedence[Precedence["SPECIAL_TYPES"] = 19] = "SPECIAL_TYPES"; + })(Precedence || (Precedence = {})); + + class Parser { + constructor(grammar, lexer) { + this.lexer = lexer !== null && lexer !== void 0 ? lexer : new Lexer(); + const { prefixParslets, infixParslets } = grammar; + this.prefixParslets = prefixParslets; + this.infixParslets = infixParslets; + } + parseText(text) { + this.lexer.lex(text); + const result = this.parseType(Precedence.ALL); + if (!this.consume('EOF')) { + throw new EarlyEndOfParseError(this.getToken()); + } + return result; + } + getPrefixParslet() { + return this.prefixParslets.find(p => p.accepts(this.getToken().type, this.peekToken().type)); + } + getInfixParslet(precedence) { + return this.infixParslets.find(p => { + return p.getPrecedence() > precedence && p.accepts(this.getToken().type, this.peekToken().type); + }); + } + canParseType() { + return this.getPrefixParslet() !== undefined; + } + parseType(precedence) { + return assertTerminal(this.parseIntermediateType(precedence)); + } + parseIntermediateType(precedence) { + const parslet = this.getPrefixParslet(); + if (parslet === undefined) { + throw new NoParsletFoundError(this.getToken()); + } + const result = parslet.parsePrefix(this); + return this.parseInfixIntermediateType(result, precedence); + } + parseInfixIntermediateType(result, precedence) { + let parslet = this.getInfixParslet(precedence); + while (parslet !== undefined) { + result = parslet.parseInfix(this, result); + parslet = this.getInfixParslet(precedence); + } + return result; + } + consume(type) { + if (this.lexer.token().type !== type) { + return false; + } + this.lexer.advance(); + return true; + } + getToken() { + return this.lexer.token(); + } + peekToken() { + return this.lexer.peek(); + } + previousToken() { + return this.lexer.last(); + } + getLexer() { + return this.lexer; + } + } + + class SymbolParslet { + accepts(type) { + return type === '('; + } + getPrecedence() { + return Precedence.SYMBOL; + } + parseInfix(parser, left) { + if (left.type !== 'JsdocTypeName') { + throw new Error('Symbol expects a name on the left side. (Reacting on \'(\')'); + } + parser.consume('('); + const result = { + type: 'JsdocTypeSymbol', + value: left.value + }; + if (!parser.consume(')')) { + const next = parser.parseIntermediateType(Precedence.SYMBOL); + result.element = assertNumberOrVariadicName(next); + if (!parser.consume(')')) { + throw new Error('Symbol does not end after value'); + } + } + return result; + } + } + + class ArrayBracketsParslet { + accepts(type, next) { + return type === '[' && next === ']'; + } + getPrecedence() { + return Precedence.ARRAY_BRACKETS; + } + parseInfix(parser, left) { + parser.consume('['); + parser.consume(']'); + return { + type: 'JsdocTypeGeneric', + left: { + type: 'JsdocTypeName', + value: 'Array' + }, + elements: [ + assertTerminal(left) + ], + meta: { + brackets: 'square', + dot: false + } + }; + } + } + + class StringValueParslet { + accepts(type) { + return type === 'StringValue'; + } + getPrecedence() { + return Precedence.PREFIX; + } + parsePrefix(parser) { + const token = parser.getToken(); + parser.consume('StringValue'); + return { + type: 'JsdocTypeStringValue', + value: token.text.slice(1, -1), + meta: { + quote: token.text[0] === '\'' ? 'single' : 'double' + } + }; + } + } + + class BaseFunctionParslet { + getParameters(value) { + let parameters; + if (value.type === 'JsdocTypeParameterList') { + parameters = value.elements; + } + else if (value.type === 'JsdocTypeParenthesis') { + parameters = [value.element]; + } + else { + throw new UnexpectedTypeError(value); + } + return parameters.map(p => assertPlainKeyValueOrTerminal(p)); + } + getUnnamedParameters(value) { + const parameters = this.getParameters(value); + if (parameters.some(p => p.type === 'JsdocTypeKeyValue')) { + throw new Error('No parameter should be named'); + } + return parameters; + } + } + + class FunctionParslet extends BaseFunctionParslet { + constructor(options) { + super(); + this.allowWithoutParenthesis = options.allowWithoutParenthesis; + this.allowNamedParameters = options.allowNamedParameters; + this.allowNoReturnType = options.allowNoReturnType; + } + accepts(type) { + return type === 'function'; + } + getPrecedence() { + return Precedence.FUNCTION; + } + parsePrefix(parser) { + parser.consume('function'); + const hasParenthesis = parser.getToken().type === '('; + if (!hasParenthesis) { + if (!this.allowWithoutParenthesis) { + throw new Error('function is missing parameter list'); + } + return { + type: 'JsdocTypeName', + value: 'function' + }; + } + const result = { + type: 'JsdocTypeFunction', + parameters: [], + arrow: false, + parenthesis: hasParenthesis + }; + const value = parser.parseIntermediateType(Precedence.FUNCTION); + if (this.allowNamedParameters === undefined) { + result.parameters = this.getUnnamedParameters(value); + } + else { + result.parameters = this.getParameters(value); + for (const p of result.parameters) { + if (p.type === 'JsdocTypeKeyValue' && (!this.allowNamedParameters.includes(p.key) || p.meta.quote !== undefined)) { + throw new Error(`only allowed named parameters are ${this.allowNamedParameters.join(',')} but got ${p.type}`); + } + } + } + if (parser.consume(':')) { + result.returnType = parser.parseType(Precedence.PREFIX); + } + else { + if (!this.allowNoReturnType) { + throw new Error('function is missing return type'); + } + } + return result; + } + } + + class UnionParslet { + accepts(type) { + return type === '|'; + } + getPrecedence() { + return Precedence.UNION; + } + parseInfix(parser, left) { + parser.consume('|'); + const elements = []; + do { + elements.push(parser.parseType(Precedence.UNION)); + } while (parser.consume('|')); + return { + type: 'JsdocTypeUnion', + elements: [assertTerminal(left), ...elements] + }; + } + } + + function isQuestionMarkUnknownType(next) { + return next === 'EOF' || next === '|' || next === ',' || next === ')' || next === '>'; + } + + class SpecialTypesParslet { + accepts(type, next) { + return (type === '?' && isQuestionMarkUnknownType(next)) || type === 'null' || type === 'undefined' || type === '*'; + } + getPrecedence() { + return Precedence.SPECIAL_TYPES; + } + parsePrefix(parser) { + if (parser.consume('null')) { + return { + type: 'JsdocTypeNull' + }; + } + if (parser.consume('undefined')) { + return { + type: 'JsdocTypeUndefined' + }; + } + if (parser.consume('*')) { + return { + type: 'JsdocTypeAny' + }; + } + if (parser.consume('?')) { + return { + type: 'JsdocTypeUnknown' + }; + } + throw new Error('Unacceptable token: ' + parser.getToken().text); + } + } + + class GenericParslet { + accepts(type, next) { + return type === '<' || (type === '.' && next === '<'); + } + getPrecedence() { + return Precedence.GENERIC; + } + parseInfix(parser, left) { + const dot = parser.consume('.'); + parser.consume('<'); + const objects = []; + do { + objects.push(parser.parseType(Precedence.PARAMETER_LIST)); + } while (parser.consume(',')); + if (!parser.consume('>')) { + throw new Error('Unterminated generic parameter list'); + } + return { + type: 'JsdocTypeGeneric', + left: assertTerminal(left), + elements: objects, + meta: { + brackets: 'angle', + dot + } + }; + } + } + + class ParenthesisParslet { + accepts(type, next) { + return type === '('; + } + getPrecedence() { + return Precedence.PARENTHESIS; + } + parsePrefix(parser) { + parser.consume('('); + if (parser.consume(')')) { + return { + type: 'JsdocTypeParameterList', + elements: [] + }; + } + const result = parser.parseIntermediateType(Precedence.ALL); + if (!parser.consume(')')) { + throw new Error('Unterminated parenthesis'); + } + if (result.type === 'JsdocTypeParameterList') { + return result; + } + else if (result.type === 'JsdocTypeKeyValue' && isPlainKeyValue(result)) { + return { + type: 'JsdocTypeParameterList', + elements: [result] + }; + } + return { + type: 'JsdocTypeParenthesis', + element: assertTerminal(result) + }; + } + } + + class NumberParslet { + accepts(type, next) { + return type === 'Number'; + } + getPrecedence() { + return Precedence.PREFIX; + } + parsePrefix(parser) { + const token = parser.getToken(); + parser.consume('Number'); + return { + type: 'JsdocTypeNumber', + value: parseInt(token.text, 10) + }; + } + } + + class ParameterListParslet { + constructor(option) { + this.allowTrailingComma = option.allowTrailingComma; + } + accepts(type, next) { + return type === ','; + } + getPrecedence() { + return Precedence.PARAMETER_LIST; + } + parseInfix(parser, left) { + const elements = [ + assertPlainKeyValueOrTerminal(left) + ]; + parser.consume(','); + do { + try { + const next = parser.parseIntermediateType(Precedence.PARAMETER_LIST); + elements.push(assertPlainKeyValueOrTerminal(next)); + } + catch (e) { + if (this.allowTrailingComma && e instanceof NoParsletFoundError) { + break; + } + else { + throw e; + } + } + } while (parser.consume(',')); + if (elements.length > 0 && elements.slice(0, -1).some(e => e.type === 'JsdocTypeVariadic')) { + throw new Error('Only the last parameter may be a rest parameter'); + } + return { + type: 'JsdocTypeParameterList', + elements + }; + } + } + + class NullablePrefixParslet { + accepts(type, next) { + return type === '?' && !isQuestionMarkUnknownType(next); + } + getPrecedence() { + return Precedence.NULLABLE; + } + parsePrefix(parser) { + parser.consume('?'); + return { + type: 'JsdocTypeNullable', + element: parser.parseType(Precedence.NULLABLE), + meta: { + position: 'prefix' + } + }; + } + } + class NullableInfixParslet { + accepts(type, next) { + return type === '?'; + } + getPrecedence() { + return Precedence.NULLABLE; + } + parseInfix(parser, left) { + parser.consume('?'); + return { + type: 'JsdocTypeNullable', + element: assertTerminal(left), + meta: { + position: 'suffix' + } + }; + } + } + + class OptionalParslet { + accepts(type, next) { + return type === '='; + } + getPrecedence() { + return Precedence.OPTIONAL; + } + parsePrefix(parser) { + parser.consume('='); + return { + type: 'JsdocTypeOptional', + element: parser.parseType(Precedence.OPTIONAL), + meta: { + position: 'prefix' + } + }; + } + parseInfix(parser, left) { + parser.consume('='); + return { + type: 'JsdocTypeOptional', + element: assertTerminal(left), + meta: { + position: 'suffix' + } + }; + } + } + + class NotNullableParslet { + accepts(type, next) { + return type === '!'; + } + getPrecedence() { + return Precedence.NULLABLE; + } + parsePrefix(parser) { + parser.consume('!'); + return { + type: 'JsdocTypeNotNullable', + element: parser.parseType(Precedence.NULLABLE), + meta: { + position: 'prefix' + } + }; + } + parseInfix(parser, left) { + parser.consume('!'); + return { + type: 'JsdocTypeNotNullable', + element: assertTerminal(left), + meta: { + position: 'suffix' + } + }; + } + } + + const baseGrammar = () => { + return { + prefixParslets: [ + new NullablePrefixParslet(), + new OptionalParslet(), + new NumberParslet(), + new ParenthesisParslet(), + new SpecialTypesParslet(), + new NotNullableParslet() + ], + infixParslets: [ + new ParameterListParslet({ + allowTrailingComma: true + }), + new GenericParslet(), + new UnionParslet(), + new OptionalParslet(), + new NullableInfixParslet(), + new NotNullableParslet() + ] + }; + }; + + class NamePathParslet { + constructor(opts) { + this.allowJsdocNamePaths = opts.allowJsdocNamePaths; + this.allowedPropertyTokenTypes = [ + 'Identifier', + 'StringValue', + 'Number' + ]; + } + accepts(type, next) { + return (type === '.' && next !== '<') || (this.allowJsdocNamePaths && (type === '~' || type === '#')); + } + getPrecedence() { + return Precedence.NAME_PATH; + } + parseInfix(parser, left) { + let type; + if (parser.consume('.')) { + type = 'property'; + } + else if (parser.consume('~')) { + type = 'inner'; + } + else { + parser.consume('#'); + type = 'instance'; + } + let right; + const tokenType = this.allowedPropertyTokenTypes.find(token => parser.getToken().type === token); + if (tokenType !== undefined) { + const value = parser.getToken().text; + parser.consume(tokenType); + right = { + type: 'JsdocTypeProperty', + value: value + }; + } + else { + const next = parser.parseIntermediateType(Precedence.NAME_PATH); + if (next.type === 'JsdocTypeName' && next.value === 'event') { + right = { + type: 'JsdocTypeProperty', + value: 'event' + }; + } + else if (next.type === 'JsdocTypeSpecialNamePath' && next.specialType === 'event') { + right = next; + } + else { + const validTokens = this.allowedPropertyTokenTypes.join(', '); + throw new Error(`Unexpected property value. Expecting token of type ${validTokens} or 'event' ` + + `name path. Next token is of type: ${parser.getToken().type}`); + } + } + return { + type: 'JsdocTypeNamePath', + left: assertTerminal(left), + right, + pathType: type + }; + } + } + + class KeyValueParslet { + constructor(opts) { + this.allowKeyTypes = opts.allowKeyTypes; + this.allowOptional = opts.allowOptional; + this.allowReadonly = opts.allowReadonly; + } + accepts(type, next) { + return type === ':'; + } + getPrecedence() { + return Precedence.KEY_VALUE; + } + parseInfix(parser, left) { + let optional = false; + let readonlyProperty = false; + if (this.allowOptional && left.type === 'JsdocTypeNullable') { + optional = true; + left = left.element; + } + if (this.allowReadonly && left.type === 'JsdocTypeReadonlyProperty') { + readonlyProperty = true; + left = left.element; + } + if (left.type === 'JsdocTypeNumber' || left.type === 'JsdocTypeName' || left.type === 'JsdocTypeStringValue') { + parser.consume(':'); + let quote; + if (left.type === 'JsdocTypeStringValue') { + quote = left.meta.quote; + } + return { + type: 'JsdocTypeKeyValue', + key: left.value.toString(), + right: parser.parseType(Precedence.KEY_VALUE), + optional: optional, + readonly: readonlyProperty, + meta: { + quote, + hasLeftSideExpression: false + } + }; + } + else { + if (!this.allowKeyTypes) { + throw new UnexpectedTypeError(left); + } + parser.consume(':'); + return { + type: 'JsdocTypeKeyValue', + left: assertTerminal(left), + right: parser.parseType(Precedence.KEY_VALUE), + meta: { + hasLeftSideExpression: true + } + }; + } + } + } + + class VariadicParslet { + constructor(opts) { + this.allowEnclosingBrackets = opts.allowEnclosingBrackets; + } + accepts(type) { + return type === '...'; + } + getPrecedence() { + return Precedence.PREFIX; + } + parsePrefix(parser) { + parser.consume('...'); + const brackets = this.allowEnclosingBrackets && parser.consume('['); + if (!parser.canParseType()) { + if (brackets) { + throw new Error('Empty square brackets for variadic are not allowed.'); + } + return { + type: 'JsdocTypeVariadic', + meta: { + position: undefined, + squareBrackets: false + } + }; + } + const element = parser.parseType(Precedence.PREFIX); + if (brackets && !parser.consume(']')) { + throw new Error('Unterminated variadic type. Missing \']\''); + } + return { + type: 'JsdocTypeVariadic', + element: assertTerminal(element), + meta: { + position: 'prefix', + squareBrackets: brackets + } + }; + } + parseInfix(parser, left) { + parser.consume('...'); + return { + type: 'JsdocTypeVariadic', + element: assertTerminal(left), + meta: { + position: 'suffix', + squareBrackets: false + } + }; + } + } + + class NameParslet { + constructor(options) { + this.allowedAdditionalTokens = options.allowedAdditionalTokens; + } + accepts(type, next) { + return type === 'Identifier' || type === 'this' || type === 'new' || this.allowedAdditionalTokens.includes(type); + } + getPrecedence() { + return Precedence.PREFIX; + } + parsePrefix(parser) { + const token = parser.getToken(); + parser.consume('Identifier') || parser.consume('this') || parser.consume('new') || + this.allowedAdditionalTokens.some(type => parser.consume(type)); + return { + type: 'JsdocTypeName', + value: token.text + }; + } + } + + const moduleGrammar = () => ({ + prefixParslets: [ + new SpecialNamePathParslet({ + allowedTypes: ['event'] + }), + new NameParslet({ + allowedAdditionalTokens: ['module', 'external'] + }), + new NumberParslet(), + new StringValueParslet() + ], + infixParslets: [ + new NamePathParslet({ + allowJsdocNamePaths: true + }) + ] + }); + + class SpecialNamePathParslet { + constructor(opts) { + this.allowedTypes = opts.allowedTypes; + } + accepts(type, next) { + return this.allowedTypes.includes(type); + } + getPrecedence() { + return Precedence.PREFIX; + } + parsePrefix(parser) { + const type = this.allowedTypes.find(type => parser.consume(type)); + if (!parser.consume(':')) { + return { + type: 'JsdocTypeName', + value: type + }; + } + const moduleParser = new Parser(moduleGrammar(), parser.getLexer()); + let result; + let token = parser.getToken(); + if (parser.consume('StringValue')) { + result = { + type: 'JsdocTypeSpecialNamePath', + value: token.text.slice(1, -1), + specialType: type, + meta: { + quote: token.text[0] === '\'' ? 'single' : 'double' + } + }; + } + else { + let value = ''; + const allowed = ['Identifier', '@', '/']; + while (allowed.some(type => parser.consume(type))) { + value += token.text; + token = parser.getToken(); + } + result = { + type: 'JsdocTypeSpecialNamePath', + value, + specialType: type, + meta: { + quote: undefined + } + }; + } + return assertTerminal(moduleParser.parseInfixIntermediateType(result, Precedence.ALL)); + } + } + + class ObjectParslet { + constructor(opts) { + this.allowKeyTypes = opts.allowKeyTypes; + } + accepts(type) { + return type === '{'; + } + getPrecedence() { + return Precedence.OBJECT; + } + parsePrefix(parser) { + parser.consume('{'); + const result = { + type: 'JsdocTypeObject', + meta: { + separator: 'comma' + }, + elements: [] + }; + if (!parser.consume('}')) { + let separator; + while (true) { + let field = parser.parseIntermediateType(Precedence.OBJECT); + let optional = false; + if (field.type === 'JsdocTypeNullable') { + optional = true; + field = field.element; + } + if (field.type === 'JsdocTypeNumber' || field.type === 'JsdocTypeName' || field.type === 'JsdocTypeStringValue') { + let quote; + if (field.type === 'JsdocTypeStringValue') { + quote = field.meta.quote; + } + result.elements.push({ + type: 'JsdocTypeKeyValue', + key: field.value.toString(), + right: undefined, + optional: optional, + readonly: false, + meta: { + quote, + hasLeftSideExpression: false + } + }); + } + else if (field.type === 'JsdocTypeKeyValue') { + result.elements.push(field); + } + else { + throw new UnexpectedTypeError(field); + } + if (parser.consume(',')) { + separator = 'comma'; + } + else if (parser.consume(';')) { + separator = 'semicolon'; + } + else { + break; + } + } + result.meta.separator = separator !== null && separator !== void 0 ? separator : 'comma'; + if (!parser.consume('}')) { + throw new Error('Unterminated record type. Missing \'}\''); + } + } + return result; + } + } + + const jsdocGrammar = () => { + const { prefixParslets, infixParslets } = baseGrammar(); + return { + prefixParslets: [ + ...prefixParslets, + new ObjectParslet({ + allowKeyTypes: true + }), + new FunctionParslet({ + allowWithoutParenthesis: true, + allowNamedParameters: ['this', 'new'], + allowNoReturnType: true + }), + new StringValueParslet(), + new SpecialNamePathParslet({ + allowedTypes: ['module', 'external', 'event'] + }), + new VariadicParslet({ + allowEnclosingBrackets: true + }), + new NameParslet({ + allowedAdditionalTokens: ['keyof'] + }) + ], + infixParslets: [ + ...infixParslets, + new SymbolParslet(), + new ArrayBracketsParslet(), + new NamePathParslet({ + allowJsdocNamePaths: true + }), + new KeyValueParslet({ + allowKeyTypes: true, + allowOptional: false, + allowReadonly: false + }), + new VariadicParslet({ + allowEnclosingBrackets: true + }) + ] + }; + }; + + class TypeOfParslet { + accepts(type, next) { + return type === 'typeof'; + } + getPrecedence() { + return Precedence.KEY_OF_TYPE_OF; + } + parsePrefix(parser) { + parser.consume('typeof'); + return { + type: 'JsdocTypeTypeof', + element: assertTerminal(parser.parseType(Precedence.KEY_OF_TYPE_OF)) + }; + } + } + + const closureGrammar = () => { + const { prefixParslets, infixParslets } = baseGrammar(); + return { + prefixParslets: [ + ...prefixParslets, + new ObjectParslet({ + allowKeyTypes: false + }), + new NameParslet({ + allowedAdditionalTokens: ['event', 'external'] + }), + new TypeOfParslet(), + new FunctionParslet({ + allowWithoutParenthesis: false, + allowNamedParameters: ['this', 'new'], + allowNoReturnType: true + }), + new VariadicParslet({ + allowEnclosingBrackets: false + }), + new NameParslet({ + allowedAdditionalTokens: ['keyof'] + }), + new SpecialNamePathParslet({ + allowedTypes: ['module'] + }) + ], + infixParslets: [ + ...infixParslets, + new NamePathParslet({ + allowJsdocNamePaths: true + }), + new KeyValueParslet({ + allowKeyTypes: false, + allowOptional: false, + allowReadonly: false + }), + new SymbolParslet() + ] + }; + }; + + class TupleParslet { + constructor(opts) { + this.allowQuestionMark = opts.allowQuestionMark; + } + accepts(type, next) { + return type === '['; + } + getPrecedence() { + return Precedence.TUPLE; + } + parsePrefix(parser) { + parser.consume('['); + const result = { + type: 'JsdocTypeTuple', + elements: [] + }; + if (parser.consume(']')) { + return result; + } + const typeList = parser.parseIntermediateType(Precedence.ALL); + if (typeList.type === 'JsdocTypeParameterList') { + if (typeList.elements[0].type === 'JsdocTypeKeyValue') { + result.elements = typeList.elements.map(assertPlainKeyValue); + } + else { + result.elements = typeList.elements.map(assertTerminal); + } + } + else { + if (typeList.type === 'JsdocTypeKeyValue') { + result.elements = [assertPlainKeyValue(typeList)]; + } + else { + result.elements = [assertTerminal(typeList)]; + } + } + if (!parser.consume(']')) { + throw new Error('Unterminated \'[\''); + } + if (!this.allowQuestionMark && result.elements.some((e) => e.type === 'JsdocTypeUnknown')) { + throw new Error('Question mark in tuple not allowed'); + } + return result; + } + } + + class KeyOfParslet { + accepts(type, next) { + return type === 'keyof'; + } + getPrecedence() { + return Precedence.KEY_OF_TYPE_OF; + } + parsePrefix(parser) { + parser.consume('keyof'); + return { + type: 'JsdocTypeKeyof', + element: assertTerminal(parser.parseType(Precedence.KEY_OF_TYPE_OF)) + }; + } + } + + class ImportParslet { + accepts(type, next) { + return type === 'import'; + } + getPrecedence() { + return Precedence.PREFIX; + } + parsePrefix(parser) { + parser.consume('import'); + if (!parser.consume('(')) { + throw new Error('Missing parenthesis after import keyword'); + } + const path = parser.parseType(Precedence.PREFIX); + if (path.type !== 'JsdocTypeStringValue') { + throw new Error('Only string values are allowed as paths for imports'); + } + if (!parser.consume(')')) { + throw new Error('Missing closing parenthesis after import keyword'); + } + return { + type: 'JsdocTypeImport', + element: path + }; + } + } + + class ArrowFunctionParslet extends BaseFunctionParslet { + accepts(type, next) { + return type === '=>'; + } + getPrecedence() { + return Precedence.ARROW; + } + parseInfix(parser, left) { + parser.consume('=>'); + return { + type: 'JsdocTypeFunction', + parameters: this.getParameters(left).map(assertPlainKeyValueOrName), + arrow: true, + parenthesis: true, + returnType: parser.parseType(Precedence.ALL) + }; + } + } + + class IntersectionParslet { + accepts(type) { + return type === '&'; + } + getPrecedence() { + return Precedence.INTERSECTION; + } + parseInfix(parser, left) { + parser.consume('&'); + const elements = []; + do { + elements.push(parser.parseType(Precedence.INTERSECTION)); + } while (parser.consume('&')); + return { + type: 'JsdocTypeIntersection', + elements: [assertTerminal(left), ...elements] + }; + } + } + + class ReadonlyPropertyParslet { + accepts(type, next) { + return type === 'readonly'; + } + getPrecedence() { + return Precedence.PREFIX; + } + parsePrefix(parser) { + parser.consume('readonly'); + return { + type: 'JsdocTypeReadonlyProperty', + element: parser.parseType(Precedence.KEY_VALUE) + }; + } + } + + const typescriptGrammar = () => { + const { prefixParslets, infixParslets } = baseGrammar(); + // module seems not to be supported + return { + parallel: [ + moduleGrammar() + ], + prefixParslets: [ + ...prefixParslets, + new ObjectParslet({ + allowKeyTypes: false + }), + new TypeOfParslet(), + new KeyOfParslet(), + new ImportParslet(), + new StringValueParslet(), + new FunctionParslet({ + allowWithoutParenthesis: true, + allowNoReturnType: false, + allowNamedParameters: ['this', 'new'] + }), + new TupleParslet({ + allowQuestionMark: false + }), + new VariadicParslet({ + allowEnclosingBrackets: false + }), + new NameParslet({ + allowedAdditionalTokens: ['event', 'external'] + }), + new SpecialNamePathParslet({ + allowedTypes: ['module'] + }), + new ReadonlyPropertyParslet() + ], + infixParslets: [ + ...infixParslets, + new ArrayBracketsParslet(), + new ArrowFunctionParslet(), + new NamePathParslet({ + allowJsdocNamePaths: false + }), + new KeyValueParslet({ + allowKeyTypes: false, + allowOptional: true, + allowReadonly: true + }), + new IntersectionParslet() + ] + }; + }; + + const parsers = { + jsdoc: new Parser(jsdocGrammar()), + closure: new Parser(closureGrammar()), + typescript: new Parser(typescriptGrammar()) + }; + /** + * This function parses the given expression in the given mode and produces a {@link ParseResult}. + * @param expression + * @param mode + */ + function parse(expression, mode) { + return parsers[mode].parseText(expression); + } + /** + * This function tries to parse the given expression in multiple modes and returns the first successful + * {@link ParseResult}. By default it tries `'typescript'`, `'closure'` and `'jsdoc'` in this order. If + * no mode was successful it throws the error that was produced by the last parsing attempt. + * @param expression + * @param modes + */ + function tryParse(expression, modes = ['typescript', 'closure', 'jsdoc']) { + let error; + for (const mode of modes) { + try { + return parsers[mode].parseText(expression); + } + catch (e) { + error = e; + } + } + throw error; + } + + function transform(rules, parseResult) { + const rule = rules[parseResult.type]; + if (rule === undefined) { + throw new Error(`In this set of transform rules exists no rule for type ${parseResult.type}.`); + } + return rule(parseResult, aParseResult => transform(rules, aParseResult)); + } + function notAvailableTransform(parseResult) { + throw new Error('This transform is not available. Are you trying the correct parsing mode?'); + } + function extractSpecialParams(source) { + const result = { + params: [] + }; + for (const param of source.parameters) { + if (param.type === 'JsdocTypeKeyValue' && param.meta.quote === undefined) { + if (param.key === 'this') { + result.this = param.right; + } + else if (param.key === 'new') { + result.new = param.right; + } + else { + result.params.push(param); + } + } + else { + result.params.push(param); + } + } + return result; + } + + function applyPosition(position, target, value) { + return position === 'prefix' ? value + target : target + value; + } + function quote(value, quote) { + switch (quote) { + case 'double': + return `"${value}"`; + case 'single': + return `'${value}'`; + case undefined: + return value; + } + } + function stringifyRules() { + return { + JsdocTypeParenthesis: (result, transform) => `(${result.element !== undefined ? transform(result.element) : ''})`, + JsdocTypeKeyof: (result, transform) => `keyof ${transform(result.element)}`, + JsdocTypeFunction: (result, transform) => { + if (!result.arrow) { + let stringified = 'function'; + if (!result.parenthesis) { + return stringified; + } + stringified += `(${result.parameters.map(transform).join(', ')})`; + if (result.returnType !== undefined) { + stringified += `: ${transform(result.returnType)}`; + } + return stringified; + } + else { + if (result.returnType === undefined) { + throw new Error('Arrow function needs a return type.'); + } + return `(${result.parameters.map(transform).join(', ')}) => ${transform(result.returnType)}`; + } + }, + JsdocTypeName: result => result.value, + JsdocTypeTuple: (result, transform) => `[${result.elements.map(transform).join(', ')}]`, + JsdocTypeVariadic: (result, transform) => result.meta.position === undefined + ? '...' + : applyPosition(result.meta.position, transform(result.element), '...'), + JsdocTypeNamePath: (result, transform) => { + const joiner = result.pathType === 'inner' ? '~' : result.pathType === 'instance' ? '#' : '.'; + return `${transform(result.left)}${joiner}${transform(result.right)}`; + }, + JsdocTypeStringValue: result => quote(result.value, result.meta.quote), + JsdocTypeAny: () => '*', + JsdocTypeGeneric: (result, transform) => { + if (result.meta.brackets === 'square') { + const element = result.elements[0]; + const transformed = transform(element); + if (element.type === 'JsdocTypeUnion' || element.type === 'JsdocTypeIntersection') { + return `(${transformed})[]`; + } + else { + return `${transformed}[]`; + } + } + else { + return `${transform(result.left)}${result.meta.dot ? '.' : ''}<${result.elements.map(transform).join(', ')}>`; + } + }, + JsdocTypeImport: (result, transform) => `import(${transform(result.element)})`, + JsdocTypeKeyValue: (result, transform) => { + if (isPlainKeyValue(result)) { + let text = ''; + if (result.readonly) { + text += 'readonly '; + } + text += quote(result.key, result.meta.quote); + if (result.optional) { + text += '?'; + } + if (result.right === undefined) { + return text; + } + else { + return text + `: ${transform(result.right)}`; + } + } + else { + return `${transform(result.left)}: ${transform(result.right)}`; + } + }, + JsdocTypeSpecialNamePath: result => `${result.specialType}:${quote(result.value, result.meta.quote)}`, + JsdocTypeNotNullable: (result, transform) => applyPosition(result.meta.position, transform(result.element), '!'), + JsdocTypeNull: () => 'null', + JsdocTypeNullable: (result, transform) => applyPosition(result.meta.position, transform(result.element), '?'), + JsdocTypeNumber: result => result.value.toString(), + JsdocTypeObject: (result, transform) => `{${result.elements.map(transform).join((result.meta.separator === 'comma' ? ',' : ';') + ' ')}}`, + JsdocTypeOptional: (result, transform) => applyPosition(result.meta.position, transform(result.element), '='), + JsdocTypeSymbol: (result, transform) => `${result.value}(${result.element !== undefined ? transform(result.element) : ''})`, + JsdocTypeTypeof: (result, transform) => `typeof ${transform(result.element)}`, + JsdocTypeUndefined: () => 'undefined', + JsdocTypeUnion: (result, transform) => result.elements.map(transform).join(' | '), + JsdocTypeUnknown: () => '?', + JsdocTypeIntersection: (result, transform) => result.elements.map(transform).join(' & '), + JsdocTypeProperty: result => result.value + }; + } + const storedStringifyRules = stringifyRules(); + function stringify(result) { + return transform(storedStringifyRules, result); + } + + const reservedWords = [ + 'null', + 'true', + 'false', + 'break', + 'case', + 'catch', + 'class', + 'const', + 'continue', + 'debugger', + 'default', + 'delete', + 'do', + 'else', + 'export', + 'extends', + 'finally', + 'for', + 'function', + 'if', + 'import', + 'in', + 'instanceof', + 'new', + 'return', + 'super', + 'switch', + 'this', + 'throw', + 'try', + 'typeof', + 'var', + 'void', + 'while', + 'with', + 'yield' + ]; + function makeName(value) { + const result = { + type: 'NameExpression', + name: value + }; + if (reservedWords.includes(value)) { + result.reservedWord = true; + } + return result; + } + const catharsisTransformRules = { + JsdocTypeOptional: (result, transform) => { + const transformed = transform(result.element); + transformed.optional = true; + return transformed; + }, + JsdocTypeNullable: (result, transform) => { + const transformed = transform(result.element); + transformed.nullable = true; + return transformed; + }, + JsdocTypeNotNullable: (result, transform) => { + const transformed = transform(result.element); + transformed.nullable = false; + return transformed; + }, + JsdocTypeVariadic: (result, transform) => { + if (result.element === undefined) { + throw new Error('dots without value are not allowed in catharsis mode'); + } + const transformed = transform(result.element); + transformed.repeatable = true; + return transformed; + }, + JsdocTypeAny: () => ({ + type: 'AllLiteral' + }), + JsdocTypeNull: () => ({ + type: 'NullLiteral' + }), + JsdocTypeStringValue: result => makeName(quote(result.value, result.meta.quote)), + JsdocTypeUndefined: () => ({ + type: 'UndefinedLiteral' + }), + JsdocTypeUnknown: () => ({ + type: 'UnknownLiteral' + }), + JsdocTypeFunction: (result, transform) => { + const params = extractSpecialParams(result); + const transformed = { + type: 'FunctionType', + params: params.params.map(transform) + }; + if (params.this !== undefined) { + transformed.this = transform(params.this); + } + if (params.new !== undefined) { + transformed.new = transform(params.new); + } + if (result.returnType !== undefined) { + transformed.result = transform(result.returnType); + } + return transformed; + }, + JsdocTypeGeneric: (result, transform) => ({ + type: 'TypeApplication', + applications: result.elements.map(o => transform(o)), + expression: transform(result.left) + }), + JsdocTypeSpecialNamePath: result => makeName(result.specialType + ':' + quote(result.value, result.meta.quote)), + JsdocTypeName: result => { + if (result.value !== 'function') { + return makeName(result.value); + } + else { + return { + type: 'FunctionType', + params: [] + }; + } + }, + JsdocTypeNumber: result => makeName(result.value.toString()), + JsdocTypeObject: (result, transform) => { + const transformed = { + type: 'RecordType', + fields: [] + }; + for (const field of result.elements) { + if (field.type !== 'JsdocTypeKeyValue') { + transformed.fields.push({ + type: 'FieldType', + key: transform(field), + value: undefined + }); + } + else { + transformed.fields.push(transform(field)); + } + } + return transformed; + }, + JsdocTypeUnion: (result, transform) => ({ + type: 'TypeUnion', + elements: result.elements.map(e => transform(e)) + }), + JsdocTypeKeyValue: (result, transform) => { + if (isPlainKeyValue(result)) { + return { + type: 'FieldType', + key: makeName(quote(result.key, result.meta.quote)), + value: result.right === undefined ? undefined : transform(result.right) + }; + } + else { + return { + type: 'FieldType', + key: transform(result.left), + value: transform(result.right) + }; + } + }, + JsdocTypeNamePath: (result, transform) => { + const leftResult = transform(result.left); + let rightValue; + if (result.right.type === 'JsdocTypeSpecialNamePath') { + rightValue = transform(result.right).name; + } + else { + rightValue = result.right.value; + } + const joiner = result.pathType === 'inner' ? '~' : result.pathType === 'instance' ? '#' : '.'; + return makeName(`${leftResult.name}${joiner}${rightValue}`); + }, + JsdocTypeSymbol: result => { + let value = ''; + let element = result.element; + let trailingDots = false; + if ((element === null || element === void 0 ? void 0 : element.type) === 'JsdocTypeVariadic') { + if (element.meta.position === 'prefix') { + value = '...'; + } + else { + trailingDots = true; + } + element = element.element; + } + if ((element === null || element === void 0 ? void 0 : element.type) === 'JsdocTypeName') { + value += element.value; + } + else if ((element === null || element === void 0 ? void 0 : element.type) === 'JsdocTypeNumber') { + value += element.value.toString(); + } + if (trailingDots) { + value += '...'; + } + return makeName(`${result.value}(${value})`); + }, + JsdocTypeParenthesis: (result, transform) => transform(assertTerminal(result.element)), + JsdocTypeImport: notAvailableTransform, + JsdocTypeKeyof: notAvailableTransform, + JsdocTypeTuple: notAvailableTransform, + JsdocTypeTypeof: notAvailableTransform, + JsdocTypeIntersection: notAvailableTransform, + JsdocTypeProperty: notAvailableTransform + }; + function catharsisTransform(result) { + return transform(catharsisTransformRules, result); + } + + function getQuoteStyle(quote) { + switch (quote) { + case undefined: + return 'none'; + case 'single': + return 'single'; + case 'double': + return 'double'; + } + } + function getMemberType(type) { + switch (type) { + case 'inner': + return 'INNER_MEMBER'; + case 'instance': + return 'INSTANCE_MEMBER'; + case 'property': + return 'MEMBER'; + } + } + function nestResults(type, results) { + if (results.length === 2) { + return { + type, + left: results[0], + right: results[1] + }; + } + else { + return { + type, + left: results[0], + right: nestResults(type, results.slice(1)) + }; + } + } + const jtpRules = { + JsdocTypeOptional: (result, transform) => ({ + type: 'OPTIONAL', + value: transform(result.element), + meta: { + syntax: result.meta.position === 'prefix' ? 'PREFIX_EQUAL_SIGN' : 'SUFFIX_EQUALS_SIGN' + } + }), + JsdocTypeNullable: (result, transform) => ({ + type: 'NULLABLE', + value: transform(result.element), + meta: { + syntax: result.meta.position === 'prefix' ? 'PREFIX_QUESTION_MARK' : 'SUFFIX_QUESTION_MARK' + } + }), + JsdocTypeNotNullable: (result, transform) => ({ + type: 'NOT_NULLABLE', + value: transform(result.element), + meta: { + syntax: result.meta.position === 'prefix' ? 'PREFIX_BANG' : 'SUFFIX_BANG' + } + }), + JsdocTypeVariadic: (result, transform) => { + const transformed = { + type: 'VARIADIC', + meta: { + syntax: result.meta.position === 'prefix' + ? 'PREFIX_DOTS' + : result.meta.position === 'suffix' ? 'SUFFIX_DOTS' : 'ONLY_DOTS' + } + }; + if (result.element !== undefined) { + transformed.value = transform(result.element); + } + return transformed; + }, + JsdocTypeName: result => ({ + type: 'NAME', + name: result.value + }), + JsdocTypeTypeof: (result, transform) => ({ + type: 'TYPE_QUERY', + name: transform(result.element) + }), + JsdocTypeTuple: (result, transform) => ({ + type: 'TUPLE', + entries: result.elements.map(transform) + }), + JsdocTypeKeyof: (result, transform) => ({ + type: 'KEY_QUERY', + value: transform(result.element) + }), + JsdocTypeImport: result => ({ + type: 'IMPORT', + path: { + type: 'STRING_VALUE', + quoteStyle: getQuoteStyle(result.element.meta.quote), + string: result.element.value + } + }), + JsdocTypeUndefined: () => ({ + type: 'NAME', + name: 'undefined' + }), + JsdocTypeAny: () => ({ + type: 'ANY' + }), + JsdocTypeFunction: (result, transform) => { + const specialParams = extractSpecialParams(result); + const transformed = { + type: result.arrow ? 'ARROW' : 'FUNCTION', + params: specialParams.params.map(param => { + if (param.type === 'JsdocTypeKeyValue') { + if (param.right === undefined) { + throw new Error('Function parameter without \':\' is not expected to be \'KEY_VALUE\''); + } + return { + type: 'NAMED_PARAMETER', + name: param.key, + typeName: transform(param.right) + }; + } + else { + return transform(param); + } + }), + new: null, + returns: null + }; + if (specialParams.this !== undefined) { + transformed.this = transform(specialParams.this); + } + else if (!result.arrow) { + transformed.this = null; + } + if (specialParams.new !== undefined) { + transformed.new = transform(specialParams.new); + } + if (result.returnType !== undefined) { + transformed.returns = transform(result.returnType); + } + return transformed; + }, + JsdocTypeGeneric: (result, transform) => { + const transformed = { + type: 'GENERIC', + subject: transform(result.left), + objects: result.elements.map(transform), + meta: { + syntax: result.meta.brackets === 'square' ? 'SQUARE_BRACKET' : result.meta.dot ? 'ANGLE_BRACKET_WITH_DOT' : 'ANGLE_BRACKET' + } + }; + if (result.meta.brackets === 'square' && result.elements[0].type === 'JsdocTypeFunction' && !result.elements[0].parenthesis) { + transformed.objects[0] = { + type: 'NAME', + name: 'function' + }; + } + return transformed; + }, + JsdocTypeKeyValue: (result, transform) => { + if (!isPlainKeyValue(result)) { + throw new Error('Keys may not be typed in jsdoctypeparser.'); + } + if (result.right === undefined) { + return { + type: 'RECORD_ENTRY', + key: result.key.toString(), + quoteStyle: getQuoteStyle(result.meta.quote), + value: null, + readonly: false + }; + } + let right = transform(result.right); + if (result.optional) { + right = { + type: 'OPTIONAL', + value: right, + meta: { + syntax: 'SUFFIX_KEY_QUESTION_MARK' + } + }; + } + return { + type: 'RECORD_ENTRY', + key: result.key.toString(), + quoteStyle: getQuoteStyle(result.meta.quote), + value: right, + readonly: false + }; + }, + JsdocTypeObject: (result, transform) => { + const entries = []; + for (const field of result.elements) { + if (field.type === 'JsdocTypeKeyValue') { + entries.push(transform(field)); + } + } + return { + type: 'RECORD', + entries + }; + }, + JsdocTypeSpecialNamePath: result => { + if (result.specialType !== 'module') { + throw new Error(`jsdoctypeparser does not support type ${result.specialType} at this point.`); + } + return { + type: 'MODULE', + value: { + type: 'FILE_PATH', + quoteStyle: getQuoteStyle(result.meta.quote), + path: result.value + } + }; + }, + JsdocTypeNamePath: (result, transform) => { + let hasEventPrefix = false; + let name; + let quoteStyle; + if (result.right.type === 'JsdocTypeSpecialNamePath' && result.right.specialType === 'event') { + hasEventPrefix = true; + name = result.right.value; + quoteStyle = getQuoteStyle(result.right.meta.quote); + } + else { + let quote; + let value = result.right.value; + if (value[0] === '\'') { + quote = 'single'; + value = value.slice(1, -1); + } + else if (value[0] === '"') { + quote = 'double'; + value = value.slice(1, -1); + } + name = `${value}`; + quoteStyle = getQuoteStyle(quote); + } + const transformed = { + type: getMemberType(result.pathType), + owner: transform(result.left), + name, + quoteStyle, + hasEventPrefix + }; + if (transformed.owner.type === 'MODULE') { + const tModule = transformed.owner; + transformed.owner = transformed.owner.value; + tModule.value = transformed; + return tModule; + } + else { + return transformed; + } + }, + JsdocTypeUnion: (result, transform) => nestResults('UNION', result.elements.map(transform)), + JsdocTypeParenthesis: (result, transform) => ({ + type: 'PARENTHESIS', + value: transform(assertTerminal(result.element)) + }), + JsdocTypeNull: () => ({ + type: 'NAME', + name: 'null' + }), + JsdocTypeUnknown: () => ({ + type: 'UNKNOWN' + }), + JsdocTypeStringValue: result => ({ + type: 'STRING_VALUE', + quoteStyle: getQuoteStyle(result.meta.quote), + string: result.value + }), + JsdocTypeIntersection: (result, transform) => nestResults('INTERSECTION', result.elements.map(transform)), + JsdocTypeNumber: result => ({ + type: 'NUMBER_VALUE', + number: result.value.toString() + }), + JsdocTypeSymbol: notAvailableTransform, + JsdocTypeProperty: notAvailableTransform + }; + function jtpTransform(result) { + return transform(jtpRules, result); + } + + function identityTransformRules() { + return { + JsdocTypeIntersection: (result, transform) => ({ + type: 'JsdocTypeIntersection', + elements: result.elements.map(transform) + }), + JsdocTypeGeneric: (result, transform) => ({ + type: 'JsdocTypeGeneric', + left: transform(result.left), + elements: result.elements.map(transform), + meta: { + dot: result.meta.dot, + brackets: result.meta.brackets + } + }), + JsdocTypeNullable: result => result, + JsdocTypeUnion: (result, transform) => ({ + type: 'JsdocTypeUnion', + elements: result.elements.map(transform) + }), + JsdocTypeUnknown: result => result, + JsdocTypeUndefined: result => result, + JsdocTypeTypeof: (result, transform) => ({ + type: 'JsdocTypeTypeof', + element: transform(result.element) + }), + JsdocTypeSymbol: (result, transform) => { + const transformed = { + type: 'JsdocTypeSymbol', + value: result.value + }; + if (result.element !== undefined) { + transformed.element = transform(result.element); + } + return transformed; + }, + JsdocTypeOptional: (result, transform) => ({ + type: 'JsdocTypeOptional', + element: transform(result.element), + meta: { + position: result.meta.position + } + }), + JsdocTypeObject: (result, transform) => ({ + type: 'JsdocTypeObject', + meta: { + separator: 'comma' + }, + elements: result.elements.map(transform) + }), + JsdocTypeNumber: result => result, + JsdocTypeNull: result => result, + JsdocTypeNotNullable: (result, transform) => ({ + type: 'JsdocTypeNotNullable', + element: transform(result.element), + meta: { + position: result.meta.position + } + }), + JsdocTypeSpecialNamePath: result => result, + JsdocTypeKeyValue: (result, transform) => { + if (isPlainKeyValue(result)) { + return { + type: 'JsdocTypeKeyValue', + key: result.key, + right: result.right === undefined ? undefined : transform(result.right), + optional: result.optional, + readonly: result.readonly, + meta: result.meta + }; + } + else { + return { + type: 'JsdocTypeKeyValue', + left: transform(result.left), + right: transform(result.right), + meta: result.meta + }; + } + }, + JsdocTypeImport: (result, transform) => ({ + type: 'JsdocTypeImport', + element: transform(result.element) + }), + JsdocTypeAny: result => result, + JsdocTypeStringValue: result => result, + JsdocTypeNamePath: result => result, + JsdocTypeVariadic: (result, transform) => { + const transformed = { + type: 'JsdocTypeVariadic', + meta: { + position: result.meta.position, + squareBrackets: result.meta.squareBrackets + } + }; + if (result.element !== undefined) { + transformed.element = transform(result.element); + } + return transformed; + }, + JsdocTypeTuple: (result, transform) => ({ + type: 'JsdocTypeTuple', + elements: result.elements.map(transform) + }), + JsdocTypeName: result => result, + JsdocTypeFunction: (result, transform) => { + const transformed = { + type: 'JsdocTypeFunction', + arrow: result.arrow, + parameters: result.parameters.map(transform), + parenthesis: result.parenthesis + }; + if (result.returnType !== undefined) { + transformed.returnType = transform(result.returnType); + } + return transformed; + }, + JsdocTypeKeyof: (result, transform) => ({ + type: 'JsdocTypeKeyof', + element: transform(result.element) + }), + JsdocTypeParenthesis: (result, transform) => ({ + type: 'JsdocTypeParenthesis', + element: transform(result.element) + }), + JsdocTypeProperty: result => result + }; + } + + const visitorKeys = { + JsdocTypeAny: [], + JsdocTypeFunction: ['parameters', 'returnType'], + JsdocTypeGeneric: ['left', 'elements'], + JsdocTypeImport: [], + JsdocTypeIntersection: ['elements'], + JsdocTypeKeyof: ['element'], + JsdocTypeKeyValue: ['right'], + JsdocTypeName: [], + JsdocTypeNamePath: ['left', 'right'], + JsdocTypeNotNullable: ['element'], + JsdocTypeNull: [], + JsdocTypeNullable: ['element'], + JsdocTypeNumber: [], + JsdocTypeObject: ['elements'], + JsdocTypeOptional: ['element'], + JsdocTypeParenthesis: ['element'], + JsdocTypeSpecialNamePath: [], + JsdocTypeStringValue: [], + JsdocTypeSymbol: ['element'], + JsdocTypeTuple: ['elements'], + JsdocTypeTypeof: ['element'], + JsdocTypeUndefined: [], + JsdocTypeUnion: ['elements'], + JsdocTypeUnknown: [], + JsdocTypeVariadic: ['element'], + JsdocTypeProperty: [] + }; + + function _traverse(node, parentNode, property, onEnter, onLeave) { + onEnter === null || onEnter === void 0 ? void 0 : onEnter(node, parentNode, property); + const keysToVisit = visitorKeys[node.type]; + if (keysToVisit !== undefined) { + for (const key of keysToVisit) { + const value = node[key]; + if (value !== undefined) { + if (Array.isArray(value)) { + for (const element of value) { + _traverse(element, node, key, onEnter, onLeave); + } + } + else { + _traverse(value, node, key, onEnter, onLeave); + } + } + } + } + onLeave === null || onLeave === void 0 ? void 0 : onLeave(node, parentNode, property); + } + function traverse(node, onEnter, onLeave) { + _traverse(node, undefined, undefined, onEnter, onLeave); + } + + exports.catharsisTransform = catharsisTransform; + exports.identityTransformRules = identityTransformRules; + exports.jtpTransform = jtpTransform; + exports.parse = parse; + exports.stringify = stringify; + exports.stringifyRules = stringifyRules; + exports.transform = transform; + exports.traverse = traverse; + exports.tryParse = tryParse; + exports.visitorKeys = visitorKeys; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/package.json b/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/package.json new file mode 100644 index 00000000000000..153857c6765b59 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/jsdoc-type-pratt-parser/package.json @@ -0,0 +1,100 @@ +{ + "name": "jsdoc-type-pratt-parser", + "version": "2.0.0", + "description": "", + "main": "dist/index.js", + "types": "dist/src/index.d.ts", + "directories": { + "test": "test" + }, + "scripts": { + "test": "npm run typecheck && npm run lint && npm run test:spec", + "test:spec": "mocha", + "test:coverage": "nyc --all npm run test:spec", + "test:coveralls": "nyc report --reporter=lcov && coveralls", + "lint": "ts-standard", + "typecheck": "tsc --noEmit", + "build": "rollup -c", + "apidoc": "typedoc src/index.ts --out docs", + "preversion": "npm test", + "prepublishOnly": "npm run build", + "semantic-release": "semantic-release" + }, + "author": "Simon Seyock (https://github.com/simonseyock)", + "contributors": [ + "Brett Zamir" + ], + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "devDependencies": { + "@rollup/plugin-typescript": "^8.1.1", + "@semantic-release/changelog": "^5.0.1", + "@semantic-release/git": "^9.0.0", + "@types/chai": "^4.2.14", + "@types/mocha": "^8.2.0", + "@types/node": "^14.14.31", + "@types/sinon": "^10.0.0", + "@types/sinon-chai": "^3.2.5", + "benchmark": "^2.1.4", + "catharsis": "^0.9.0", + "chai": "^4.3.0", + "coveralls": "^3.1.0", + "eslint-config-standard-with-typescript": "^20.0.0", + "jsdoctypeparser": "^9.0.0", + "mocha": "^8.2.1", + "nyc": "^15.1.0", + "rollup": "^2.39.0", + "semantic-release": "^17.4.3", + "sinon": "^10.0.0", + "sinon-chai": "^3.7.0", + "ts-node": "^9.1.1", + "ts-standard": "^10.0.0", + "typedoc": "^0.20.24", + "typescript": "^4.1.3" + }, + "ts-standard": { + "ignore": [ + "/submodules/", + "/build/", + "/pages/" + ] + }, + "files": [ + "dist/**/*", + "src/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser.git" + }, + "bugs": "https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues", + "homepage": "https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser", + "keywords": [ + "jsdoc", + "pratt", + "parser" + ], + "release": { + "branches": [ + "main", + { + "name": "dev", + "prerelease": true + } + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/github", + "@semantic-release/npm", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/git" + ] + }, + "publishConfig": { + "access": "public" + }, + "dependencies": {} +} diff --git a/tools/node_modules/eslint/node_modules/jsesc/README.md b/tools/node_modules/eslint/node_modules/jsesc/README.md deleted file mode 100644 index aae2b13a19befd..00000000000000 --- a/tools/node_modules/eslint/node_modules/jsesc/README.md +++ /dev/null @@ -1,421 +0,0 @@ -# jsesc [![Build status](https://travis-ci.org/mathiasbynens/jsesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/jsesc) [![Code coverage status](https://coveralls.io/repos/mathiasbynens/jsesc/badge.svg)](https://coveralls.io/r/mathiasbynens/jsesc) [![Dependency status](https://gemnasium.com/mathiasbynens/jsesc.svg)](https://gemnasium.com/mathiasbynens/jsesc) - -Given some data, _jsesc_ returns a stringified representation of that data. jsesc is similar to `JSON.stringify()` except: - -1. it outputs JavaScript instead of JSON [by default](#json), enabling support for data structures like ES6 maps and sets; -2. it offers [many options](#api) to customize the output; -3. its output is ASCII-safe [by default](#minimal), thanks to its use of [escape sequences](https://mathiasbynens.be/notes/javascript-escapes) where needed. - -For any input, jsesc generates the shortest possible valid printable-ASCII-only output. [Here’s an online demo.](https://mothereff.in/js-escapes) - -jsesc’s output can be used instead of `JSON.stringify`’s to avoid [mojibake](https://en.wikipedia.org/wiki/Mojibake) and other encoding issues, or even to [avoid errors](https://twitter.com/annevk/status/380000829643571200) when passing JSON-formatted data (which may contain U+2028 LINE SEPARATOR, U+2029 PARAGRAPH SEPARATOR, or [lone surrogates](https://esdiscuss.org/topic/code-points-vs-unicode-scalar-values#content-14)) to a JavaScript parser or an UTF-8 encoder. - -## Installation - -Via [npm](https://www.npmjs.com/): - -```bash -npm install jsesc -``` - -In [Node.js](https://nodejs.org/): - -```js -const jsesc = require('jsesc'); -``` - -## API - -### `jsesc(value, options)` - -This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](https://mathiasbynens.be/notes/javascript-escapes). The first supported value type is strings: - -```js -jsesc('Ich ♥ Bücher'); -// → 'Ich \\u2665 B\\xFCcher' - -jsesc('foo 𝌆 bar'); -// → 'foo \\uD834\\uDF06 bar' -``` - -Instead of a string, the `value` can also be an array, an object, a map, a set, or a buffer. In such cases, `jsesc` returns a stringified version of the value where any characters that are not printable ASCII symbols are escaped in the same way. - -```js -// Escaping an array -jsesc([ - 'Ich ♥ Bücher', 'foo 𝌆 bar' -]); -// → '[\'Ich \\u2665 B\\xFCcher\',\'foo \\uD834\\uDF06 bar\']' - -// Escaping an object -jsesc({ - 'Ich ♥ Bücher': 'foo 𝌆 bar' -}); -// → '{\'Ich \\u2665 B\\xFCcher\':\'foo \\uD834\\uDF06 bar\'}' -``` - -The optional `options` argument accepts an object with the following options: - -#### `quotes` - -The default value for the `quotes` option is `'single'`. This means that any occurrences of `'` in the input string are escaped as `\'`, so that the output can be used in a string literal wrapped in single quotes. - -```js -jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.'); -// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' - -jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'single' -}); -// → '`Lorem` ipsum "dolor" sit \\\'amet\\\' etc.' -// → "`Lorem` ipsum \"dolor\" sit \\'amet\\' etc." -``` - -If you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`. - -```js -jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'double' -}); -// → '`Lorem` ipsum \\"dolor\\" sit \'amet\' etc.' -// → "`Lorem` ipsum \\\"dolor\\\" sit 'amet' etc." -``` - -If you want to use the output as part of a template literal (i.e. wrapped in backticks), set the `quotes` option to `'backtick'`. - -```js -jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'backtick' -}); -// → '\\`Lorem\\` ipsum "dolor" sit \'amet\' etc.' -// → "\\`Lorem\\` ipsum \"dolor\" sit 'amet' etc." -// → `\\\`Lorem\\\` ipsum "dolor" sit 'amet' etc.` -``` - -This setting also affects the output for arrays and objects: - -```js -jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, { - 'quotes': 'double' -}); -// → '{"Ich \\u2665 B\\xFCcher":"foo \\uD834\\uDF06 bar"}' - -jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], { - 'quotes': 'double' -}); -// → '["Ich \\u2665 B\\xFCcher","foo \\uD834\\uDF06 bar"]' -``` - -#### `numbers` - -The default value for the `numbers` option is `'decimal'`. This means that any numeric values are represented using decimal integer literals. Other valid options are `binary`, `octal`, and `hexadecimal`, which result in binary integer literals, octal integer literals, and hexadecimal integer literals, respectively. - -```js -jsesc(42, { - 'numbers': 'binary' -}); -// → '0b101010' - -jsesc(42, { - 'numbers': 'octal' -}); -// → '0o52' - -jsesc(42, { - 'numbers': 'decimal' -}); -// → '42' - -jsesc(42, { - 'numbers': 'hexadecimal' -}); -// → '0x2A' -``` - -#### `wrap` - -The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting. - -```js -jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'single', - 'wrap': true -}); -// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\'' -// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'" - -jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'double', - 'wrap': true -}); -// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."' -// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\"" -``` - -#### `es6` - -The `es6` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, any astral Unicode symbols in the input are escaped using [ECMAScript 6 Unicode code point escape sequences](https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point) instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5 environments is a concern, don’t enable this setting. If the `json` setting is enabled, the value for the `es6` setting is ignored (as if it was `false`). - -```js -// By default, the `es6` option is disabled: -jsesc('foo 𝌆 bar 💩 baz'); -// → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz' - -// To explicitly disable it: -jsesc('foo 𝌆 bar 💩 baz', { - 'es6': false -}); -// → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz' - -// To enable it: -jsesc('foo 𝌆 bar 💩 baz', { - 'es6': true -}); -// → 'foo \\u{1D306} bar \\u{1F4A9} baz' -``` - -#### `escapeEverything` - -The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output are escaped — even printable ASCII symbols. - -```js -jsesc('lolwat"foo\'bar', { - 'escapeEverything': true -}); -// → '\\x6C\\x6F\\x6C\\x77\\x61\\x74\\"\\x66\\x6F\\x6F\\\'\\x62\\x61\\x72' -// → "\\x6C\\x6F\\x6C\\x77\\x61\\x74\\\"\\x66\\x6F\\x6F\\'\\x62\\x61\\x72" -``` - -This setting also affects the output for string literals within arrays and objects. - -#### `minimal` - -The `minimal` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, only a limited set of symbols in the output are escaped: - -* U+0000 `\0` -* U+0008 `\b` -* U+0009 `\t` -* U+000A `\n` -* U+000C `\f` -* U+000D `\r` -* U+005C `\\` -* U+2028 `\u2028` -* U+2029 `\u2029` -* whatever symbol is being used for wrapping string literals (based on [the `quotes` option](#quotes)) - -Note: with this option enabled, jsesc output is no longer guaranteed to be ASCII-safe. - -```js -jsesc('foo\u2029bar\nbaz©qux𝌆flops', { - 'minimal': false -}); -// → 'foo\\u2029bar\\nbaz©qux𝌆flops' -``` - -#### `isScriptContext` - -The `isScriptContext` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, occurrences of [`` or `